If you have both your website's files and database backups, follow this guide: restore your WordPress website.
Alternatively, if your WordPress website backup files are missing or corrupted, but you still have the database, you can try to recover your website by following the steps below.
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
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:
Step 2 - Restore the WordPress installation
Create a fresh WordPress installation on your hosting:
Download the WordPress installation files from the official website.
Upload them using any preferred option: Import Website, File Manager, FTP, etc.
Once the WordPress files are uploaded, access your WordPress Admin area:
Open this URL on your browser:
domain.tld/wp-admin
, replacingdomain.tld
with your domain nameChoose 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:
Once the database connection is correctly established, you will get a message indicating that WordPress is already installed:
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.
Make sure to install your previous theme 💡
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:
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:
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:
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:
Once there, find the specific images, download them from the archived version, and upload them back to your website.
That's it! Your website has now been restored in the most comprehensive way possible using only the database.