In my case, I almost exclusively setup a single VPS for each erpnext installation. The workload that I have them doing would really bog down in a multi-tenant environment. This is why I am trying to move the entire installation to a new server.
An image is not possible because the hardware that the original server is running is not compatable with the hardware of the available new servers. This would mean the linux kernels would be in panic mode and would never boot. However the problems go even further.
The original server that is failing is running on older AMD processors and the new servers are all Intel processors. Additionally the server of the original VPS is with a service provider that appears to be going bankrupt. The new VPS on newer hardware is a different service provider and will not/ cannot take an image from another service provider.
These are the reasons an image is not a viable option.
I move sites multiple times, from a server to another or from a multitenant configuration to a single tenant.
The key is to create a backup with bench backup, database backup are stored in my_site/files/private/backup/
So here my workflow :
In the new server :
Install bench manually or with installation script
Setup a new bench with specific frappe version bench init --python python3 --frappe-branch version-11 my-bench for example
From your new bench instance get your app : bench get-app --branch version erpnext
Next is where you will need to copy files from your backup server to your new server in a backup directory (not inside the current bench)
Get your backup site (only the site folder is required unless you have configured some elements globally)
unzip your last database backup inside your new server : gunzip my_site/files/private/backup/my_sitexxxx.sql.gz
From your new bench install a new site with this backup : bench new-site --source_sql /full/path/to/your/backup.sql my_new_site Now you will have your site inside your new bench
Copy files from your backup inside your new new site : cp -R backup/my-site/files/private/ my-bench/sites/my-site/files/ and cp -R backup/my-site/files/public/ my-bench/sites/my-site/files/
Next you must copy the “encryption_key” from your backup my-site/site_config.json, to your new-site if you want to be able to read emails in your new instance
now all is prepared to run the bench setup production, bench setup lets-encrypt and another bench update
I have script that in a bash script to ‘restore-site’ with all this steps in my servers.
And I also backup only datas (databases, files folder and site_config.json)
This is the best answer so far, but it still requires a bench update.
I cannot install the version of bench that was available during the v10.0.14 release. It is not available any longer.
Also if I run bench update on that older version is breaks everything in my system. There is something about the version of bench that was active at v10.0.14 that never was able to survive an update. Bench evidently changed before the release of v10.1.x and it is this transition that breaks every time. I have tried this path before.
Again, I am still looking for a way to move an existing erpnext installation to another server without doing an install and without a server image.
This may not be possible, but I still want to ask just in case someone has been successful.
To manually update in specific version :
In each apps, set your git checkout to the specific version you want
Next in your bench folder use bench update --patch and bench restart if this is a production setup
Now you can manually control the frappe and erpnext version.
Its possible. The reason someone isn’t going to be able to give you step by step instructions is there will be a lot of “it depends on” questions.
What version of ERPNext
What version of Frappe
pip packages installed and versions of each package
node packages installed and versions of each package
os packages installed and versions of each package
(i’m probably also missing some needed details…)
using this information, someone would most likely be able to recreate the installation for you, but it would take some time.
maybe ask someone for assistance to complete this (someone like Brian Pond as an example), and as part of your contract with them, ask for the step-by-step instructions at the end for this particular project. That could potentially also help you learn more about the inner workings of erpnext/frappe and help you become less reliant on the easy install scripts. Based on your posts, the easy install is one of your largest pain points, so this is one possible way of addressing that.
I had done that. In fact I had paid a popular ERPNext consultant and developer in India that is part of the foundation to try to do this for me and generate a document for me to be able to replicate it.
Sadly, after 2 weeks of trying, they informed it it could not be done.
I will attempt it again using the @jodeq ideas and see if I can make any progress this year. This time last year is when I was told it would not work. Maybe they missed something (but I wouldn’t think so).
I remember you referencing this in the past, and if my memory is correct, the scenario was a bit different than the statement you’re making.
I know for certain that the question you ask in this thread title can be done because I’ve seen it done (v10 on one server to v10 on another server). I can’t help you do this, but someone else may be able to.
It’s specific to Linode VPS but the steps used to copy the site using rsync are generic and can be used on most Linux VPS servers. Effectively it uses rsync to copy all the files and and folders from one server to another, then setup SSH keys to new server etc. There is no imaging being done as such.
The notes are similar to revants answer here.
The creation of the new server environment would be done with the specific tools from the VPS provider. The exact version of Linux kernel used and Architecture or and vs intel can be different on the two servers as generally the kernel modules are picked up on the fly - something Windows servers are very difficult with .
I suggest to use LXD containers and so snapshot / backup / movement is as easy as moving zip files. Snapshot can even be set to auto expire - so you can setup a frequency and old ones get deleted. Inside LXD container you can install erpnext in traditional way. It does not require much extra knowledge of terminology - little setup to forward incoming port 80/443 traffic to container. Let me know if interested - I can share few links.
Hi @tobsowo - happy to help you when I can. By no means an expert - or a developer.
There are two LXD related blogs by Simos and Stephane Graeber that will help you a lot for setting up LXD. For ERPNext - once inside an LXD container - it is just like another installation inside any VM. Like with any containerization, benefit of LXD is that it allows you to better utilize your CPU/RAM by running multiple containers of different applications. If your use case requires multiple nodes, backups, clusters, orchestration - there is as much complexity out there as you seek! Most of us are small business owners and likely will not need it.
Anyways - post your queries on the forum - and tag/PM me as needed. Will do my best to answer/help.