How to Restore a Backup of Your WordPress Site
With WordPress powering more than 34% of the internet, it has now become very easy to build and maintain a website. However, there are many functions to take care of. Say you have to migrate your company’s website to a different web host. You’re not worried – after all, you have done this before. But what if after completing the migration, you discover that some critical WordPress files have not been migrated? Unfortunately, there is no easy “Reset” or “Undo” button that could reverse this. This is why it’s important to keep the website backed up- you can restore the files and repeat the migration.
There are multiple ways of restoring WordPress websites from backup, which we shall discuss in the following sections. But first, let’s understand the various components of a website that need to be backed up and restored.
The Key Components of a WordPress Site
Any WordPress installation comprises various components, which are its essential building blocks. There are 4 WordPress components that you should always back up:
- WordPress core – This constitutes the core files of WordPress, including the source code, WordPress functions, and website settings.
- WordPress database – This comprises of the WordPress backend files that store your website information. This includes database tables containing vital records such as user credentials, articles, website posts, and website metadata.
- WordPress plugins – These are third-party add-ons or tools that are integrated into the WordPress installation for improving overall functionality. They can be easily downloaded from the WordPress repository and added to your site.
- WordPress themes – These are again third-party applications used to improve the overall look and design of your website. Like plugins, there are many free WordPress themes available in the repository and other online marketplaces.
A WordPress backup typically contains all these four components. As a result, restoring a backup means restoring these components to the website. Let’s now look at how to perform the restore process.
Two Methods to Restore Your WordPress Backup
You can perform a WordPress restore using any of the following methods:
- Manual restore using the phpMyAdmin tool or a database restore using the MySQL tool.
- Automatic restore using a WordPress backup plugin.
Tools you need to restore a WordPress backup
We shall look at each of these restore methods in more detail in the next section. However, to perform manual restores, you first need to have:
- Access to the phpMyAdmin tool (provided by your web host provider) on your system.
- The backup copy of your website data that you want to restore.
- An FTP tool like FileZilla.
- User rights to modify database files, including edit, cut, and copyrights.
Method #1: Performing manual restore using phpMyAdmin
If you have used the phpMyAdmin tool to backup your site, you can easily use it to restore the backup as well. You can either download the phpMyAdmin tool on your own or use the preinstalled tool provided by your web host provider from their control panel.
Here are the steps that you need to perform:
- Log in to the phpMyAdmin using your user credentials.
- After a successful login, navigate to the “Databases” section of the tool, where you can view the complete list of database tables for your website.
- Select the database to which you want to restore your database backup.
- Before the restore, remove all the existing tables from the selected database. To do that, simply:
- Click “Click All” to select all the tables within that database.
- Click “Drop” from the “With Selected” list.
- To import the backup data to the database, navigate to the “Import” tab in your phpMyAdmin interface.
- From the new window, click “Browse” button to select your computer folder from where you want to import the backup data.
- Finally, click the “Go” button to import and restore the backup data to your website database.
Performing manual restore using MySQL
If you are familiar with SQL commands and have created your website backups using the MySQL tool, you can restore the backup files using the same.
Here are the manual steps that you need to execute:
- Unzip or extract your backup files (*.tar.gz or *.bz2 files) using the following SQL commands:
Note: If your database backup was *.tar.gz (for example: blog.bak.sql.tar.gz, then)
tar -zxvf blog.bak.sql.tar.gz
Note: If your database backup was *.bz2 (for example: blog.bak.sql.bz2, then)
[email protected]:~/files/blog> bzip2 -d blog.bak.sql.bz2
- From the unzipped files, copy-paste the following SQL queries to your MySQL database:
[email protected]:~/files/blog> mysql -h mysqlhostserver -u mysqlusername -p databasename < blog.bak.sql Enter password: (enter your mysql password) [email protected]:~/files/blog>
With that, you can restore your database backups to your WordPress website.
While both of these manual methods are efficient, they are only useful for restoring WordPress database files. You need to perform some extra manual steps to restore other WordPress components from the available backup. Additionally, to perform manual restores, you should have sufficient technical knowledge to execute it smoothly on your system and troubleshoot if any issues crop up.
A better backup and restore option for novice or non-technical WordPress user is automated restores using a WordPress backup and restore plugin tool.
Method #2: Performing automatic restore using a plugin
Let’s look at how you can use the BlogVault plugin to restore a backup. It creates and stores multiple versions of your website backups in a safe and independent location. During the restore process, you can select any of these backup versions to restore on your website.
To perform an automatic restore:
- First, login and select the website that you want to restore.
- From the “Site Details” page that opens, click the “Restore Site” button (shown below).
- Your WordPress website will be restored from the latest available backup.
BlogVaults restore process is simplified yet detailed; you can choose which backup version you want to restore.
Alternately, if you want to restore another version of the website backup:
- Click the “Show All Backups” button from the “Backup” section. This will display the entire history of the backup versions for the specific website.
- Click “Auto Restore” for the particular backup version that you want to restore.
- Enter your FTP credentials.
- Select the folder where WordPress is installed (for example, the “public_html” folder, if you are using the control panel provided by your web host). You can also search for folders where WordPress files like wp-admin or wp-content are stored.
- In the next screen, you need to specify what you want to restore to your WordPress website. For example, you can choose the entire backup version or selected files or tables.
- Finally, you can click “Continue” to start the restore of your backup version. You will be notified on completion of the restore.
That’s it. This process is easy and faster than the manual procedures. Besides, you can perform it yourself without any technical assistance.
Here’s something else you should know – Just like any other WordPress file, backup files can also be corrupted or damaged. Restoring corrupted backup files can further damage your website. How do you prevent this?
A simple solution is to create a staging site and test the backup you want to restore. In case of BlogVault, you can use its “Smart Backup Test Restore” functionality which directly loads the last backup version on a staging site. You can also use plugins like WP Staging or Duplicator to create a staging site. Once you are satisfied, you can go ahead and merge the backup with the live website.
In the current online world, one can never be too careful when it comes to their website. Ensuring that it is backed up is vital to the health of a site. It acts as a safety net against data loss and minimizes downtime. But what’s a backup if it cannot be restored?
For website backups to be useful in the event of any website crash, WordPress users should be able to access and restore their backups in as little time as possible. While it is possible to do this manually, it usually is a complex procedure which requires time and patience. Even the smallest mistake can necessitate redoing the restore.
In such a case, it is best to opt for a backup plugin which has simplified the restore process. Automated tools provide user-friendly restore processes that can be executed faster and without much hassle.
Which procedure would you prefer? If you are not into doing this by yourself, find out How you can Outsource your Web Development.
Akshat Choudhary has always prided himself on his ability to teach himself things. Since starting BlogVault, Akshat has transformed his side-project into a profitable venture that is scaling new heights in the Indian startup space. Being a member of the WordPress community for almost a decade, Akshat is keen on understanding the areas where users struggle. Akshat's core belief behind building any product is making sure the end-user doesn't need assistance and to assist them in the best possible manner if they do. Connect with Akshat on Facebook and LinkedIn.