Migrate an existing site

Restore an existing site by uploading backup files or by using a bench from your local setup or from your cloud provider.

While migrating existing sites using the Frappe Cloud dashboard, some users miss the step to restore the site config details. If you're using the bench command, you won't have to worry about this.

Restore from Backup Files

The easiest way to migrate an existing site on Frappe Cloud is to restore it from backup files.

  1. Download backup files of your site.

  2. You must have 3 files that should be named like the following:

    • 20210817_125915-sitename-database.sql.gz (Database)

    • 20210817_125915-sitename-files.tar (Public Files)

    • 20210817_125915-sitename-private-files.tar (Private Files)

  3. Click on New Site from the Sites tab in the Frappe Cloud Dashboard.

  4. Fill out the subdomain and select the version.

  5. Click on Create Site from Backup.

  6. Now, upload each file you got in Step 2 in their corresponding upload boxes.

  7. Select a Plan.

  8. Click on Create Site.

  9. When the site reaches Active state, you will now have to restore your site config's details.

This method is ideal if your backup file's size is less 200MB. If you have larger backup files, you should use the bench command to migrate your site.

Encryption Key

This key is used to encrypt passwords. This key is created automatically on a fresh site. Upon restoring a site from backup, this key will have to be copied into the site config as well to be able to use existing passwords.

In cases where you have lost your previous encryption key, and system has already generated a new key for you (you can verify this in your Frappe Cloud dashboard), you may stumble upon an "Encryption Key error". This is because certain password fields were encrypted using the old key. Now when then system tries to use those passwords, it fails as it tries to decrypt those passwords with the new key. In such cases, re-entering the value in those password fields will fix the problem (same password as before is fine). This works as re-entering the password will again encrypt the password using the new key.

TLDR; Re-enter all password fields to encrypt them with new encryption key.

Eg: Email Account is a common doctype who's document has a password field. You will want to re-enter the annotated password field if you face errors while sending email.




Restore Backup on another site

You can restore backup on another site by following the given steps:-

1. Click on the Database tab from your site dashboard on which you have the offsite backup stored.

2. Click on the three dots of the offsite backup you wish to restore it on another site.

3. Once you click on the option you will be asked to select the site you want to restore it on, you can click the site and click on restore to continue.

Migrate using site URL

While creating a new site using the new site creation wizard, you can go the Migrate from Site URL tab while in the Restore from Existing Site step and follow the given steps:

Migrate from Site URL

  • Enter your existing site url

  • Enter your old site user credentials

  • And click on Get Backups

Get Backups will fetch backup files from your old site to restore on Frappe Cloud.

Migrate using Bench

If you are running Frappe sites, most likely you have bench installed. You can run the following command to restore a site from your bench to Frappe Cloud.

bench --site {name} migrate-to frappecloud.com

You can run this command even from your local setup. If your site is hosted on a cloud provider like Digital Ocean or Amazon AWS, you must SSH into your server, and run this command.

The bench command provides a form similar to the dashboard UI. It's probably the easiest way to migrate your site to Frappe Cloud.

bench migrate-to command

This method will work only if your sites are on Version 11 or greater. If you are on an older version or this command didn't work for you, you can try the Python Script method explained later.

Migrate using Python Script

If you are on an older version of Frappe (older than version 11) or the Bench command didn't work for you, you can try this method.

Make sure you have wget installed. Run the following commands from your bench directory:

wget https://frappecloud.com/assets/press/migrate
chmod +x migrate
./migrate

FAQ

tar command fails with unexpected EOF

This is a common error faced by many users. We believe this happens due to a corrupt file in the tarball. If this happens to you during site restore, please try again with a fresh backup of the site.

Uploading files backup that's too large

Sometimes, it maybe the case that your private and public files are too large to be uploaded from the UI. You may also have stopped hosting the site elsewhere so both Migrate using site URL and Migrate using Bench would become unfeasible. In such cases, you if you have a private bench, you can upload the files separately over ssh

  1. First you need to upload the files backup to some storage service such as Google Drive

  2. Afterwards, you can ssh into the bench with your site and navigate to the files directory of the same

  3. Then you can use a command like wget to get the backups from a link to the aforementioned storage service

  4. After getting the backup, you can extract the same with tar command

On this page