WPCloudDeploy Documentation

Restoring From AWS S3 Into A New Site or Server

There are 7 steps to restoring a backup into a new site or a new server.

  1. Add AWS Credentials To New Server
  2. Create site (if it does not already exist)
  3. Download backups from AWS S3 (or S3 compatible service)
  4. Create backup folder on server (if it does not already exist)
  5. Upload backup files
  6. Refresh backup list
  7. Start restore process
  8. Cleanup

Preliminary Checks And Warnings

Make sure the site you’re restoring to is running the same webserver as when you backed up!  You can’t restore OLS sites into NGINX sites or vice-versa.

1. Add AWS Credentials To New Server

Before you can restore a site to a new server, you need to make sure that you have setup your AWS credentials for it.

The easiest way to do this is on the BACKUP tab for the server.  On there you do the following:

  • Under the AWS S3 CREDENTIALS section, enter the AWS Access key, secret key etc. and click the SAVE CREDENTIALS button.  (You can skip this step if you have credentials setup in the GLOBAL settings area.)
  • Under the AUTOMATIC BACKUPS – ALL CURRENT AND FUTURE SITES section, click the SCHEDULE IT toggle.  This will add the credentials to the server.  (You can immediately disable it if you want – the goal is to get the credentials added to the server and this step makes that happen.)

2. Create Site

While it might be obvious, we do need to mention that you should have a site already created with the same domain you’re trying to restore.

If your original site no longer exists then just create a new site with the same domain name – it will be overwritten during the restore anyway.

If the site record already exists, point it’s IP address to the new server.

3. Download backups from AWS S3

Download three files from AWS (or your AWS S3 compatible service).  For example, if the site you’re restoring has a domain of ems01.vnxv.com, the three files that need to be downloaded will be:

ems01.vnxv.com_2022-07-31-11h25m44s_db.gz
ems01.vnxv.com_2022-07-31-11h25m44s_nginx.tar.gz
ems01.vnxv.com_2022-07-31-11h25m44s_fs.tar.gz

Note: the date and time stamps for the three files are the same (or for large files, they’ll be slightly different since each part will be backed up at a different time).

4. Create backup folder on server (if it does not already exist)

Log into server via ssh.

Check to see if a folder called .wp-backup exists

sudo ls ~/.wp-backup

If not, make one:

sudo mkdir ~/.wp-backup

Then, check to see if a folder with the domain name exists:

sudo ls ~/.wp-backup/yourdomain

If it does not, make one:

sudo mkdir ~/.wp-backup/yourdomain

Note: Replace yourdomain in the commands above with your actual domain.  For example, if your actual domain is ems01.vnxv.com then your commands will be:

sudo ls ~/.wp-backup/ems01.vnxv.com
sudo mkdir ~/.wp-backup/ems01.vnxv.com

5. Upload Backup Files

You can use any sFTP tool to upload the backup files to the folder from step 3 above.

6. Point any existing site records to the new server

If you still have SITE records pointing to the old server, the IP address on it needs to be updated to point to the new server.  (We mentioned this in step 1 already but it’s important enough to mention again here.)

7. Refresh Backup List

Use the REFRESH button on the BACKUP tab for the site to let WPCD know that there are new backup files.

8. Start Restore

Use the RESTORE button on the BACKUP tab to start the restore process.

 

9. Checks & Cleanup

If you’re doing the restore into a new server you’ll need to do things like change DNS, remove/update caching and so on.

Share: