ERPNext Conference 2019* ERPNext.com Blog

[Release] Instructions for updating to/staying on v10/v11

release

#19

Hi @vrms,

Go to ERPNext’s folder, open .git/config and make sure it is set up to fetch all branches in upstream:

fetch = +refs/heads/*:refs/remotes/upstream/*


#20

After this run git fetch too.
Then you will be able to run bench switch-to-branch ...

This happens due to shallow cloning.


#21

thanks @chdecultot

my erpnext/.git.config (after replacing the staging with * looks like this now

[core]
       repositoryformatversion = 0
       filemode = true
       bare = false
       logallrefupdates = true
[remote "upstream"]
       url = https://github.com/frappe/erpnext
       fetch = +refs/heads/staging:refs/remotes/upstream/*
[branch "staging"]
       remote = upstream
       merge = refs/heads/staging

even though this is the same as in the config file of frappe it is still not working out

~/frappe-bench$ bench switch-to-branch master erpnext --upgrade
fatal: Invalid refspec '+refs/heads/staging:refs/remotes/upstream/*'
Branch master does not exist in Upstream for erpnext
Switched to master
Please run `bench update --patch` to be safe from any differences in database schema

#22
[core]
       repositoryformatversion = 0
       filemode = true
       bare = false
       logallrefupdates = true
[remote "upstream"]
       url = https://github.com/frappe/erpnext
       fetch = +refs/heads/*:refs/remotes/upstream/*
[branch "staging"]
       remote = upstream
       merge = refs/heads/staging

@vrms this is what you want

and this too:


#23

looks like this is what I have (see above)

~/frappe-bench/apps/erpnext$ git fetch
fatal: Invalid refspec '+refs/heads/staging:refs/remotes/upstream/*'

#24

use the config from here:


[Release] ERPNext Version 12
#25

This worked for me. Thank you!


#26

sorry I overlooked the first * in the fetch = +refs ... line


#27

What is the official advice how to do backup of the whole ERPNext before upgrading it?


#28

@generare This is the official way to do it:

bench --site [your site name] backup

#29

Added instructions for removal of frappe_io and foundation apps:


#30

Got this error when updating my testing instance on ESXi/Ubuntu 16.04.

Updating node packages...
INFO:bench.utils:yarn install
yarn install v1.13.0
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
warning "rollup-plugin-vue > @vue/component-compiler@3.4.4" has unmet peer dependency "postcss@>=6.0".
[4/4] Building fresh packages...
Done in 18.41s.
Reloading bench...
Traceback (most recent call last):
  File "/usr/local/bin/bench", line 11, in <module>
    load_entry_point('bench', 'console_scripts', 'bench')()
  File "/home/frappe/.bench/bench/cli.py", line 40, in cli
    bench_command()
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/home/frappe/.bench/bench/commands/update.py", line 60, in update
    _update(pull, patch, build, bench, auto, restart_supervisor, restart_systemd, requirements, no_backup, force=force, reset=reset)
  File "/home/frappe/.bench/bench/commands/update.py", line 85, in _update
    reload(bench.utils)
UnboundLocalError: local variable 'reload' referenced before assignment
frappe@ene-test:~/frappe-bench$

Started bench update again and after second pass everything seems to be finished and OK


#31

This was detected and fixed immediately. So it ran successfully when re-run.


#32

Thanks… so if I try it now, it will be successful on the first run?


#33

Yes, I think so. Please report if that’s not the case.


#34

OK, I will try it once again. System will be consistent even after two-pass-update?


#35

Yeah, shouldn’t be an issue


#36

Just got the same error, when tried to update on ESXi/Centos7. Tried also on VirtualBox/Ubuntu18.04 and got also the same error.


#37

And works fine on re-running?
EDIT: Sorry, had fixed another issue with same error message. Thanks for reporting.


#38

Okey, I’ll give it another try, have snapshots before update