How to Restore WordPress Site With Only Database Backup

Improving the user experience on your event site
How to ban access to a site by editing the .htaccess file

Back up your files and your site’s database is always a good idea. The more backups you make, the greater the chance you will not suffer unforeseen events consequences. If you removed some files accidentally or your WordPress was compromised and their files have been corrupted by malware, it may still be possible to restore your WordPress site. In this tutorial, you will learn how to restore WordPress, even if you only have a backup of MySQL database.

This recovery method is only partial and you may not be able to recover all, however, WordPress stores more settings and information in your database. So you can recover most of your website from your WordPress just using the database.

What do you need?

Before beginning this guide, you need the following:

  • Access to the hosting control panel;
  • Backup MySQL database.

Step 1 – Importing the backup of WordPress database

First of all, we need to create an empty MySQL database. We import  our backup MySQL database for it.

  1. Go to the hosting control panel and find the MySQL Database Management menu.hostinger mysq databases section
  2. Create a database and assign a user to it. In this example, the Hostinger control panel provides the ability to create MySQL databases with users assigned to them very quickly, we just need to fill in the necessary information. Check out this guide , if you are using cPanel to manage your account.hostinger database creation
  3. Access your newly created via phpMyAdmin database.hostinger phpmyadmin section
  4. Import the database that you saved from your previous installation of WordPress. You can do this in the section Import : just select the .sql file ( 1 ), set the format for SQL ( 2 ) and press the button  Go  ( 3 ). A detailed tutorial on how to use the phpMyAdmin import feature can be found here .hostinger php my admin import

IMPORTANT: Write down the details of the MySQL database: database name , user  and password because you will need them in the next step. Also, note the table prefix . You can see the table prefix  on the left side of the phpMyAdmin.

Step 2 – Restoring WordPress

As when you only have one MySQL database, the next step should be to install a new instance of WordPress:

  1. Download the WordPress installation files  here .
  2. Upload the WordPress files to your web hosting account. If you are unsure how to do this, make a detailed guide on how to install WordPress here .
  3. Access your WordPress installation (accessing your site with your browser) and choose a language for the installation of WordPress. After selecting the language of your site, click Let’s go ! And you will remain on the database configuration step. Use the database information that you created earlier.hostinger restoring wordpress
  4. If done correctly, the end of the installation, you will see a message that WordPress is already installed.already installed

IMPORTANT: If you have not received this notification, you may need to redo the whole process. Check the setting again prefix .

Step 3 – reinstalling its theme and plugins

At this time, your website must have old posts and pages, settings, custom CSS files and users. However, without their themes and plugins earlier, it does not appear as before:

  • The first thing you should do is to reinstall your theme. Just install the same theme you used as your previous standard. Be sure to check out this guide  to remember how to install WordPress themes.
  • Now reinstall the plug – ins installed  previously. Fortunately, your database has a list of plugins installed and enabled before, then when you access the menu plugins, you will see a list of plugins that are currently missing.missing wordpress plugins

Step 4 – Fixing Permalinks

Now that you’ve recovered most of your site, you can still have problems with it. Most likely, your permalinks  will not work as they were and navigate your site will result in an error 404 page  not found.

You can fix your permalinks by clicking Settings  in your panel  and accessing your section Links . Click Save Changes  at the bottom, without actually making changes. This should update the permalinks and fix them.

permalinks fix

Step 5 – absent images Solution

Now comes the hard part. Unfortunately, your database does not contain images of its former site. There is no easy way to fix this problem. You will need to upload each image that is missing.

To help you figure out which images are specifically absent, we will use the plugin Broken Link Checkern .

  1. As with most plugins for WordPress, you can install it from the official repository of plugins through your WordPress administration area. Just click Plugins  in the panel  and select Add New . Insert the checker  broken links in the search bar and install the plug-in. Be sure to activate the newly installed plugin.install plugin
  2. Access the newly installed plugin through the Dashboard  by clicking Tools  and accessing the broken links . You will see a list of broken / missing links, this will help you determine which images are missing and their previous location.broken links list
  3. Now redo the download of missing images and, if necessary, update your links.

The sad situation is when you no longer have these images. In this case, the best solution is to check an archived version of your site.  is a great tool for these cases and may have an earlier version, fully functional on your website. You can download the missing pictures there:

  1. Access . At the top of the page you will see the ” Waybackmachine “. Enter the URL of your site and press ENTER .wayback archive
  2. If there are some available snapshots of your website, you will see these blue circles around certain dates of the year. Click on those dates to access a previous version of your site.previous date
  3. After that, look for the specific images that are missing and download them from the archived version.


Now you know how easily restore most of your WordPress installation from a backup. You also know how to spot additional problems such as broken links or missing images and trick on how to get them if you do not already have these images. Be sure to start making backups of your website in order to avoid any problems if your site get lost or is removed .

Have you seen our custom hosting plan for WordPress? Choose the perfect package and start your new journey with WordPress Hostinger.

Hostinger - read more

Keywords: WordPress hosting, site backup, website hosting.