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

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/*

4 Likes

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

This happens due to shallow cloning.

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
[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:

looks like this is what I have (see above)

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

use the config from here:

3 Likes

This worked for me. Thank you!

1 Like

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

1 Like

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

@generare This is the official way to do it:

bench --site [your site name] backup
1 Like

Added instructions for removal of frappe_io and foundation apps:

1 Like

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

2 Likes

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

1 Like

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

1 Like

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

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

Yeah, shouldn’t be an issue

1 Like

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

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

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