1. Home
  2. Backup & restore
  3. How do I restore my WordPress installation from backup?

How do I restore my WordPress installation from backup?

Den här artikeln finns även på svSvenska

From time to time you might need to restore your WordPres installation from backup, e.g. if the site has stopped working after an update, or if you edited some code on the site resulting in it no longer working. In this guide we’ll go through how you restore your site. Since a WordPress installation consists of both files and a database we will tell you how to restore both.

Keep in mind that a backup recovery overwrites the current files and database for the site. For example, if you have a webshop, you might lose orders if you restore from a previous date.

Since orders and such are stored in the database, feel free to try restoring just the files first and see if that solves the problem.

To get started with the restoration, log on to cPanel.

How to restore files

To restore files for your WordPress installation, you first must know what folder you need to restore.

If the installation uses the primary domain for the account

If the installation is reachable via the primary domain for the web hosting account (the one e.g. mentioned on invoices from us), you’ll find its files in the folder public_html on the account. Therefore, you may restore that specific folder using our tool Acronis Backup according to these instructions.

Do not restore the entire public_html folder if you have other domains’ document roots set to folders inside public_html. Instead, selectivly restore folders and files for the site itself.

If the installation uses an addon domain or a subdomain on the account

If you, on the other hand, have installed WordPress on an addon domain or a subdomain on your account, you need to doublecheck what folder the installation recides in. To check this, do the following:

  1. When you’re logged on to cPanel, click the icon Addon Domains (or Subdomains, the principle is the same).
  2. Scroll down and you’ll see a table with all addon domains (or subdomains). In the column Document root, you’ll find in which folder the installation recides.
    Document roots

You now know which folder you need to restore from backup. Follow the instructions here to restore the folder.

How to restore databases

Before you restore the database for your WordPress installation, you must know which database is being used by the site. You can find this out via the wp-config.php file for the installation. First, find the document root for the site (where the config file usually is found) according to the instructions above and check the file’s content. You can use SSH, FTP or the file manager built in to cPanel to do this. Look for these lines:

/** The name of the database for WordPress */ 
define('DB_NAME', 'database_name');

In your wp-config.php file, the phrase “database_name” will be replaced by the name of the database your installation is using.

With this knowledge, you’re now able to restore the database by following the steps described here.

Was this article helpful?

Related Articles