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

Okay, this is new territory to me.

I would like to be able to move a working ERPNext server from one VPS server to another VPS server. However I do NOT want to make an image of the original server to do it.

I am asking if anyone has ever done this by just copying all of the directory structure and contents from one server to another and had it work?

If you were able to do this, can you point me to a process that allows this to work?

Of share some details about what you did?

BKM

EDIT - Several posts, but they all missed the point so far. I am not able to re-install my version of erpnext so I need a way to move a working erpnext installation from one server that is failing, to another server that is new. The servers are of different hardware types so I cannot use an image of the original server either.

1 Like

Yes, I did and I am always doing for my customers.
No need to copy all directory.

Just follow the below steps.

  1. Install ERPNext on New Server.
  2. Take a backup of the Mysql database of the old server and restore it on the new server.
  3. Copy sites directory of the old ERPNext folder and replace it on your new server.
  4. Migrate site.

And done.

2 Likes

Make sure backup is with files, else you need to recreate everything like letterhead etc.

2 Likes

Yes, thanks for the guidance.

I have multiple sites on single vps, moving them one by one is time consuming.

For moving files and database in a single command I use rsync.

For database:

ssh keys need to be configured for this to work

Execute on source and target machine to stop mariadb

sudo systemctl stop mariadb

Execute on source machine to move database files

sudo rsync -avz /var/lib/mysql/* user@example.com:/var/lib/mysql/ 

Execute on target machine set ownership and restart mariadb

sudo chown mysql:mysql -R /var/lib/mysql/
ls  -l /var/lib/mysql/
sudo systemctl start mariadb
4 Likes

I think you have missed the point here.

I am looking for a way to ā€œmoveā€ a complete erpnext installation from one server to another WITHOUT installing it on fresh server, and WITHOUT making an image of the first server.

Since it is not possible to install my version of ERPNext any longer, I need to move it by some other means.

If it were as simple as installing erpnext again and moving my backups, I would not have posted the question.

Still looking for anyone that has made a copy of one server and moved it to another server without using an image of the original server.

BKM

1 Like

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.

BKM

Iā€™m trying to understand why and image is not a viable option and canā€™t seem to find one, except for the fact that you may need to upgrade the new VPS or something.

With the workload you have described and the benefit of VPS is you can easily upscale capacity (memory, disk, cpu) without the need to migrate, unless you have them configured differently.

In response to you requirement, creating an image is your best option of migrating to a new VPS. (Until I understand why you donā€™t want to use an image)

Regards
Said

1 Like

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.

BKM

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