How to update from v10 to V11

Hi,

The staging branch does exist on Github, and the problem with the command “switch-to-*” comes from your git configuration file for ERPNext:

Make sure it fetches all branches on upstream and not only develop or master.

Here is an example of an app already switched to staging:

image

2 Likes

Yarn Error after Step 2 bench setup requirements , any ideas/ clue to resolve it ?

Full Trace

frappe@ERPNext:~/frappe-bench$ bench update --requirements

INFO:bench.utils:./env/bin/pip install Pillow
Requirement already satisfied: Pillow in ./env/lib/python2.7/site-packages (5.3.0)
Updating Python libraries…
INFO:bench.utils:./env/bin/pip install --upgrade pip
Requirement already up-to-date: pip in ./env/lib/python2.7/site-packages (18.0)
INFO:bench.utils:./env/bin/pip install -q -r /home/frappe/.bench/requirements.txt
INFO:bench.utils:./env/bin/pip install -q -r ./apps/foundation/requirements.txt
INFO:bench.utils:./env/bin/pip install -q -r ./apps/frappe_io/requirements.txt
INFO:bench.utils:./env/bin/pip install -q -r ./apps/frappe/requirements.txt
INFO:bench.utils:./env/bin/pip install -q -r ./apps/erpnext/requirements.txt
Updating node packages…
INFO:bench.utils:yarn install
yarn install v1.10.1
error An unexpected error occurred: “EACCES: permission denied, scandir ‘/home/frappe/.config/yarn/link’”.
info If you think this is a bug, please open a bug report with the information provided in “/home/frappe/frappe-bench/apps/frappe/yarn-error.log”.
info Visit yarn install | Yarn for documentation about this command.
Traceback (most recent call last):
File “/usr/local/bin/bench”, line 11, in
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 77, in _update
update_node_packages(bench_path=bench_path)
File “/home/frappe/.bench/bench/utils.py”, line 449, in update_node_packages
update_yarn_packages(bench_path)
File “/home/frappe/.bench/bench/utils.py”, line 462, in update_yarn_packages
exec_cmd(‘yarn install’, cwd=app_path)
File “/home/frappe/.bench/bench/utils.py”, line 159, in exec_cmd
raise CommandFailedError(cmd)
bench.utils.CommandFailedError: yarn install

login as a root and run npm install -g yarn

@saurabh6790 ,
getting following error while trying to migrate

Backing up sites…
Traceback (most recent call last):
File “/usr/lib/python2.7/runpy.py”, line 174, in _run_module_as_main
main”, fname, loader, pkg_name)
File “/usr/lib/python2.7/runpy.py”, line 72, in _run_code
exec code in run_globals
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 97, in
main()
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 18, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 722, in call
return self.main(*args, **kwargs)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 697, in main
rv = self.invoke(ctx)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 535, in invoke
return callback(*args, **kwargs)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/click/decorators.py”, line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/init.py”, line 25, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py”, line 296, in backup
frappe.connect()
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 171, in connect
from frappe.database import Database
ImportError: cannot import name Database

can you please help ,

1 Like

Hi @root13F, I’m facing the same issue. The versions are:

Installed Apps
ERPNext: v10.1.64 (master)
Frappe Framework: v11.0.3-beta.14 () (staging)

This is my test instance. It was Frappe v10 before. I switched the branch and stuff. I mean, I don’t see any changes ; I think , I need ERPNext v11 for updated features. How can I achieve that?

I’m also willing to start from scratch.

Thanks in advance.

First it has been recommended that both your apps should be on the same branch i.e. master or staging. Also, one thing to note is v11 features have not yet been merged into master. SO to try them out you’ll have to switch to staging branch.

I recommend that If you are testing v11 then make a new site and try those changes there in your development server or PC. Then try bench switch-to-branch staging and bench update --patch to get it done.

@root13F I’m trying to switch to staging branch; while switching ERPNext, it shows “Branch staging does not exist in Upstream for erpnext”

I’m following this

Master branch : v10
Staging branch : v11

If you want to switch to v11, goto your bench and run

Switch to staging branch
bench switch-to-branch staging frappe
bench switch-to-branch staging erpnext

Setup requirements
bench setup requirements

Migrate site
bench --site site-name migrate

Restart supervisor.
bench restart

Getting “Branch staging does not exist in Upstream for erpnext” in the 2nd step.

2 Likes

@chdecultot How do I make sure to fetch all branches on upstream?

I can switch Frappe to staging but for ERPNext it says, doesn’t exist on upstream!

Hi,

Refer to my solution here:

2 Likes

Thanks @snv. I already did. Using the Staging now; testing. Getting errors after saving stuffs.

Hopefully a master version will be released soon.

Thanks again.

2 Likes

Hi @fnrfarid,
@snv solution is the correct one.
If it’s still not working check the .git/config file directly in the erpnext folder.

If correctly configured (like in @snv post) you should be able to make a git fetch and fetch the staging branch.

It’s strictly a git issue, so maybe you can find some help by making some git tutorials or looking in Google in reference to the error generated by the git command.

Good luck! :blush:

Sorry didn’t see your last message :hushed:

Maybe you can post your issues with the staging branch?
You may not be the only one facing these issues.

as shown by @snv here

1 Like

getting the following error

any solution

Change the line in git .config file as shown in post 19 of this thread. The text after fetch =
Then try again to migrate ERPNext

tried it
made changes to erpnext git config file
image

but still giving me same error while trying to switch branch

You need to edit it as below.

fetch = +refs/heads/:refs/remotes/upstream/
Ensure the characters are correct. Save the file and then use

bench switch-to-branch staging erpnext

use bench switch-to-branch staging frappe (if your frappe is still on Master)

bench setup requirements

bench --site site-name migrate

bench restart

Frappe and ERPNext should both be on Staging. Had the same issue till I fixed the config file. Since then now more problems. ignore npm if it throws any error.

This is the entire config file
image
still no luck ,
can you share your config file please , it will help out a lot ,

thanks