Update ERPNext without losing changes

I am running ERPNext production v13.18.0 and I see in Git that current release is 13.26.0. I am looking to update. I also am not a tech guy and do not have indepth knowledge of GIT.

I have made some changes to form (ex. Lead) for my convenience. Such changes include adding a new field (Ex. Lead’s skype id.). To do this I go to “Customize” from Lead Doctype. (see image)


I added a new field “Skype ID” as in image below:

Sometimes I make changes like making some unnecessary field Hidden, or change permission level of some fields as per my need.
I also have some custom client scripts running on different doctypes, and alot of notifications (sms and email) set for different events in different Doctypes.
I have not made changes in the source code.

Now, when I update with:

bench update

will I lose all my modifications ? I have not tried to update yet with the fear of losing customizations.

  1. What is the correct way to update ERPNext without losing changes ?

  2. What would be a good way to update if I had made changes to the code also ?
    (assume my changes are not useful to the community so I would not send a pull request)

The changes and configuration settings should not get messed up. They are usually not affected by an update. Run the update fearlessly. Get a database backup before you do (it’s actually a part of the update script) so that you can restore if necessary. But I don’t think you will have a problem.

Hope this helps.

Thanks

Jay

2 Likes

I ran

bench update

I got the following message:

Cannot proceed with update: You have local changes in app “frappe” that are not committed.
Here are your choices:

  1. Merge the frappe app manually with “git pull” / “git pull --rebase” and fix conflicts.
  2. Temporarily remove your changes with “git stash” or discard them completely
    with “bench update --reset” or for individual repositries “git reset --hard”
  3. If your changes are helpful for others, send in a pull request via GitHub and
    wait for them to be merged in the core.

This is exactly what I wanted to avoid. How can I solve the issue without removing my customizations ? I am not an expert on GIT.
I also read the documentationson git stash. But I am not sure if I should proceed. And how should I proceed ?

Update:

I found the following steps:

Are these safe to run ?

If you have not made any changes, just run bench update --reset

There’s some harmless reason that error crops up and if you haven’t made any customisations it won’t affect your instance at all.

Hope this helps.

Thanks

Jay

It’s safe, if you don’t forget to do step 8 “git stash apply” afterwards.

By the way: What customizations have to made? If you use the customize feature, it should not affect your frappe folder, but as you got the message, that “You have local changes in app “frappe” that are not committed” it seems that there has been something changed.

Or maybe you have exported the customizations into the frappe module?

Just run “git status” in the frappe folder and post the output here. We can see what kind of customizations have been done.

I realized after running

git status
that I had made a small 1 line edit in the source code. It is not much important but I did as per the above steps and later applied git stash as in step 8.

I now have an updated ERPNext will all my customizations and the modified code as well.

Thank you for your time.

Also, Thank you @JayRam

1 Like