Categories
WordPress

How to restore your WordPress site from a backup

Introduction

This guide explains how to restore your WordPress site from a backup made using the Duplicator plugin. This will allow you to set up a copy of the site on a new server (e.g. a new hosting service or a test environment). It will also allow you to quickly restore your live site to the backup version if it has stopped working and can’t easily be fixed (e.g. after a major update).

These instructions assume that you’re restoring the site on a remote server. If you’re restoring it locally (e.g. a local test environment using MAMP), an FTP client and file upload isn’t required.

Requirements

  • Duplicator backup files consisting of a compressed file and an installer PHP file. If you don’t already have this, see How to backup your WordPress site.
  • An FTP client with access to the server you’re restoring the site on. If you don’t already have this, and your server uses cPanel, see How to create an FTP account in cPanel.
  • The connection details for the database you’re going to restore the site with. If you don’t already have this, and your server uses cPanel, see How to create a MySQL database in cPanel.
  • A WordPress admin account with access to the site which you backed up.

For reference, these instructions were followed using:

  • WordPress version 5.4.2.
  • Duplicator plugin version 1.3.34.
  • Cyberduck version 7.4.1.

Skill Level

  • Intermediate knowledge of WordPress.
  • Intermediate knowledge of FTP.

Instructions

Time needed: 45 minutes.

  1. Open an FTP connection to your server.

    Open your FTP client and open a connection to your server.
    If using Cyberduck, and you have a Cyberduck FTP configuration file for the server (see How to create an FTP account in cPanel), you can open this and enter the FTP password (if prompted) to open the connection.

  2. Navigate to the site directory.

    In your FTP client, navigate to the root directory for the site.
    For example, if your site is an Addon domain in cPanel, the correct directory would likely be in public_html (if your FTP connection isn’t already restricted to this), then the Addon domain directory (usually named after the domain).

  3. Upload the Duplicator backup files.

    Upload the Duplicator compressed package file (e.g. a ZIP file) and the installer PHP file to your server.
    If using Cyberduck, either click and drag the files from your computer into the site directory in Cyberduck, or select File > Upload in Cyberduck’s main menu and select the files.
    Depending on your connection speed, the upload may take a long time to complete. Make sure not to close your FTP client, or disconnect from the internet during the process.

  4. Go to the Installer page.

    Once the upload is complete, go to the Duplicator installer page. This will be your domain followed by the installer PHP name.
    If you selected the hashed name when you created the backup, this will be in a format like yourdomain.com/[date]_[site name]_[hash]_[date and time]_installer.php. If you didn’t select the hashed version, it’d be yourdomain.com/installer.php.

  5. Enter the Installer Password.

    If you selected Enable Password Protection when you created the backup, fill in the Enter Password field and click Submit.Enter Password field and Submit button - screenshot

  6. Complete the Deployment step.

    If the Setup and Validation checks are not passed, view the details of the errors and follow the instructions to fix them. This may require you to recreate or re-upload the backup.
    You can also review and edit the Options section, though the default options should be suitable for a full restoration of the site.
    Tick I have read and accept all terms & notices and click Next.I have read and accept all terms & notices tick box and Next button - screenshot

  7. Complete the database Setup step.

    Complete the fields in the Setup section:
    Action: if you’re completing a complete restoration of the site, leave Connect and Remove All Data selected.
    Host: fill in the server path for the database you are restoring the backup on (e.g. if you’re moving the site to a new server, this will be a blank database that you’ve created). If the database is on the same server as the site files, this is likely to be localhost.
    Database, User and Password: enter the connection details for your database and database user you’re restoring the backup on.
    Click Test Database.Install Database Setup fields - screenshot

  8. Complete the Install Database step.

    If the Validation Requirements are not passed, view the details of the errors and follow the instructions to fix them. This may require you to recreate or re-upload the backup.
    You can also review and edit the Options section, but the default options should be suitable for a full restoration of the site.
    Click Next.Install Database Next button - screenshot

  9. Confirm the Install.

    Check the details of the database (the one which will be overwritten with the backup) and click OK.Install Confirmation OK button - screenshot

  10. Complete the Update Data step.

    In the Setup section fill in the fields:
    Title: the title of the site. If you’re rebranding the site, you may want to change this and review the options in the Replace section.
    URL: the URL for the site, which should match the domain linked to the site directory where you uploaded the backup files. Make sure the protocol (http or https) and subdomain (e.g. www.) matches the site which was backed up.
    Path: this should be pre-populated with the correct path where the backup files have been uploaded.
    If you’re moving the site and changing the URL, you should look at the options in the Replace section. This will allow you to replace references to the old URL with those of the new URL.
    You can also review and edit the Options section, though the default options should be suitable for a full restoration of the site.
    Click Next.Update Data Setup fields and Next button - screenshot

  11. Complete the Test Site step.

    Tick Auto delete installer files after login. If you don’t do this, you will need to manually delete the files to avoid them using up space or causing a security breach in future.
    Click Admin Login.Admin Login button and Auto delet installer files after login tick box - screenshot

  12. Log into WordsPress admin.

    Fill in the Username and Password for the site which was backed up and click Log In.WordPress admin Username and Password fields and Log In button - screenshot

Next Steps

Now that you’ve restored your WordPress site from a backup, you’ll want to check that the basic functionality is working. As well as testing business critical workflows (e.g. completing an order), you should also check for broken links using a service like Dr. Link Check.

If you’ve restored a live site which displayed a maintenance page during the backup and restore process, you should now disable that page. If you used the Restricted Site Access plugin, see the last steps in How to enable and disable a maintenance page on your WordPress site.