How to restore a WordPress website with only a database backup in Hostinger

Restore a WordPress website with only a database backup in Hostinger: import the database, reinstall WordPress, then fix themes, links, and images.

Updated 1 day ago

Restore a WordPress website with only a database backup in Hostinger when the website files are missing or corrupted. Import the database, install a fresh copy of WordPress, reinstall your theme and plugins, recreate permalinks, and re-upload images. This is a partial recovery, so some elements or features may be incomplete.

This method allows for a partial recovery due to the missing data from the website files. Some elements or features may be incomplete or unavailable.

Step 1 – Import the database

If the database backup is still stored in Hostinger dashboard, you can restore the database from Hostinger backups and continue with Step 2. Otherwise, locate your database file on your device: it should be in .sql file format. If your database backup is in an archive format, such as .sql.gz, make sure to unpack it first.

Next, follow these steps:

  1. Create a new database

  2. Open the database via phpMyAdmin

  3. Import the database (.sql file) from your local device

Step 2 – Restore the WordPress installation

Create a fresh WordPress installation on your hosting:

  1. Download the WordPress installation files from the official website.

  2. Upload them using any preferred option: Import site, File Manager, FTP, etc.

Once the WordPress files are uploaded, access your WordPress Admin area:

  1. Open this URL on your browser: domain.tld/wp-admin, replacing domain.tld with your domain name

  2. Choose the language for your website, and click on Let’s go!

You will be required to provide the database details. Insert the data from the database you created in the previous step:

The section to enter the database connection details for a new WordPress installation

Once the database connection is correctly established, you will get a message indicating that WordPress is already installed:

The Already Installed message from WordPress

Click on Log in and enter the old credentials you used for your original website.

If you don’t get the “Already Installed” notification, start over from the first step, making sure to double-check the database credentials and table prefix.

Step 3 – Reinstall the theme and plugins

With this restoration, your posts and pages, settings, custom CSS files, and users will be recovered. Next, reinstall the theme and plugins so that your website displays properly.

After installing the theme, open the Plugins menu and install the missing plugins. Since the database has records of all of the plugins you have previously installed, you will get a warning about each plugin that is missing:

The Plugins section on the WordPress Admin area showing the missing plugins

This will help you identify all the plugins you need to install.

Step 4 – Fix links

To ensure the internal links on your website work correctly, recreate the permalinks.

Step 5 – Fix images

Since databases don’t store images, you will need to re-upload each image. To help you with this task, you can use the following tools 👇

Broken Link Checker plugin

Install and activate the Broken Link Checker plugin. Next, open the plugin’s settings, and there will be a list of broken links. This will help you determine which images are missing and their previous location. All you need to do is re-upload these images:

The Broken Link Checker settings showing some broken links found

Internet Archive

If some or all of your images are missing, you can try to retrieve them from the Internet Archive using the WayBackMachine section. Enter your website address on the search bar:

The WayBackMachine search bar

If there are any snapshots available for your website, they will be shown as blue circles around certain dates on the calendar. Click on your preferred date to access that version of your website:

The WayBackMachine search results showing snapshot availability by date

Once there, find the specific images, download them from the archived version, and upload them back to your website.

Your WordPress website is now restored as fully as possible using only the database. If you later find a backup with both files and database, restore your WordPress website from backups instead.