It doesn’t matter which WordPress version, hosting, or security plugin, you are using, there are equal chances that you can lose your particular website data any moment. Hacking is increasing each day, and that’s why it is always a good idea to backup your website. There can be another instance where you need to restore WordPress from backup. It can happen because of theme or plugin or core WordPress malfunction as well.
Whatever may be the reason, we will go through the guide for restoring WordPress from the backup. You can do a manual back or use a backup service or a plugin to do all work for you.
In this guide, we will go through few methods of restoring your WordPress website. Before we proceed further, it is a good idea to understand the backups and restore operations.
Note: If you don’t have any backups of your website, this is not the article for you. Regular backups are always a good idea. And, if you don’t have any, don’t lose heart. You can always contact your web host service, and they will surely have a backup of your website ready.
Backups and Restore
It is always a good idea to backup your assets. And, that’s leads to the second question. How to backup your WordPress website?
You as the owner or the administrator of the website can easily create backups. You can either backup manually or depend on a 3rd party service or a plugin to do it for you. Also, backing up can be done in different ways. Many users backup only a few aspects of the website and not everything. They can choose to back up the theme, uploads folder, and the database. Backup plugins, on the other hand, tends to backup almost everything on the website. And, that’s a good thing.
Many users who manually backup the website has to go through high numbers of steps to restore it. And, that’s quite reasonable. Those who manually backup their website are not beginners and they are okay with less automation and more manual work.
Without wasting much time, let’s get started with the restoring methods.
1. Restoring WordPress Database from phpMyAdmin
Restoring WordPress database from the backup is one of the easiest methods. There are two ways you can back up your database using phpMyAdmin.
The first method is to create a new database and restore the database. Another method is to use the same database and import all the values again (overwriting the previous values.)
If you are not sure that your database is free of any malicious code, it is always a good idea to create a new database and restore the database from the backup.
To get started, you need to login into the cPanel or any other interface provided by your host. Once done, you need to open phpMyAdmin.
phpMyAdmin is an interface based database tool that enables administrators to handle database related issues efficiently. After you have opened phpMyAdmin, go to website database. The database should contain all the previous values.
Now, it is time to drop all the data in the database. Select all the tables by clicking on check all and then proceed further to drop the data. Use the image below for an easy idea of what to do.
Select the drop down menu, “with selected” and choose “Drop“. This will drop the tables.
At this point, you can restore your backup database or choose to create a new database with new username and password. Once done, restore as obvious.
2. Restoring Through cPanel Backup
Many users tend to back up using the handy backup tool provided in cPanel. If you are one of them, you will find this method of restoration easy and intuitive.
Just go to the backup option of cPanel in files tab. Open backup and choose the restore a MySQL database backup.
3. Restoring WordPress Files Manually Using FTP
Our last method is using FTP client to restore the WordPress website. The whole process is a manual one and hence longer than the earlier mentioned methods.
Once, you start, you need to make sure to place all the files in right place to make it work.
The first step is to get hold of a FTP client. For the purpose of the tutorial, we will use FileZilla. It is an excellent FTP client and offers a simplistic way to handle the files.
Before you use FileZilla to restore your website, Go to the “File Manager” of cPanel and then delete all the existing files from the website folder.
Once deleted, you need to go back to the FileZilla client and upload the backup into the designated folder. Before uploading make sure that the backup is clean. To make sure that your WordPress restoring is as clean as possible, it is always a good idea to upload only the theme and image folder.
For the WordPress core, download the latest WordPress version from WordPress.org and extract it your website main directory by uploading it through the FTP manager.
Now, it is time to either upload the old wp-config.php file or use the original wp-config.php file. The new file should contain all the credentials to make it work. For example, you need to copy the database name, username and password to make the restore use the database successfully.
The last step is to change minute settings here and there. You might need to change permalinks so that it works the same as the previous installation.
Restoration Completed? What To Do Next?
After a successful restoration, it is a good idea to run a check for malicious code. Also, make sure to change default passwords for the associated accounts. Using any of the popular security plugins such as WordFence, Sucuri, etc. will make your website more secure.