Scenario 1: The Internet is an open environment and there are good people as well as bad people in here. Some are helping you with their knowledge and others want to push you down for no reason. Some just want to create havoc in unknown person’s life or business without any reason whatsoever. Your WordPress website may become a victim of one such person and you may lose your month’s or year’s effort in minutes.
Scenario 2: There can be another situation where your hosting service provider shuts down its business and you are left with a missing website. You are in shock!
Scenario 3: You yourself made a blunder and screwed your website on your own. You tried all possible ways to recover it. Now it is completely gone with no possibility to recover.
Have you ever thought that what would happen if your website crashes suddenly? Now there can be a situation like
- If you have a complete backup of your website (File + Database) or
- If you only have the backup of your Files and not the database
- If you only have the backup of your database and not the files
- If you don’t have any backup.
If you are in situation 2 or 4, get ready to start your website from scratch, there is no way you can restore your website. Hopefully you have the content and images available somewhere. But if you are in situation 1 or 3, you can restore your website. Specially if you are in situation 1, you can easily restore your website in a similar way as you migrate your WordPress website to a new hosting . But if you are in situation 3, it is a bit typical to get your website back. Let’s discuss how you can get it back.
Before you continue with this article further, you should have the following :
1. Credentials to your hosting control panel.
2. Backup of your Database.
Let’s see how you can the backup of your database (this you should have done when your website was working) :
- Open phpMyAdmin tool
- Go to the database of your WordPress website (if there are multiple databases in here and you don’t know which one it is. You can check in your WordPress installation’s wp-config.php file.
- Now click on the Export button
- It will show some options and a Go button.
- Leave all the options as it is and click the Go button
- It will ask you to save the Database in some location
- Select the location and press save button. You have the database backup now.
Restoring The WordPress Website From Database Backup :
1. Create A New Database:
Create a new database and database user by using the MySQL Database Wizard tool. Note down the database user’s password somewhere, it will be needed in coming steps. You can use the phpMyAdmin tool to confirm whether this database is created. Following steps will take place in this process :
- Enter the name of the database
- Enter the username for the database user
- Password for the database user (better generate it from the password generator)
2. Import the WordPress Database Backup to the newly created Database.
Now take the backup of your database from your earlier WordPress website, we will upload it to the MySQL database we just created in the last step. Follow the given steps:
- Open the phpMyAdmin tool
- Go to the database created in the last step and open it
- Now click on the import button
- It will show you a browse option. Browse the database backup file
- Leave the other options as it is
- Click the Go button at the bottom
- If all goes well, it will give you a success message
- Confirm by checking the tables in this database. If all the tables are in place, you are done.
3. Re-Install WordPress
Download the WordPress installation files and Upload the WordPress file to your hosting account. You can get the WordPress installation files from WordPress.org. To upload follow the given steps :
- Go to File manager
- Open public_html directory
- If you have to upload WordPress in the root directory then just click the Upload button
- It will ask you to browse the file you want to upload
- Browse the file and click on the upload button
- The zip file will be uploaded
- Now you can extract this zip file.
Just don’t run the WordPress installation.
4. Setup the wp-config.php file
Setup the wp-config.php file with the database details, we created in earlier steps. To do this follow :
- Open File Manager
- Open public_html directory where you just extracted the WordPress installation zip file
- Here you will find wp-config.php file.
- Open this file in edit mode.
- Fill the values of Database Name, DB Username and Password at the appropriate location.
5. Check if the Website is opening –
Check if the website is opening with the default theme and some showing some data from your earlier website. Check the admin panel also if it is opening with the earlier username and password. If it is, it means the basic setup is done. Though it is not done yet.
6. Re-install the Themes and Plugins
Re-install your themes which was there in the earlier website. Also, re-install your earlier installed plugins.
7. Now Fix the Permalinks as it was earlier
You can fix your Permalinks by clicking on Settings on your Dashboard and after that executing your Permalinks section. Click Save Changes at the bottom of the window
8. Put up the Missing Images
Re-upload each and every image that is missing from the content. Check page by page and upload the image. You should understand that the image are not store in the Database. They reside in the upload folder which was there in the Files, for which you don’t have a backup now. This is going to be the most hard-working part in this whole process.