Restore WP Engine Snapshot to Staging

WP Engine does not have a one click button to restore a production snapshot backup to staging. I foresee that being something they add in the future. For now, here are some manual steps to take to do just that.

First, download the snapshot you’d like to restore to staging

Screen Shot 2017-02-07 at 4.43.06 PM.pngScreen Shot 2017-02-07 at 4.49.25 PM.png

Restore snapshot database to staging

  • Generate a fresh staging site from the WP Engine tab: /wp-admin/admin.php?page=wpengine-staging.
  • Within WP Engine’s control panel, select phpMyAdmin
  • Select the first database starting with staging_  and select Import
  • Drag and drop file /wp-content/mysql.sql from the backup snapshot here to import

Find and replace production urls in staging database

If you have WP Engine’s WP-CLI access then select your advanced tab and run the following on the staging WP-CLI tab: search-replace https://productionsite.com https://productionsite.staging.wpengine.com --all-tables

Screen Shot 2017-02-07 at 4.45.56 PM.png

Optional, resync wp-content to staging site via sFTP

Since you started with a fresh staging site, you won’t typically need to restore the actual files unless you need to for troubleshooting purposes. If you do, I recommend using Transmit which allows you to only transfer files which have changed.