How to update custom app with latest changes

Hi everyone,
I want to know how to update my custom app without losing the data related to it .
because when I update json file of my custom app
then using terminal windows with the following command :
bench --site site-name uninstall-app app-name
then use
bench --site site-name install-app app-name
it will delete all the records.It seem a fresh installtion of app.
So can any one tell me. How I can update my whole app without losing the record ?
waiting for the fast response

bench update should load the latest version from your remote location.

If you just have a local version and need to reload it, there are a couple things/ways:
bench restart will sometimes be enough.
bench migrate is the most thorough way.

Hi everyone,
I want to know how to update my custom app without losing the data related to it .
because when I update json file of my custom app
then using terminal windows with the following command :
bench --site site-name uninstall-app app-name
then use
bench --site site-name install-app app-name
it will delete all the records.It seem a fresh installtion of app.
So can any one tell me. How I can update my whole app without losing the record ?
waiting for the fast response

thanks
Karuna Nidhan

@Ben_Cornwell_Mott
Hi ,
Actually I am doing shifting of my custom app from one machine to another . e.g. dev to test server
at that time I am using
bench --site site-name uninstall-app app-name
then again to update my changes for custom app
bench--site site-name install-app app-name
then my all record on the test server will erase.
so now you can suggest me something

Hi @karuna,@Baljeetsingh
Please use the Following Steps:
1.Take Backup Of your Database.
2.Changes Commit and push on your customized app repo.
3.git pull from the repo in customized app.
4.Restore Database.
5.bench migrate.

Thanks,
Sagar Shiragawakar
New Indictrans Technologies Pvt Ltd.

2 Likes

Hello @sagar

5.bench migrate.

If the old and the new servers are having the same ERPNext version, it is required to do bench migrate? Why?
Regards
Bilal