Question about backup

Hello,

I am new to erpnext and have installed it on a modest server. Now, I would like to move to a new server with better specifications and a control panel, as I don’t want to rely solely on SSH.

The question is how to copy everything from the current server and transfer it to the new server. To clarify further, I want to copy all the files, re-upload them to the new server, and then import the database so the website will work directly.

How can I do that?

Hello @Raied

Please check this, I Hope this works for you

Hi @Raied.

IMHO, the best way:

  • Install bench

  • create site

  • install apps (same version)

  • generate backup on old server

  • restore backup on new server (with encryption key)

Hope this helps.

Let’s say I’m facing some difficulties reinstalling the ERP, so I would like to copy my current website to a new (dedicated) server.

What I need to do is:

Copy the files and the database

Upload the files to the new server

Import the database

After that, the website should be back online on the new server.

#This worked for me last time I had to do this:
#Important! - both frappe / ERPNext installs need to be the exact same versions (update both first)

bench --site site1.local backup --with-files

#creates four files:

Backup Summary for site1.local at 2024-07-30 15:19:59.998974
Config  : ./site1.local/private/backups/20240730_151958-site1_local-site_config_backup.json 185.0B
Database: ./site1.local/private/backups/20240730_151958-site1_local-database.sql.gz         1.8MiB
Public  : ./site1.local/private/backups/20240730_151958-site1_local-files.tar               330.0KiB
Private : ./site1.local/private/backups/20240730_151958-site1_local-private-files.tar       10.0KiB

#then scp across to new site. Dump all four into the appropriate ‘private’ directory (even the one labelled ‘public’)
#and then this command:

bench --site [sitename] restore [path sql database with file name] --with-private-files [file location and filename] --with-public-files [file location and filename]

#which in my case translated as:

bench --site site1.local restore /home/bower/frappe-bench/sites/site1.local/private/backups/20240730_151958-site1_local-database.sql.gz --with-private-files /home/bower/frappe-bench/sites/site1.local/private/backups/20240730_151958-site1_local-private-files.tar --with-public-files /home/bower/frappe-bench/sites/site1.local/private/backups/20240730_151958-site1_local-files.tar

#most likely will ask for MySQL (MariaDB) password …
#and then:

bench --site site1.local migrate

#hope this helps - let us know how you go

Hi @Raied

Frappe Framework and ERPNext relies on many dependencies, services, etc … so is not so easy as “copy the folder” …