How to Manually Restore a WordPress Website From Backup
Whether you’re developing or running a WordPress website, backing up the site regularly is extremely important. It enables you to easily get your last working site up and running if anything unexpected happens. This process, although seemingly easy, can be very complex.
In this article, we will show you how to restore your WordPress site manually using cPanel and FTP assuming you have already made a backup.
Reasons for Restoring a WordPress Website
Restoring a backup of your WordPress site is not something you’ll do often. However, when you do it, it is important to follow the right steps. Some of the most common situations that require website backup are:
Hacked website or cyberattack that affected the database or the files on your live web site
Issues stemming from an incompatibility with the themed
Poor security of installed plugins
Changes to the theme files or plugins that crashed the site
Theme or plugin updates that caused the crash
Reverting back to the old site after an unsatisfactory website redesign
Regardless of what happened to your site, you should prioritize to resolve the issue and make the website content accessible again. Restoring a site backup is the fastest way to recover from any unforeseen situation and it provides you with the time necessary to resolve the issue.
Methods for Returning a WordPress Site Backup
There are several ways you can restore a WordPress site backup. One of them is using plugins such as UpdraftPlus and similar software. They allow you to make a complete backup of your site and restore it if required. But while these kinds of plugins provide plenty of useful tools, they can be quite limited. For example, a feature that allows you to save your site’s backup does that exclusively within the server space where the plugin is located. Also, you may not be able to use the automatic backup restore option unless you are able to access the WordPress dashboard.
Another way to restore a WordPress site backup is the option included with your hosting plan. Many host providers provide this feature, while others offer this option as an add-on.
For example, this is an option for the Backup Wizard within a cPanel platform. It offers the ability to restore a backup of the website.
As we mentioned, one of the main disadvantages of this method is that the hosting provider stores your website backup and live site on the same server. In case the server is compromised, your backup could be lost as well.
This is why it is recommended that you save each website backup on your computer or a cloud platform.
The manual method for restoring a backup may be a little more complicated than the previous two. However, it is the most reliable and often the only available way to get your site back on track, so let’s see how to do it.
How to Manually Restore a WordPress Website Backup
Manually restoring a WordPress site backup requires some technical knowledge of WordPress backend and the way WordPress works. If you are a beginner and you are not exactly sure what to do, it might be better to leave this to someone more experienced. Whatever you decide, we will do our best to describe the whole process as thoroughly as possible.
To start manually restoring your site’s backup, you have to have a saved backup of the WordPress files and the database of your website.
When you do this, you’re ready to restore the WordPress website backup. This process is comprised of two steps:
Restoring the WordPress database, via cPanel and phpMyAdmin
Restoring the WordPress files via FTP
Restoring the WordPress Database using cPanel and phpMyAdmin
To start, log into your hosting account to access the cPanel or another available platform. Select the phpMyAdmin option in the Databases section.
If your hosting provider uses a different platform, check their documentation in order to access the phpMyAdmin option. When you access it, navigate to the Databases tab.
In the left panel, you will see a list of all stored databases on the server. Locate the database that is used on your WordPress web site. If you do not know which one it is you could find out by opening the wp-config file and finding the value of the ‘DB_NAME’ variable.
Before you begin the restoring process, you will have the option to empty the existing database and import the saved backup or delete it and create a new database for this purpose. If you choose the latter, do not forget to add the new data of the database by editing the wp-config.php file.
Tip: In case your website was hacked and the tables in the database were targeted, we recommend that you delete all the tables from the database and only then restore the database backup. Of course, this will only be possible if you backed up the database beforehand.
To delete tables from the database, just highlight them by clicking the Check all option near the bottom of the screen. Then select the Drop option from the drop-down menu next to it.
This step of deleting tables from the database is recommended in case your site was hacked, otherwise, you can skip it since the following one will override the existing equivalent tables within the database.
Regardless of whether or not you deleted the tables within the database, once you are ready to restore the backed-up version, click on the Import tab near the top of the screen with the relevant database selected in the left pane.
Then, in the File to Import section, click on the Choose File button and select the database backup from the location on your computer where you saved the backup file.
After you have chosen the database backup file from your computer, in the Format section, select SQL in the dropdown:
Finally, click on the Go button and import the database backup. It will take some time for phpMyAdmin to import your database backup. Once it imports a portion of the website that includes your posts and pages, the site will be restored.
Restoring Website Files
The next step is restoring WordPress files. For that purpose, we will use an FTP client. This requires you to have an FTP account and FTP software such as FileZilla. You can check or create an FTP account through cPanel in your hosting account.
Once you find your FTP account and start an FTP client to connect your computer and server, log in to establish the connection. When you log in, the left panel will show your local site with the files on your computer, while the right panel will list remote site files on the server.
In the left panel, find the location where you saved backup files from your WordPress site. Double-check whether the files are unzipped. If they aren’t, extract them. Now in the right panel, if you have not already done so, access the public_html folder.
The next step is deleting the old files from your server. Double-check whether the file backup contains all the edits you wanted to save. This check is important because you won’t be able to restore these changes after you delete the server files. To delete the old files, simply right-click on the old folders and files you’ve previously selected and press Delete.
Continue by uploading backup files from your computer. Using FileZilla, just drag the selected files from the local site in the left panel and drop them to the remote site in the right panel. The duration of this process depends on the size of your files.
Another way to restore your backup files is to use cPanel and the File Manager tool. Navigate to your hosting account and choose the File Manager option.
In the File Manager, find the public_html folder with the WordPress installation of your website. If there is more than one domain on the server, make sure you select the folder with the name of your domain. Once you open the folder with your site files, select them, right-click on them and choose Delete.
When you empty the public folder click on the Upload button in the options tab on the top. Now simply navigate to the backup zip file you have saved on your computer.
The upload process may last longer depending on the file size. Once it’s done, you’ll see an uploaded zip file in your public folder.
Right-click on the file and select Extract to unzip the file.
Although this method has the same end result, we recommend restoring the backup via an FTP client, as it will be quicker and more efficient.
If you followed these instructions, your backup files and database should be restored on your server. Now’s the time to inspect whether everything is functioning properly, so go to your website and run a quick check.
Start with the plugins – check whether they are installed and activated. If there are any changes, activate them.
Tip. Pay attention to the permalink structure. Restoring your site from backup may change the permalinks – in that case, posts and pages won’t open in the browser. To check permalinks, navigate to Settings > Permalinks in the dashboard of your website.
If you’re restoring your site in the aftermath of a hacker attack, it is recommended to change login credentials both for admins and other types of users.
Additionally, you can create a new backup and install a security plugin to boost your site’s security.
Regular file backups are incredibly important safety measures for any site owner. They allow you to quickly restore your site in the aftermath of a malicious attack or crash caused by an incompatible theme, bad plugins and software updates. Although there are several ways to restore your site, the manual method is the only one that offers absolute control and safety, so keep this tutorial close in case you ever need it.