How to restore from local PC to Google cloud ERPNext

Hello,
I want to restore my backed up file from VM which is located on my pc folder and now I am using erpnext on Google cloud Debian. How do I restore that file into google cloud ERPNext. I typed

$ bench restore

but I don’t kow what to type the restore file db path. Do I have to import the backup db file to ERPNext first or I can restore from the PC folder to the cloud ERPNext directly?

Thanks

@Amarjeet_Singh_Sintu
I have NOT tried this, but others say it is supposed to work.

You could move your backup file to a Dropbox location. There are even instructions available to make ERPNext backup directly to a Dropbox.

Then use the Dropbox location as the source for the restore. I saw the instructions for that somewhere here, but I do not have the link handy. If I come across it later today I will post the link.

A search in the forum for dropbox might help. I believe the restore path would be the same as if you wanted to create an external share link from your dropbox for someone outside your network to have access. Dropbox documentation should be helpful with how to do that.

Again, I have not tried this, but others report that it works well for them. I just wanted to give you at least a direction to start your own research effort.

BKM

Thanks buddy. I will try to do research on restoring from dropbox.
Just wandering how the restore command might look like for dropbox

$ bench restore ?

@Amarjeet_Singh_Sintu

According to @komsel2228 in his Dec '16 reply to someone else with this issue he said the following:

do you want to restore your backup?
frappe-bench$ bench --force restore path_backupfile

In this case the “path_backup” file would probably be the same path or similar that you might share to someone outside your network if you wanted grant them access to something in your dropbox. At least that is a starting point.

If you figure it out the correct sytnax, please post back to help others that will be asking this question.

BKM

1 Like

Fro dropbox backup Setup dropbox backup [User Manual]

For restore backup Restoring From ERPNext Backup · frappe/erpnext Wiki · GitHub

Please correct me where am I making mistake to restore the file as below:

eurekaforbesdelhi@instance-1:/home/frappe/frappe-bench$ bench --site site1.local --force restore d:/backup/20170609
_015106_6b6ae593_database.sql
Invalid path {0}d:/backup/20170609_015106_6b6ae593_database.sql
eurekaforbesdelhi@instance-1:/home/frappe/frappe-bench$

I typed in my terminal $ bench --force restore https://www.dropbox.com/s/ouzf2ua7lb2te66/20170907_043031_xxxxxxx_database.sql?dl=0

The error was

-bash Dropbox - 20170907_043031_8ffe419c_database.sql - Simplify your life
NO SUCH FILE OR DIRECTORY

To confirm when I put the dropbox link on my browser addressbar it does give link to download the sql file.

@Amarjeet_Singh_Sintu

You need to upload the SQL file to your ~/frappe-bench directory on Google server

Which for example will be bench --force restore 20170609_015106_6b6ae593_database.sql

I tried exactly like that

$ bench --force restore https://www.dropbox.com/s/ouzf2ua7lb2te66/20170907_043031_xxxxxxx_database.sql?dl=0

I am restoring from my dropbox

The error shown is as below:
Invalid path {0}https://www.dropbox.com/******.sql

@Amarjeet_Singh_Sintu

  1. Upload the sql file to your Google Server
  2. Place in frappe-bench directory
  3. From the Terminal of your Google Server enter: (CHANGE FILE NAME AS PER YOUR SQL FILE)
    bench --force restore 20170609_015106_6b6ae593_database.sql
  4. Notice that there is NO DROPBOX address in the restore command above as it will not work to restore from DROPBOX
1 Like

I am really embarrassed to tell you that I really don’t have any clue on how to upload sql file to my google server??

Than I am guessing you are connecting to the Google server via the teriminal on your PC if that is the case you can you can do this from the Terminal:

scp C:PATH-TO-SQL-FILE-ON-PC frappe@GOOGLE-IP:~/frappe-bench

Yes I am

eurekaforbesdelhi@instance-1:~$ scp D:\Backup\Bench Backups\20170907_043031_8ffe419c_database frappe@http://35.187.239.97:~/frappe-bench
ssh: Could not resolve hostname d: Name or service not known
ssh: Could not resolve hostname http: Name or service not known
lost connection
eurekaforbesdelhi@instance-1:~$

I also tried

scp D:\Backup\Bench Backups\20170907_043031_8ffe419c_database.sql frappe@http://35.187.239.97:~/frappe-bench

but same error as below:

eurekaforbesdelhi@instance-1:~$ scp D:\Backup\Bench Backups\20170907_043031_8ffe419c_database.sql frappe@http://35.187.239.97:~/frappe-bench
ssh: Could not resolve hostname d: Name or service not known
ssh: Could not resolve hostname http: Name or service not known
lost connection
eurekaforbesdelhi@instance-1:~$

Don’t include http

Ilike so
scp D:\Backup\Bench Backups\20170907_043031_8ffe419c_database frappe@35.187.239.97:~/frappe-bench

And this has to be done from your PC terminal

$ scp D:\Backup\Bench Backups\20170907_043031_8ffe419c_database frappe@35.187.239.97:~/frappe-bench
ssh: Could not resolve hostname d: Name or service not known
The authenticity of host ‘35.187.239.97 (35.187.239.97)’ can’t be established.
ECDSA key fingerprint is 1a:17:29:74:09:91:49:84:78:00:aa:99:26:1f:c0:ee.
Are you sure you want to continue connecting (yes/no)? y
Please type ‘yes’ or ‘no’: yes
Warning: Permanently added ‘35.187.239.97’ (ECDSA) to the list of known hosts.
Permission denied (publickey).
lost connection
eurekaforbesdelhi@instance-1:~$

THE BACKUP FILE IS ON MY D: DRIVE OF MY LOCAL PC AND I AM TYPING ON TERMINAL OF GOOGLE CLOUD SSH ON THE SAME PC. IS IT CORRECT? @saidsl

Nope that’s not correct, open a new terminal and type in that new terminal.

You mean On my PC I go to the Google ERPNext instance and open SSH terminal from there?
Which new terminal are you talking about?

I transfered the file to C drive of my computer and I restarted the google terminal and then typed the command:

$ scp C:\Users\Amar\20170907_043031_8ffe419c_database frappe@35.187.239.97:~/frappe-b
ench
ssh: Could not resolve hostname c: Name or service not known
eurekaforbesdelhi@instance-1:~$

Which new terminal you are talking about? How do I go to this terminal. By the way I am using Google cloud ERPNext terminal.