Backing up and moving a WordPress website

You’ve got your website up and running great with WordPress, but do you have a backup?

There are multiple reasons to have a backup of your site — hosting issues, fixing user mistakes (like deleted posts/pages), malicious hackers, setting up or keeping your development environment current, etc.

You do have a development environment, right?

Our favorite tool is a plugin for WordPress called BackupBuddy. It has some nice features and it’s easy to use.

Backups can be triggered manually and/or scheduled to take place automatically. Backups are stored on the server unless you configure BackupBuddy to send them elsewhere. There are several types of backups you can make, to properly migrate a site you’ll need a Complete Backup.

Hovering over a backup reveals additional options/links:

This is where you’ll find a link to download the backup file. You’ll need a complete backup and a restore file to migrate or restore your site to another server. The restore file is created on the “Restore/Migrate” section of BackupBuddy.

On this screen, you can download the importbuddy.php file that will work with the complete backup file to restore/migrate your site. Make sure you set (and remember) the password you set for the importbuddy.php file.

To summarize, you’ll download two files from your existing WordPress site: the complete backup ZIP file and the importbuddy.php file.

Migrate/Restore

The following steps assume that you have another server that is already configured with the appropriate software (MySQL, PHP, etc.) and a database with access credentials.

If you’re moving to a new server, then simply upload the two files and then access the importbuddy.php file from a web browser.

With the two files now on the server, we’ll switch back to the web browser to start the restore process.

Enter the password you used when you downloaded the importbuddy.php file. If successful, you see a screen that asks you what you want to restore — Files or Database. In this case we want to restore both.

Depending on the size of your backup, restoring files may take a while. We’ve found that Google Chrome works better for these lengthy restores than other browsers (e.g. Safari).

Once all the files are restored, it’s time to restore the database. Enter the information for the database on the new server if it’s different from the server the backup file came from.

It’s recommended to check the box to “Delete All” the database tables before restoring. You’ll then see the database table names on screen as they are restored.

After the database has been restored, it’s time to do a few adjustments. This is important if the restored site is at a different URL than the old one.

Once any references in the database have been updated to the new URL, it’s time to test and then do some final cleanup that includes deleting the ZIP archive and the importbuddy.php file.

If your site has a firewall plugin, you might need to delete some config lines in the .htaccess file. Once you can load the site and log into the admin section, re-setup the firewall plugin. In our demo above, it required deleting lines that were inserted by WordFence. Once we were able to log in, we could have WordFence recreate its settings.

That’s it! You’ve now restored or migrated a WordPress site!