How to restore ERPNext?
In the event of a server failure for server migration, you can restore your site from backup.
Time needed: 30 minutes.
To restore a site you need to first have/set up a working site on the server. Once you have a working site, you can use the following steps to restore your database.
- Log in to the server console using SSH
You can use private keys or passwords to login to your server depending on your setup.
- Download backup files to the server
Upload/download backup files to the server. Use can use sftp software such as WinSCP to download files to the server.
- Change to bench directory
At the server console, execute the following command to bench directory.
- Restore the Site
Run the following bench commands to restore your database and files.
Note: the following command will overwrite existing data.
bench --site [sitename] --force restore [path to database backup file] --with-private-files [relative-path-to-private-files-backup-file] --with-public-files [relative-path-to-public-files-backup-file]
If you prefer to restore only the database, you can do so by running the following bench command
bench --site [sitename] --force restore [path to database backup file]