Try ERPNext Buy Support Partners Foundation

I want to know about the "bench migrate" and "bench update"

I’m confused with “bench migrate” and "bench update"
In what situations should bench migrate be used?
And in what situations should bench update be used?

Please help :cold_sweat:

Hi,

As per this link, these commands do the following:
bench update: Pulls changes for bench-repo and all apps, applies patches, builds JS and CSS, and then migrates.

bench migrate: Run patches, sync schema and rebuild files/translations

Hope this helps.

2 Likes

The way I understand it is this:

  1. bench update. You use bench update to get the updates from the git repositories of the apps (bench, frappe, erpnext, and other custom apps). So, doing bench update also does bench migrate.

  2. bench migrate

  • When you do custom apps, you may use the online DocType forms to create apps and make changes to the form structure. The online form automatically updates the MariaDB database as well as the json file in your code.

  • But what if you don’t use the online form. If you are good with json and familiar with the json structure of forms, maybe it is quicker for you to make changes directly to the json file instead of going through the online form. And maybe, you need to write patches to change the records in the database. Or maybe, you made changes to the js file or html files. This is when you do bench migrate. Bench migrate will look ot what you coded and make the corresponding changes to the MariaDB database.

1 Like