Backing Up and Restoring WordPress Sites – OVH

Vince IarusciDevOps, LearningLeave a Comment

Backing Up the OVH Website Server(s)

In our company, we host multiple WordPress sites on the same OVH VPS host.  This has it’s advantages however if the there are issues with our server we could have 3 sites down at the same time.  To avoid any downtime for our websites, we came up with this 2 tiered approach to backing up our WordPress sites on an OVH VPS server host.

The strategy includes creating a snapshot to save the latest installation of the OS, Apache2, Wordpress and the MySql database software.  Any other configurations are also be captured. e.g. ssl certificates

System configuration changes are not as frequent as the changes made in the website domains.  Website content and the associated database changes are done daily and these changes include updates to content, plugins, themes, uploads, database and other files. These domain changes are backed up weekly using the schedule in the UpDraftPlus Wordpress plugin.

Using the 2 tiered strategy will shorten the time it takes to restore a website or the entire system when there are server problems or malicious attacks.

VPS Snapshots

Snapshots are enabled for the VPS environments.  Currently, snapshots on each vps server need to be done manually. Reminders should be set-up for the admin to manually run the snapshot when needed.

The current strategy will be to create the snapshots before and after a software update or migration. In the event of a failed update, the server will be rolled back to the last restoration point of the snapshot. When the software update is successful, an additional new snapshot will be taken of the os/code version so that there’s a backup until the next update. Using this strategy allows you to do a “redo” if something goes wrong between updates.

Create a Snapshot

Only one snapshot can exist at a time. To create a new snapshot, you need to select the “Delete The Snapshot” option and delete the existing snapshot. You will then have the option to create a new snapshot of the server to capture the latest changes.

Restore a Snapshot

To restore the server to the last saved snapshot, you will select the “Restore the Snapshot” option from the user console.  Note that restoring a snapshot will overwrite any changes made since the last snapshot was taken.

Image of OVH Console

UpdraftPlus Backups

UpdraftPlus is a Wordpress plugin used to backup each website’s database and content. Backup into the cloud directly to Dropbox, Google Drive, Amazon S3 (or compatible), UpdraftVault, Rackspace Cloud, FTP, DreamObjects, Openstack Swift, and email. The paid version also backs up to Microsoft OneDrive, Microsoft Azure, Google Cloud Storage, Backblaze B2, SFTP, SCP, and WebDAV.

The following steps must be done for each installed Wordpress website.

Setting up The Backup

Scheduling the Backup

Select the Settings tab and set the files and database frequency.  In our case, we set the files backup schedule to weekly with a retention of 2 backups.  (goes back 2 weeks).  Change yourschedule to daily when content is updated more frequently

 

Set the remote backup location

Saving to Google Drive

Note that the save location must have the sufficient space to save the required backups.

Settings
Google Drive Folder: UpdraftPlus
Include in Files Backup: Select Plugins, Themes & Uploads.  Check - "Any other directories found inside wp-content"

Click Save Changes.  This will prompt you to select and sign into the Google Account.  Once you have authenticated to the Google account, the set-up is complete.


Restoring the Website Server(s)

Steps to restore are:

  1. Identify the issue for the failure.
  2. Restore the VPS Snapshot (If Needed)
  3. Restore the UpdraftPlus backup for the affects website domain(s).

Identify the Failure

It’s important to identify the root cause of the issue so that any failed software or hardware configurations are fixed properly or any malicious attacks are avoided by hardening the server to eliminate vulnerabilities.

If a migration or upgrade of the system has made the server unresponsive, it’s important to identify the components that have caused the failure so that the errors can be avoided on the reinstall.  If the server has been hacked, the hack method, (sql injection, security breach, password exploit etc,) must be identified and fixed. Failing to do this will only invite the same hack.

Restore the VPS Snapshot (If Needed)

Snapshots are enabled for the OVH VPS environments.  The current strategy involves creating the snapshots before and after a software update or migration. In the event of a the failed update, the server is rolled back to the last restoration point of the snapshot. If the software update is successful, an additional new snapshot will be taken of the os/code version so that there is a backup until the next update.  Using this strategy allows you to do a “redo” if something goes wrong between updates.

Restoration of the snapshot is not necessary when the restore is limited to the recovery of the website content only.

Restore a Snapshot

To restore the server to the last saved snapshot, you will select the “Restore the Snapshot” option from the user console.  Note that restoring a snapshot will overwrite any changes made since the last snapshot was taken.

Image of OVH Console

UpdraftPlus Backup Restore

UpdraftPlus is a Wordpress plugin used to backup each website’s database and content.

Follow these steps for each installed Wordpress website when restoring with the VPS Snapshot.  If you only need to restore the content for a specific domain, restore only the UpdraftPlus backup for that Wordpress domain.

Restoring The Website Backup

Select the Backup/Restore tab and select the Restore button for the backup that you want to restore.

Select the components that you want to restore.

Worst Case Scenario

If for some reason you’ve had a catastrophic failure on your server and your not able to restore from any of your backups, follow the instructions on how to Install Multiple WordPress Sites on a Single Host.

Please follow and like us:

Leave a Reply

Your email address will not be published. Required fields are marked *