What are the steps required to upgrade from v10.x.x (production) to v11?

Ok, Starting my attempt at this list of commands now. Get back to you in then next our or so.

BKM

I forgot about that option - I normally do manual installs 'cos if something goes wrong on the script I can seldom find the problem, so I just don’t use that :smile:

OK, I tried this as listed and it failed. The failures began with this line:

cd apps/erpnext && git fetch upstream && git checkout master && cd -

Here is the trace for when it was run on my system:

erp_jmi@la:~/frappe-bench$ cd apps/frappe && git fetch upstream && git checkout master && cd -
Branch 'master' set up to track remote branch 'master' from 'upstream'.
Switched to a new branch 'master'
/home/erp_jmi/frappe-bench
erp_jmi@la:~/frappe-bench$ cd apps/erpnext && git fetch upstream && git checkout master && cd -
error: pathspec 'master' did not match any file(s) known to git.
erp_jmi@la:~/frappe-bench/apps/erpnext$ git fetch upstream
erp_jmi@la:~/frappe-bench/apps/erpnext$ git checkout master
error: pathspec 'master' did not match any file(s) known to git.
erp_jmi@la:~/frappe-bench/apps/erpnext$ cd -

Then, pretty much everything ended on the very next command when it could not find a missing module. Here is the trace for that part:

erp_jmi@la:~/frappe-bench$ bench update --requirements
INFO:bench.utils:./env/bin/pip install Pillow
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
Requirement already satisfied: Pillow in ./env/lib/python2.7/site-packages (5.3.0)
Backing up sites...
/home/erp_jmi/frappe-bench/env/bin/python: No module named past.builtins
erp_jmi@la:~/frappe-bench$ bench --site all migrate
/home/erp_jmi/frappe-bench/env/bin/python: No module named past.builtins
erp_jmi@la:~/frappe-bench$ bench --site site1.local migrate
/home/erp_jmi/frappe-bench/env/bin/python: No module named past.builtins
erp_jmi@la:~/frappe-bench$

As you can see in this part of the trace, the module “past.builtins” is what it is looking for and nothing works after this point.

Just so you can see everything I did was by the directions (minus a typo or two that was corrected along the way) her is the entire trace of the session:

erp_jmi@la:~$ cd frappe-bench
erp_jmi@la:~/frappe-bench$ bench switch-to-branch v11.x.x frappe
remote: Enumerating objects: 191, done.
remote: Counting objects: 100% (191/191), done.
remote: Compressing objects: 100% (58/58), done.
remote: Total 207 (delta 147), reused 162 (delta 133), pack-reused 16
Receiving objects: 100% (207/207), 58.88 KiB | 14.72 MiB/s, done.
Resolving deltas: 100% (154/154), completed with 39 local objects.
From https://github.com/frappe/frappe
   4a66d5284..eafd8ab13  develop    -> upstream/develop
   1c92e37b6..1152b1fb5  hotfix     -> upstream/hotfix
   65b727ef6..513621a02  master     -> upstream/master
 * [new tag]             v11.1.37   -> v11.1.37
Branch v11.x.x does not exist in Upstream for frappe
Switched to v11.x.x
Please run `bench update --patch` to be safe from any differences in database schema
erp_jmi@la:~/frappe-bench$ bench switch-to-branch v11.x.x erpnext
Branch v11.x.x does not exist in Upstream for erpnext
Switched to v11.x.x
Please run `bench update --patch` to be safe from any differences in database schema
erp_jmi@la:~/frappe-bench$ bench update --patch
Backing up sites...
Patching sites...
Migrating site1.local
Updating DocTypes for frappe        : [========================================]
Updating DocTypes for erpnext       : [========================================]
INFO:bench.utils:sudo supervisorctl restart frappe-bench-workers: frappe-bench-web:
frappe-bench-workers:frappe-bench-frappe-schedule: stopped
frappe-bench-workers:frappe-bench-frappe-long-worker-0: stopped
frappe-bench-workers:frappe-bench-frappe-short-worker-0: stopped
frappe-bench-workers:frappe-bench-frappe-default-worker-0: stopped
frappe-bench-web:frappe-bench-node-socketio: stopped
frappe-bench-web:frappe-bench-frappe-web: stopped
frappe-bench-workers:frappe-bench-frappe-schedule: started
frappe-bench-workers:frappe-bench-frappe-default-worker-0: started
frappe-bench-workers:frappe-bench-frappe-long-worker-0: started
frappe-bench-workers:frappe-bench-frappe-short-worker-0: started
frappe-bench-web:frappe-bench-frappe-web: started
frappe-bench-web:frappe-bench-node-socketio: started
________________________________________________________________________________
Bench: Deployment tool for Frappe and ERPNext (https://erpnext.org).
Open source depends on your contributions, so please contribute bug reports, patches, fixes or cash and be a part of the community
()
erp_jmi@la:~/frappe-bench$ cd apps/erpnext
erp_jmi@la:~/frappe-bench/apps/erpnext$ git config --unset-all remote.upstream.fecth
erp_jmi@la:~/frappe-bench/apps/erpnext$ git config --add remote.upstream.fecth '+refs/heads/:refs/remotes/upstream'
erp_jmi@la:~/frappe-bench/apps/erpnext$ cd .../...
-bash: cd: .../...: No such file or directory
erp_jmi@la:~/frappe-bench/apps/erpnext$ cd ..
erp_jmi@la:~/frappe-bench/apps$ cd ..
erp_jmi@la:~/frappe-bench$ bench update --patch
Backing up sites...
Patching sites...
Migrating site1.local
Updating DocTypes for frappe        : [========================================]
Updating DocTypes for erpnext       : [========================================]
INFO:bench.utils:sudo supervisorctl restart frappe-bench-workers: frappe-bench-web:
frappe-bench-workers:frappe-bench-frappe-schedule: stopped
frappe-bench-workers:frappe-bench-frappe-default-worker-0: stopped
frappe-bench-workers:frappe-bench-frappe-long-worker-0: stopped
frappe-bench-workers:frappe-bench-frappe-short-worker-0: stopped
frappe-bench-web:frappe-bench-node-socketio: stopped
frappe-bench-web:frappe-bench-frappe-web: stopped
frappe-bench-workers:frappe-bench-frappe-schedule: started
frappe-bench-workers:frappe-bench-frappe-default-worker-0: started
frappe-bench-workers:frappe-bench-frappe-long-worker-0: started
frappe-bench-workers:frappe-bench-frappe-short-worker-0: started
frappe-bench-web:frappe-bench-frappe-web: started
frappe-bench-web:frappe-bench-node-socketio: started
________________________________________________________________________________
Bench: Deployment tool for Frappe and ERPNext (https://erpnext.org).
Open source depends on your contributions, so please contribute bug reports, patches, fixes or cash and be a part of the community
()
erp_jmi@la:~/frappe-bench$ bench update --reset
INFO:bench.utils:updating bench
INFO:bench.utils:git pull
Already up to date.
INFO:bench.utils:./env/bin/pip install Pillow
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
Requirement already satisfied: Pillow in ./env/lib/python2.7/site-packages (5.3.0)
Backing up sites...
INFO:bench.app:pulling frappe
INFO:bench.utils:git fetch --all
Fetching upstream
INFO:bench.utils:git reset --hard upstream/v10.x.x
HEAD is now at 5cd5417ac fix(build): Add 'app' argument to 'bench build' (#7615)
INFO:bench.utils:find . -name "*.pyc" -delete
INFO:bench.app:pulling erpnext
INFO:bench.utils:git fetch --all
Fetching upstream
INFO:bench.utils:git reset --hard upstream/v10.x.x
HEAD is now at 30be118 fix(error-report): Do not send error reports to support@erpnext.com (#17864)
INFO:bench.utils:find . -name "*.pyc" -delete
Updating Python libraries...
INFO:bench.utils:./env/bin/pip install --upgrade pip
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
Requirement already up-to-date: pip in ./env/lib/python2.7/site-packages (19.1.1)
INFO:bench.utils:./env/bin/pip install -q -r /home/erp_jmi/.bench/requirements.txt
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
INFO:bench.app:installing frappe
INFO:bench.utils:./env/bin/pip install -q  -e ./apps/frappe
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
INFO:bench.app:installing erpnext
INFO:bench.utils:./env/bin/pip install -q  -e ./apps/erpnext
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
Updating node packages...
INFO:bench.utils:npm install
npm WARN frappe@ No description
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

audited 3555 packages in 8.628s
found 1 low severity vulnerability
  run `npm audit fix` to fix them, or `npm audit` for details
Patching sites...
Migrating site1.local
Updating DocTypes for frappe        : [========================================]
Updating DocTypes for erpnext       : [========================================]
INFO:bench.utils:bench build
Wrote css/frappe-web.css - 65.11 KB
Wrote js/frappe-web.min.js - 132.77 KB
Wrote js/control.min.js - 77.1 KB
Wrote js/dialog.min.js - 117.07 KB
Wrote css/desk.min.css - 309.05 KB
Wrote css/frappe-rtl.css - 32.49 KB
Wrote js/libs.min.js - 1.13 MB
Wrote js/desk.min.js - 460.05 KB
Wrote css/module.min.css - 2.08 KB
Wrote css/form.min.css - 4.47 KB
Wrote js/form.min.js - 196.97 KB
Wrote css/list.min.css - 13.36 KB
Wrote js/list.min.js - 154.92 KB
Wrote css/report.min.css - 7.89 KB
Wrote js/report.min.js - 260.58 KB
Wrote js/web_form.min.js - 247.55 KB
Wrote css/web_form.css - 24.42 KB
Wrote js/print_format_v3.min.js - 23.39 KB
Wrote css/erpnext.css - 8.1 KB
Wrote js/erpnext-web.min.js - 3.8 KB
Wrote js/erpnext.min.js - 162.18 KB
Wrote js/item-dashboard.min.js - 8.13 KB
INFO:bench.utils:sudo supervisorctl restart frappe-bench-workers: frappe-bench-web:
frappe-bench-workers:frappe-bench-frappe-schedule: stopped
frappe-bench-workers:frappe-bench-frappe-long-worker-0: stopped
frappe-bench-workers:frappe-bench-frappe-default-worker-0: stopped
frappe-bench-workers:frappe-bench-frappe-short-worker-0: stopped
frappe-bench-web:frappe-bench-node-socketio: stopped
frappe-bench-web:frappe-bench-frappe-web: stopped
frappe-bench-workers:frappe-bench-frappe-schedule: started
frappe-bench-workers:frappe-bench-frappe-default-worker-0: started
frappe-bench-workers:frappe-bench-frappe-long-worker-0: started
frappe-bench-workers:frappe-bench-frappe-short-worker-0: started
frappe-bench-web:frappe-bench-frappe-web: started
frappe-bench-web:frappe-bench-node-socketio: started
________________________________________________________________________________
Bench: Deployment tool for Frappe and ERPNext (https://erpnext.org).
Open source depends on your contributions, so please contribute bug reports, patches, fixes or cash and be a part of the community
()
erp_jmi@la:~/frappe-bench$ bench update requirements
Usage: bench update [OPTIONS]
Try "bench update --help" for help.

Error: Got unexpected extra argument (requirements)
erp_jmi@la:~/frappe-bench$ bench setup requirements
Updating Python libraries...
INFO:bench.utils:./env/bin/pip install --upgrade pip
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
Requirement already up-to-date: pip in ./env/lib/python2.7/site-packages (19.1.1)
INFO:bench.utils:./env/bin/pip install -q -r /home/erp_jmi/.bench/requirements.txt
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
INFO:bench.app:installing frappe
INFO:bench.utils:./env/bin/pip install -q  -e ./apps/frappe
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
INFO:bench.app:installing erpnext
INFO:bench.utils:./env/bin/pip install -q  -e ./apps/erpnext
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
Updating node packages...
INFO:bench.utils:npm install
npm WARN frappe@ No description
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

audited 3555 packages in 7.098s
found 1 low severity vulnerability
  run `npm audit fix` to fix them, or `npm audit` for details


   ╭───────────────────────────────────────────────────────────────╮
   │                                                               │
   │       New minor version of npm available! 6.4.1 → 6.9.0       │
   │   Changelog: https://github.com/npm/cli/releases/tag/v6.9.0   │
   │               Run npm install -g npm to update!               │
   │                                                               │
   ╰───────────────────────────────────────────────────────────────╯

erp_jmi@la:~/frappe-bench$ cd apps/frappe && git fetch upstream && git checkout master && cd -
Branch 'master' set up to track remote branch 'master' from 'upstream'.
Switched to a new branch 'master'
/home/erp_jmi/frappe-bench
erp_jmi@la:~/frappe-bench$ cd apps/erpnext && git fetch upstream && git checkout master && cd -
error: pathspec 'master' did not match any file(s) known to git.
erp_jmi@la:~/frappe-bench/apps/erpnext$ git fetch upstream
erp_jmi@la:~/frappe-bench/apps/erpnext$ git checkout master
error: pathspec 'master' did not match any file(s) known to git.
erp_jmi@la:~/frappe-bench/apps/erpnext$ cd -
/home/erp_jmi/frappe-bench
erp_jmi@la:~/frappe-bench$ bench update --requirements
INFO:bench.utils:./env/bin/pip install Pillow
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
Requirement already satisfied: Pillow in ./env/lib/python2.7/site-packages (5.3.0)
Backing up sites...
/home/erp_jmi/frappe-bench/env/bin/python: No module named past.builtins
erp_jmi@la:~/frappe-bench$ bench --site all migrate
/home/erp_jmi/frappe-bench/env/bin/python: No module named past.builtins
erp_jmi@la:~/frappe-bench$ bench --site site1.local migrate
/home/erp_jmi/frappe-bench/env/bin/python: No module named past.builtins
erp_jmi@la:~/frappe-bench$

At this point I am not sure if this can be recovered. I am going to exit the ssh session and leave it alone as it is for now. If anyone has any ideas about how to get past this point I am willing to reopen the session and give it a try.

BKM

@kolate_sambhaji solid method, me, I’m ‘terrified’ of updates even after so many years :rofl:. I tried this and put the steps up a while ago, I succeeded with it several times : Alternate Strategy to Update ERPNext to current ~v11

This above; actually takes a different path from a standard update/upgrade, well spoiler; as at today it appears to be failing, but I’m going to run it again. I cannot trust my current internet connection so, I cannot say it doesn’t work, so @bkm if this is worth your while; you may want to try this route. One thing I noticed is there were major changes sometime after I posted this; example, the item table doesn’t hold the barcodes, rather they’re in another table, so one import I made some while ago; items had no barcodes, shocker! Sometimes I wonder why that barcode wasn’t left and the table just added with the alternate barcodes, primary and alternates.

If you’re comfortable with thereafter inserting the records then you may give it a shot.

I doubt you can get 100% assurance of something that will work but you may need to try a mix of methods… I think.

Sometimes when you force and manipulate things, it may finally work but you may have some issues. Recently I had one and that will simply not bring up items to POS, I smelt a rat earlier because I had to ‘patch’ a lot of funny behaviors.

Ok, so @trentmu method met with errors at the half way point. So I will strip the server clean and start over with another fresh v10 install and then try the @kolate_sambhaji method. I don’t particularly like it, but if it works it is at least a path to an upgraded system. I just hate having to then go back and kill off the first site after the upgrade. It seems there should be a better way.

However, I need to get this figured out. So, I will try this:

It will take quite a while to get the server ready, but I will report back later tonight.

BKM

Ok, I finally got a path to updating from v10 to v11.

Thank you to @kolate_sambhaji for the clues. While I may have preferred a direct update method, his method is the ONLY thing that has worked so far. :grin:

Here is his brief set of instructions again:

To be fair to those that are new to ERPNext, the short list of steps above are not a real representation of the actual work that will be required.

There really is more to consider, such as:

  • maybe you need to get this done on your current server in order to keep the same ip address
  • maybe you have multiple tenants on a multi-tenant server that all need to be updated to v11
  • maybe you fear losing everything on the live server

To get past these issues, the best bet is to create a new server to do all of this updating work. If it works the way you expect, then you can always move your DNS pointers to the new site when you are satisfied that it works correctly as a v11 site.

If your current live serve is only supporting one site, then after this update process, you could even take the opportunity to completely strip the original server down and reinstall a fresh operating system. Then you would install the default v11 with the easy install method and just restore your updated database and files form the temporary update site. This would give you a fresh v11 server back on the old ip address with all of your data.

If you run a multi-tenant servrer as your current live server, then by performing the update process for each tenant one at a time, you have the ability to move your sites as you have time without having to rush them all at once. Just move the DNS pointers for each site to the new server location as each one is completed.

Regardless of how you approach the update, as long as you create a separate server to do the work, you will not have to worry about accidentally destroying your working live sites.

So, in an effort to document this process as best as I can, I will detail the steps you need to do for each site here:

1.) Create a fresh and updated server (I used Ubuntu 18.04 LTS)

2.) Use the instructions for the “Easy Install” to install default latest v11

3.) Login to the new v11 as Administrator and complete the setup wizard to create a dummy site.

4.) After setup wizard is done, logout and close the browser.

5.) Open a ssh session to the server using your default user account

6.) run the following commands:

cd frappe-bench/sites
nano currentsite.txt  (delete the site1.local entry and save the file as empty)
cd ..   (this takes you back to frappe-bench)
bench config dns_multitenant on
bench new-site [your.site.name]  (enter the actual URL for site you want to update)
bench setup nginx
sudo service nginx restart
bench --site [your.site.name] install-app erpnext

7.) At this point you need to open a new browser and login to the new site as Administrator and complete the setup wizard again.

8.) Once you have completed the setup wizard for the site that will become your updated installation, logout and close the browser again.

9.) Copy the latest backup of your live site to your new server (it will be restored to the update site later)

10.) Use scp to move all of the files in the /public/files and /private/files directories from your live site to the same locations on the new server in the update site.

11.) Use the following command to restore the live backup to your update site:

sudo bench --force --site [your.site.name] restore /path/to/your/backup.sql

12.) In the ssh session for your update site, run the following commands:

bench --site [your.site.name] migrate
cd sites/[your.site.name]
nano site_config.json  (use the "encryption_key" line from live server to replace this one)
cd ~/frappe-bench   
bench setup nginx
sudo service nginx restart

13.) At this point you should open a fresh browser and log into the update site to test your migration to v11.

The above set of instructions is not detailed like my tutorials, but it is pretty complete and based on my experience doing this on an Ubuntu 18.04 LTS server.

Hopefully this has been helpful to someone else that is dreading the upgrade process.

Is it perfect? Probably not, but it is repeatable.

As always… Your mileage may vary! :sunglasses:

BKM

5 Likes

@bkm @kolate_sambhaji Thanks you for your revelations and effort. Even though I have not tried it, I know it works. Thanks to all other friends who have contributed. To our amiable Team, kindly help to re-factor the easy upgrade method (bench update) that has been ever working for all upgrade before version 11.

As usual, @bkm to the rescue! :wink: But you can skip steps 6 and 7 if you have a single tenant and you’re restoring to a clean server. Using the easy install script, if you add the --site [your.site.name] tag and ensure you use the url for the live server, you don’t need to delete the default site and create a new one, as the site created during the install process will be exactly the one you need and all you need do after the initial setup wizard is to restore your backup and bench migrate.

In some cases you may need to run bench update --patch after migrating to ensure that all the tables are migrated and patched properly (i have encountered a case where migrating didn’t reconcile all doctype changes in V11 and running bench update --patch eventually fixed it).

1 Like

@bkm @noetico
I have given method to install ERPNext v11 on complete new server and then restore backup of site just to keep live site safe.

If we install ERP on new server then there is 100% chances of ERPNext working fine for fresh site.
After doing bench migrate some patches might be fails, but we can skip it or fix it.

Instead of new server you can also install fresh erpnext on Test Server or local machine using multi bench setup

https://github.com/frappe/bench/wiki/Multi-Bench-Setup

Once your second bench instance setup done, you can simply copy old bench site folder to new bench site folder and run bench migrate command.

Thanks @kolate_sambhaji , but this looks a bit more complicated than your first idea, and I really need to put my ongoing support behind the idea of @Fred1 to try to shine a light on the fact that bench update needs to be fixed so it can handle the process like it used to in previous versions. Your first idea works with very good predictability so I flagged it as the answer for now.

There really needs to be a simple way to “upgrade in place” without having to generate a whole new instance in order to get the job done. In previous versions we had that with the bench update command.

BKM

Thanks @flexy2ky , I kind of suspected this to be true, but just wanted to prove @kolate_sambhaji instructions first to make sure we had a working path to the migration. Since I have some time today, I will try to strip down the server and try it again WITHOUT the second tenant site on the new server. I will post back how it works later this afternoon.

BKM

2 Likes

@bkm While you’re planning to migrate, be aware of a nascent issue with V11, specifically ERPNext: v11.1.42 (master) and Frappe Framework: v11.1.37 (master). As of this version, the Dropbox access token field in Dropbox Settings doctype is gone. And the ability to customize the Dropbox Settings doctype has been disabled. So you cannot re-authenticate dropbox for backup.

So if you rely on Dropbox for backups then I suggest you figure a way out before you move your instances to V11.

@kolate_sambhaji your method of backup in Dropbox is commonly used by all.Since the Dropbox setting is no longer available in the current versions of Erpnext,any way out?.Any suggestion from others are highly welcomed

Fortunately for me, I have always had a huge distrust issue with paid online backup space like Dropbox, Google Drive, Sync, etc. So, I never bother trying to adopt them and have actively discouraged my clients from doing so.

Instead I have always relied on systems that I can control completely myself. Protecting yourself is ALWAYS your responsibility and if you entrust it to some other party, then you have no recourse for when the 3rd party does not save you. Would you depend on a police officer to save you from an attacker trying to hurt you in your home? After all the police department is responsible for such things, and besides they are only 15 minutes away when you need them to save your life… right? NEVER place your full trust in the service of a 3rd party. Always have a plan of your own that YOU can depend on!!

Personally and for all of my clients, I use The Poor Man’s Backup System (v2) in addition to anything my clients “think” is a safe backup plan. I spread the copies of the backups across several servers in several locations around the country to minimize the potential for failure.

So, anyway… I have no worries about the Dropbox issues, but I will start probing for anything else that might be problematic. Thanks for the tip.

BKM

1 Like

Unfortunately i do not have paying clients. all my deployments so far have been for friends and acquaintances and setting up an extra server just for backups would come at a cost they may not be prepared to handle at this time :pensive: While i understand the need to control your destiny as far as critical data is concerned, sometimes, cost considerations outweigh every other reason.

Dropbox has worked for me since i started using it and it is quite sad that development progression has seen it being disabled (inadvertently i hope). More so, it was a simple method of backup and it would help if the functionality can be restored.

Ok, I can confirm that this shorter version of the remedy also works if you are updating a server that only has one site. I originally suspected this might work, but needed to prove it to myself first.

So, I will put the shortened procedure here in case you do NOT need to update a multi-tenant server.

1.) Create a fresh and updated server (I used Ubuntu 18.04 LTS)

2.) Use the instructions for the “Easy Install” to install default latest v11

3.) Login to the new v11 as Administrator and complete the setup wizard to create a dummy site.

4.) After setup wizard is done, logout and close the browser.

5.) Open a ssh session to the new server using your default user account

6.) Copy the latest backup of your live site to your new server (it will be restored to the update site later)

7.) Use scp to move all of the files in the /public/files and /private/files directories from your live site to the same locations on the new server in the update site.

8.) Use the following command to restore the live backup to your update site:

sudo bench --force --site [your.site.name] restore /path/to/your/backup.sql

9.) In the ssh session for your update site, run the following commands:

bench --site [your.site.name] migrate
cd sites/[your.site.name]
nano site_config.json  (use the "encryption_key" line from live server to replace this one)
cd ~/frappe-bench   
bench setup nginx
sudo service nginx restart

10.) At this point you should open a fresh browser and log into the update site to test your migration to v11.

Again… This has been tested on Ubuntu 18.04 LTS and you will have to verify if it works on your distribution yourself.

Also note that I did NOT yet use the ‘bench update --patch’ command. The intent is to verify that everything works first. This can always be run if you find issues.

And as always… Your mileage may vary! :sunglasses: Happy Migrating!

BKM

2 Likes

If you have setup ERPNext for “friends and acquaintances” then those people are using the system to make money at some level. So even if it is just a cheap OpenVZ type pf server with very little memory, at least it would be a safe spot to scp backup file into for safe storage. One server could support all of your friends sites because it would only be for receiving and cataloging a small number of backup files.

You should tell them that if they find any value at all in the ERPNext server they need to give you $100 a year to pay for a safe backup server or else if they have a failure, you will not be able to help them.

BKM

1 Like

Still waiting to see if anyone here can come up with a way to update/upgrade from v10 to v11 in place without having to create a second server. I am willing to try any suggestions.

Anyone?

BKM

Have you tried dropping your site(s) , updating frappe/ERPNext , then reinstalling / restoring them?

I haven’t looked , are there requirements for 10 and 11 , versions of things like Redis, Nginx, NodeJs, Yarn , python libraries etc that can be compared to see if some preliminary environment packages should be upgraded prior to upgrading frappe/ERPNext?

Hmm… I didn’t drop the sites first, but I did try updating and there was a flurry of activity that seemed to be doing something with the doc types, but then after rebooting the host the system was still at the same level of v10 that it was before the update. SO, apparently no changes actually happened.

Tried this 3 times to make sure I wasn’t missing something. Every time the same result. It didn’t matter if I rebooted the host or not. Cleared the browser cache and logged in to see if the version changed and it had not.

So, I am not sure how dropping the sites would make a difference, but if I can get some time later this week I will try it just to make sure it has been attempted.

BKM