Has anyone ever successfully moved a working ERPNext system to another server without using a server image?

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 :

  1. Install bench manually or with installation script
  2. Setup a new bench with specific frappe version bench init --python python3 --frappe-branch version-11 my-bench for example
  3. From your new bench instance get your app : bench get-app --branch version erpnext
  4. 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)
  5. Get your backup site (only the site folder is required unless you have configured some elements globally)
  6. unzip your last database backup inside your new server : gunzip my_site/files/private/backup/my_sitexxxx.sql.gz
  7. 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
  8. 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/
  9. 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
  10. 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)

Regards.

9 Likes

This is where everything breaks down!!

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.

BKM

I didn’t read anything about this specific issue of frappe version.
By dafault bench is used to setup a new frappe environment.

The latest bench version could be used to setup a v10.0.14 version of frappe.

So after an installation of the latest bench, could you try this ?
bench init --python python2 --frappe-branch v10.0.14 my-v10-bench

python3 is not supported in v10 I think
And It would be strange that you couldn’t update to latest v10 branch

Tip,

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.

Regards.

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.

  1. What OS
  2. What version of ERPNext
  3. What version of Frappe
  4. pip packages installed and versions of each package
  5. node packages installed and versions of each package
  6. os packages installed and versions of each package
  7. (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).

BKM

Has anyone ever successfully moved a working ERPNext system to another server without using a server image?

This is an important feature.
I wonder that it was not requested beforehand.

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.

Hi

I’ve done what you require before. This is the guide I used Migrating a Server to Your Linode | Linode

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 .

Hope this helps

1 Like

HI, moving directory of file, or duplicate I think that is not a good Idea. Why not creating a repo and do bench export fixutures

I was able to manually install ERPNext v10.1.14 using following steps

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.

3 Likes

Hi @zerodiscount I will like to connect with you and learn more about the approach of how you use LXD Containers.

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.

Thank you. Can you share the links to the blog posts?

1 Like

Thank you.

Hello netmantha,

I have a v12 Posdemo version and i want to shift that all data to v13. both are different servers. Can u guide how I can move V12 data of pos from server1 to V13 installed ERPNext on server2

Simple, make a private github branches from the existing site for all 3 apps (Frappe, ERPNext and your custom app, if any) and you can use that github path while installing ERPNext on the new server, and then just import the database.

2 Likes

If you want to move entire OS to new server then use Clonezilla network clone

1 Like