Ok. Is there any way to go specifically from 7 to 8 with “bench update”? Also, should I upgrade on the old 32bit VM and then make backups and migrate them to the new VM? Lastly, I tried using “bench new-site erpnext.vm” to mimic the old VM and I get “Errno 13: Permission denied” (Tried this assuming that the problem was that the sites did not match between the two VMs).
Maybe this procedure would solve your problem. I recommend you to take snapshots at each step just to make sure you can revert to a previous point in time if anything goes wrong though.
Hi I have done several migrations from v7 to v11, so far so good. You can just restore your v7 to v11 and do bench update or bench migrate. But please get a backup of your v7 first before doing anything else (just incase).
you mean backing up the old database and restoring it on a new v11 instance?
Yes. But save a backup of v7 just in case anything goes wrong.
This is what I’ve been trying to do. I will try @vrms suggestion, but would like to see the steps involved with your solution. I’m doing all of this in a test environment with backups of the VMs, so no need to worry about corrupting the actual site that is running.
- copy v7 db to your v11
- do bench update or migrate (it should apply all patches)
you might have to do step #2 a couple of times it will keep returning errors that says a column in the table does not exists.
Yes, it does return the errors you mention. But no matter how many times I update, the errors remain and the site returns “Internal Server Error.” Here is more info just for anyone that might have more insight in the matter:
I need to go from a 32bit VM running ERPNext 7 to a 64bit VM running ERPNext 11 because apparently some features of ERPNext 11 (like Yarn) require a 64bit OS. So I’ve created a new VM with the updated ERPNext 11 and have backed up the database from the old VM and copied it over to the new VM. When I run the bench restore and migrate functions, it works but returns some errors (like the errors mentioned above about database table columns missing). This led me to revisit the guide: Restoring From ERPNext Backup · frappe/erpnext Wiki · GitHub which states that the site must already exist if moving from one machine to another. So back to my original question: Do I have to create this site to mimic the old one? Or is migrating the old database into “site1.local” the correct way? Also, are the errors most likely related to going from 32bit to 64bit? Or just from old ERPNext to new ERPNext without installing the consecutive updates? Going to read up on @vrms solution and start going from there in the meantime.
if internal server error check the error logs.
I tried the procedure you mentioned. It works to a certain point and then fails at the bench update as before. I went from v7 to v8, but at the update, fails at installing Yarn. This is what happened when just trying to do the normal bench update from v7 without going specifically to v8. Any help is appreciated.
I recently migrated fron v8 to v11 on Amazon.
good for you .
Would you mind to share the exact steps which worked for you here?
Hi @vrms
I took backup of bench, frappe, erpnext and other custom app on git then I took database backup.
I executed bench update --reset command.
At the end it was failed to build js and CSS file. I don’t know why, but then I took all js and CSS file from other v11 server and manually upload all the files. At the last it was working fine.
How does one go about backing up bench, frappe, erpnext, etc.? According to the docs, the only things you have to back up are the database and files in private/files and public/files.
Since yarn fails when doing bench update, I try to install it on its own. This is what I get when doing “sudo npm install yarn” from the old VM (ERPNext v7):
0 info it worked if it ends with ok
1 verbose cli [ ‘/usr/bin/nodejs’, ‘/usr/bin/npm’, ‘install’, ‘yarn’ ]
2 info using npm@1.3.10
3 info using node@v0.10.25
4 verbose cache add [ ‘yarn’, null ]
5 verbose cache add name=undefined spec=“yarn” args=[“yarn”,null]
6 verbose parsed url { protocol: null,
6 verbose parsed url slashes: null,
6 verbose parsed url auth: null,
6 verbose parsed url host: null,
6 verbose parsed url port: null,
6 verbose parsed url hostname: null,
6 verbose parsed url hash: null,
6 verbose parsed url search: null,
6 verbose parsed url query: null,
6 verbose parsed url pathname: ‘yarn’,
6 verbose parsed url path: ‘yarn’,
6 verbose parsed url href: ‘yarn’ }
7 silly lockFile d19a2519-yarn yarn
8 verbose lock yarn /home/frappe/.npm/d19a2519-yarn.lock
9 silly lockFile d19a2519-yarn yarn
10 silly lockFile d19a2519-yarn yarn
11 verbose addNamed [ ‘yarn’, ‘’ ]
12 verbose addNamed [ null, ‘’ ]
13 silly lockFile d5475ddd-yarn yarn@
14 verbose lock yarn@ /home/frappe/.npm/d5475ddd-yarn.lock
15 silly addNameRange { name: ‘yarn’, range: '’, hasData: false }
16 verbose url raw yarn
17 verbose url resolving [ ‘https://registry.npmjs.org/’, ‘./yarn’ ]
18 verbose url resolved https://registry.npmjs.org/yarn
19 info trying registry request attempt 1 at 10:56:51
20 http GET https://registry.npmjs.org/yarn
21 info retry will retry, error on last attempt: Error: CERT_UNTRUSTED
22 info trying registry request attempt 2 at 10:57:01
23 http GET https://registry.npmjs.org/yarn
24 info retry will retry, error on last attempt: Error: CERT_UNTRUSTED
25 info trying registry request attempt 3 at 10:58:01
26 http GET https://registry.npmjs.org/yarn
27 silly lockFile d5475ddd-yarn yarn@
28 silly lockFile d5475ddd-yarn yarn@
29 error Error: CERT_UNTRUSTED
29 error at SecurePair. (tls.js:1370:32)
29 error at SecurePair.EventEmitter.emit (events.js:92:17)
29 error at SecurePair.maybeInitFinished (tls.js:982:10)
29 error at CleartextStream.read [as _read] (tls.js:469:13)
29 error at CleartextStream.Readable.read (_stream_readable.js:320:10)
29 error at EncryptedStream.write [as _write] (tls.js:366:25)
29 error at doWrite (_stream_writable.js:223:10)
29 error at writeOrBuffer (_stream_writable.js:213:5)
29 error at EncryptedStream.Writable.write (_stream_writable.js:180:11)
29 error at write (_stream_readable.js:583:24)
30 error If you need help, you may report this log at:
30 error http://github.com/isaacs/npm/issues
30 error or email it to:
30 error npm-@googlegroups.com
31 error System Linux 3.13.0-79-generic
32 error command “/usr/bin/nodejs” “/usr/bin/npm” “install” “yarn”
33 error cwd /home/frappe/frappe-bench
34 error node -v v0.10.25
35 error npm -v 1.3.10
36 verbose exit [ 1, true ]
So from the above log it looks to be hanging on a certificate error correct? Any way to bypass this?
You can push code on github.
I was able to get the old database copied and restored to the new VM by creating a site that mimics the old site name. I did the restore, then bench migrate, then bench update --patch, then bench update, then bench restart. Refresh the site and get this:
Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/website/render.py”, line 45, in render
data = render_page_by_language(path)
File “/home/frappe/frappe-bench/apps/frappe/frappe/website/render.py”, line 142, in render_page_by_language
return render_page(path)
File “/home/frappe/frappe-bench/apps/frappe/frappe/website/render.py”, line 158, in render_page
return build(path)
File “/home/frappe/frappe-bench/apps/frappe/frappe/website/render.py”, line 165, in build
return build_page(path)
File “/home/frappe/frappe-bench/apps/frappe/frappe/website/render.py”, line 181, in build_page
html = frappe.render_template(context.source, context)
File “/home/frappe/frappe-bench/apps/frappe/frappe/utils/jinja.py”, line 75, in render_template
return get_jenv().from_string(template).render(context)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/jinja2/environment.py”, line 1008, in render
return self.environment.handle_exception(exc_info, True)
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/jinja2/environment.py”, line 780, in handle_exception
reraise(exc_type, exc_value, tb)
File “”, line 1, in top-level template code
File “/home/frappe/frappe-bench/apps/frappe/frappe/./templates/web.html”, line 6, in top-level template code
{%- if page_or_generator==“Generator” %}source-type=“Generator” data-doctype=“{{ doctype }}”{% endif %}
File “/home/frappe/frappe-bench/apps/frappe/frappe/./templates/base.html”, line 38, in top-level template code
{% block body %}
File “/home/frappe/frappe-bench/apps/frappe/frappe/./templates/base.html”, line 64, in block “body”
{% block content %}{% endblock %}
File “/home/frappe/frappe-bench/apps/frappe/frappe/./templates/web.html”, line 49, in block “content”
{%- block page_content -%}{%- endblock -%}
File “”, line 29, in block “page_content”
File “/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/jinja2/environment.py”, line 430, in getattr
return getattr(obj, attribute)
UndefinedError: ‘ldap_settings’ is undefined
Any ideas?
Nevermind, got past the above issue by clearing cache and another bench update. So now when trying to log in with either user or admin I get this:
[ERROR] 2019-02-12 22:06:18,693 | /home/frappe/frappe-bench/apps/frappe/frappe/app.py:
Site: site1.local
Form Dict: {
“cmd”: “login”,
“device”: “desktop”,
“pwd”: “admin”,
“usr”: “administrator”
}
Request Error
Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/app.py”, line 58, in application
init_request(request)
File “/home/frappe/frappe-bench/apps/frappe/frappe/app.py”, line 120, in init_request
frappe.local.http_request = frappe.auth.HTTPRequest()
File “/home/frappe/frappe-bench/apps/frappe/frappe/auth.py”, line 51, in init
frappe.local.login_manager = LoginManager()
File “/home/frappe/frappe-bench/apps/frappe/frappe/auth.py”, line 105, in init
if self.login()==False: return
File “/home/frappe/frappe-bench/apps/frappe/frappe/auth.py”, line 126, in login
self.authenticate(user=user, pwd=pwd)
File “/home/frappe/frappe-bench/apps/frappe/frappe/auth.py”, line 209, in authenticate
self.check_if_enabled(user)
File “/home/frappe/frappe-bench/apps/frappe/frappe/auth.py”, line 215, in check_if_enabled
if cint(doc.allow_consecutive_login_attempts) > 0:
AttributeError: ‘SystemSettings’ object has no attribute ‘allow_consecutive_login_attempts’
[ERROR] 2019-02-12 22:06:18,702 | /home/frappe/frappe-bench/apps/frappe/frappe/utils/error.py:
New Exception collected with id: 2019-02-12 22:06:18.694281-10.0.2.2-853