I had been trying to search for some kind of documentation for taking backups from remote and doing a complete restore on the local desktop. After searching the whole of discussion forum and getting stuck at few places, I was able to download the backup from the remote site on the local machine and do a restore on the local desktop. I will share the steps that I followed so that it can be useful for other people also:
Backup and Restore
- Download the latest backup from the Setup:
-
This will get saved on your local desktop in the downloads folder.
-
Copy this file under this folder:
frappe-bench/sites/site-name/public/files
The site-name is the name of the site on your local desktop.
- Unzip the file using the following commands:
umag@epoch~$ cd frappe-bench/sites/site-name/public/files
umag@epoch~/frappe-bench/sites/site-name/public/files$ gunzip 20160602_78570815_database.sql.gz
umag@epoch~/frappe-bench/sites/site-name/public/files$ cd
umag@epoch:~$ pwd
/home/umag
umag@epoch~$ cd frappe-bench
umag@epoch~/frappe-bench$ bench - - site site-name - - force restore $PWD/sites/site-name/public/files/ 20160602_78570815_database.sql
It will ask for the MySQL root password. Once you enter the password, it will get restored.
Though, I was able to restore the files on the local machine, it was giving some operational error of table not found while logging into the localhost. So, I searched the web again and realized that I had to do a bench migrate as well. So, I ran this command in the command prompt.
umag@epoch:~frappe-bench$ bench - -site site-name migrate
Once this was done, I was able to view the remote databases on my local machine.