WhichWebHosting home

HomeGuidesWebsite migrationHow to restore a website from a backup

How to restore a website from a backup

Published

Share

How you restore a website from a backup depends on your panel or platform: cPanel restores through its Backup Wizard or File and Directory Restoration, and Plesk through its Backup Manager.1, 2, 3, sources 1, 2 and 3 For a WordPress site restored by hand, the typical order is the files first and then the database.4, source 4

What a restore needs before you start

A typical WordPress site needs both a files backup and a database backup to be fully restored.4, source 4 A WordPress database contains every post, every comment and every link on the site.4, source 4 WordPress files are the files in the WordPress directory on the web server, such as core, themes, plugins, uploads, wp-config.php and .htaccess.4, source 4 In a typical WordPress setup, the database is stored in a separate database system, usually MySQL/MariaDB, so backing up the files does not back it up.4, source 4

Backing up the WordPress database does not back up the WordPress files, such as themes, plugins, uploads and wp-config.php.5, source 5 To keep backups consistent, treat the files and the database as one backup set, for example both created around the same time.4, source 4 A database export file such as a .sql, .gz or .bz2 file can be stored beside the file backups, but restoring from it still requires importing it back into MySQL/MariaDB.4, source 4

A cPanel account backup is a tarball (.tar.gz) file that contains compressed versions of an account's files.6, source 6 It also includes files the account does not own but can access, and it leaves out files the account does not own and cannot access.6, source 6 Its /mysql directory holds the account's MySQL dumps for its MySQL databases.6, source 6 A cPanel Home Directory backup includes all the files the account owns, including its public_html files and any email for the domains that belong to the account.1, source 1

In Plesk, restoring objects from a backup overwrites and replaces existing objects with the same name, with no prompt before an existing object is overwritten.3, source 3 You also lose all changes made to the restored objects after the backup was created.3, source 3 In cPanel's File and Directory Restoration interface, the system restores deleted files and overwrites existing files.2, source 2

How to restore a backup in cPanel

The cPanel Backup Wizard lets you back up all or part of your website, or restore it from the most recent partial backup file.1, source 1 In cPanel, the Backup Wizard only appears if the hosting provider's server profile enables it.1, source 1 You cannot automatically restore a full backup file in cPanel, because that function is only available in WHM.1, source 1

For an automatic restore of a full backup file, you contact your hosting provider.1, source 1 To manually restore the public_html folder from a cPanel full backup, uncompress the tar.gz file, take the files from the public_html folder inside the /homedir directory, and upload them to the account's public_html folder with cPanel's File Manager.1, source 1

  1. To restore part of a site, click Restore in the Backup Wizard, and the Select Restore Type section appears.1, source 1
  2. Select which portion of your website to restore, and the Restore section appears.1, source 1
  3. Click Choose File and select the backup file.1, source 1
  4. Click Upload to begin the restoration process.1, source 1

The extension of the backup file you choose for a Backup Wizard restore depends on the portion of your site that you backed up.1, source 1

For cPanel's File and Directory Restoration to work, the system administrator or hosting provider must enable account backups in WHM's Backup Configuration interface.2, source 2 The File and Directory Restoration interface restores only from local backup files, so remote backup files must be transferred to the local server first.2, source 2 It cannot restore an account's .cpanel and mail directories, which need a full account backup restoration.2, source 2

  1. To restore a file or folder, go to the Files and Directories section and select Enter a path or Browse files and directories.2, source 2
  2. Enter a path such as public_html, which stands for the /home/user/public_html directory, or browse to the item.2, source 2
  3. Click Show Backups to list the backups for the file or directory in the Backups section.2, source 2
  4. Choose the backup you want and click Restore, then click Restore again when cPanel asks you to confirm; a success or failure message appears.2, source 2

How to restore a backup in Plesk

Plesk can restore only backups made in Plesk Onyx 17.0 and later.3, source 3 In Plesk, you can restore all data in a backup or select individual objects, such as a particular site or all databases.3, source 3 Websites & Domains > Backup Manager shows the backups stored in the server storage and in remote storages.3, source 3

In Plesk, the administrator restores data by going to Tools & Settings > Backup Manager and clicking the creation date of the backup.7, source 7 Plesk's Backup Manager list can contain backups stored in the server storage and in FTP storage, and the FTP ones have an icon in the System notes column.7, source 7

When you restore an incremental backup, Plesk also restores the data from the preceding full backup and every incremental backup made after it and before the selected one.7, source 7 Plesk warns when a backup file was modified after creation, is corrupted, or was created on another Plesk server, and you cannot start the restoration until you select the option Restore backup file despite a corrupted signature.7, source 7 In Plesk's Overwrite restoring mode, an object in the backup that is present in Plesk replaces the one in Plesk, and an object present in Plesk but missing from the backup file is not changed.7, source 7

  1. To restore all objects, go to Websites & Domains > Backup Manager and click the backup you want to restore.3, source 3
  2. Under What do you want to restore?, select the All objects (entire system) option.3, source 3
  3. Under Components to restore, clear the checkboxes for classes of objects you do not want to restore.3, source 3
  4. For a password-protected backup, select Get password from settings of Remote storage, and Plesk tries to fetch the password automatically.3, source 3
  5. When Plesk cannot fetch the password, such as for a backup created on a different server, select Input password manually and type it.3, source 3
  6. Optionally, select the Suspend domains until the restoration is completed checkbox, which makes the website unavailable and shows visitors an error page with the 503 HTTP status code until the restoration finishes.3, source 3
  7. Click Restore to begin restoring from the backup.3, source 3

Selecting the Databases checkbox makes Plesk restore all databases and database accounts, and clearing it restores none.3, source 3 If you do not know a backup's password and clear the Provide password checkbox, Plesk restores the backup but generates all passwords for restored objects, such as database accounts or mail accounts, at random.3, source 3

In Tools & Settings > Backup Manager, clearing the Provide the password option for a forgotten password also loses information about installed APS apps.7, source 7 Plesk restoration can take some time, depending on the size of the content being restored, and a notification appears on the Backup Manager screen when it finishes.3, source 3

  1. To restore only some objects, go to Websites & Domains > Backup Manager and click the backup you want to restore.3, source 3
  2. Under What do you want to restore?, select the Selected objects option and choose the type.3, source 3
  3. Click the objects you want to restore, and they move to the Selected column.3, source 3
  4. Choose whether to restore only the configuration or both the configuration and the content.3, source 3
  5. Click Restore to begin restoring from the backup.3, source 3

Plesk can restore individual mail accounts, databases, sites with their associated objects and content, the DNS zone contents for individual domains, and individual files.3, source 3 Several objects of one type can be restored at the same time, but objects of two different types, such as a mailbox and a database, take two restoration sessions.7, source 7 Restoring only a database's configuration in Plesk restores the database and its database accounts but not the tables or the data.3, source 3

How to restore a WordPress site by hand

For a typical WordPress restore, restore the WordPress files first and then restore or import the database.4, source 4 A WordPress files backup must include all files in the WordPress directory, including subdirectories, and the .htaccess file.8, source 8 The important files in a WordPress backup are wp-config.php, which holds your settings, and the wp-content directory with its theme and plugin files.8, source 8

By default, the wp-content directory holds your own content, such as edited themes, new plugins and uploaded files.8, source 8 The WordPress core files can be replaced from a fresh download of the WordPress zip file, so there is normally no need to copy them.8, source 8

The wp-config.php file contains the connection details for the WordPress site.8, source 8 Changing database credentials during a migration means you update wp-config.php to match.4, source 4 When you upload a database backup to another host, you recreate the database user with the matching password.5, source 5

Restoring a WordPress database with phpMyAdmin replaces the current database with the backup, reverting it to the state it was in when you backed up.5, source 5 In cPanel, phpMyAdmin is reached by clicking MySQL Databases and then the phpMyAdmin link.4, source 4 In Plesk, the Open button for the WordPress database on the Websites & Domains screen opens phpMyAdmin.4, source 4

  1. Click Databases in phpMyAdmin and select the database you will import your data into.5, source 5
  2. Click the Import tab.5, source 5
  3. Click Browse in phpMyAdmin's Import screen and locate the backup file stored on your computer.5, source 5
  4. Make sure SQL is selected in the Format drop-down menu.5, source 5
  5. Click Go to run the import, which takes a while, and a success screen eventually appears.5, source 5

phpMyAdmin cannot handle large databases, so command-line MySQL/MariaDB code helps for those.5, source 5 A MySQL/MariaDB command-line restore consists of unarchiving the database dump and importing it into the MySQL/MariaDB database.5, source 5

A .bz2 database backup is unpacked with bzip2 -d, for example bzip2 -d blog.bak.sql.bz2.5, source 5 A database backup that is a .tar.gz file is unpacked with tar -zxvf instead.5, source 5 The command mysql -h mysqlhostserver -u mysqlusername -p databasename < blog.bak.sql puts the backed-up SQL back into MySQL/MariaDB.5, source 5

In cPanel, the Download a MySQL Database Backup option downloads a *.gz file when you click the database name.5, source 5 The .gz file does not need unzipping, and you restore it by browsing to it and uploading it in the same cPanel backup feature.5, source 5

What your host does with backups

Most hosts back up the entire server, including your site, but it takes time to request a copy of the site from their backups.4, source 4 Most website hosts also provide software to back up your site, so check with your host for the services and programs it provides.4, source 4 You need to learn how to back up your own site files and restore them.4, source 4

ChemiCloud shared hosting plans include daily offsite backups stored for up to 30 days.9, source 9 On ChemiCloud WordPress hosting, daily backups of the site are kept for up to 30 days and can be restored from the control panel.10, source 10 Through JetBackup, ChemiCloud customers can generate a full manual backup free of charge.11, source 11 For Cloud VPS, ChemiCloud offers Cloud Remote Backup, powered by JetBackup, with 30 days of backups.12, source 12

GreenGeeks removes most customer-generated backups, such as cPanel and Softaculous backups, after 48 hours.13, source 13 GreenGeeks does not guarantee that its disaster recovery backups can restore a site to a specific date.13, source 13

Every AccuWeb Linux shared plan has a free daily backup, and AccuWeb customers contact AccuWeb to restore from it.14, source 14 The complimentary AccuWeb VPS backup cannot restore a single file or folder.15, source 15 The paid AccuWeb VPS backup keeps daily snapshots for 7 days.15, source 15

How to keep backups you can restore

Back up your database regularly, and always before an upgrade.4, source 4 For high-activity WordPress sites with a lot of posts, backups should be made daily.4, source 4 Keep at least three backups on file, in case one is corrupted or lost, stored in different places and on different mediums.4, source 4 For example, keep one on the hosting server, one on cloud storage and one downloaded to your local computer.4, source 4

WinSCP and other programs can sync with your website to keep a mirror copy of the content on your server and on your hard drive.4, source 4 With an FTP client or UNIX shell, you can copy your site files to a folder on your computer.4, source 4 The easiest way to back up WordPress files is to use an FTP program to download them all from your host to your local computer.8, source 8

Backups of a WordPress site can be automated, and several methods exist.4, source 4 Back up automatic backups with a manual backup once in a while to confirm the process is working.4, source 4

To create a full backup in the cPanel Backup Wizard, click Back Up and then Full Backup.1, source 1 The Backup Wizard's Home Directory destination saves the backup file in the home/username directory on the server.1, source 1 In the Backup Wizard, you enter your email address in the Email Address text box to be notified when the backup finishes.1, source 1

A cPanel full backup is named in backup-MM-DD-YYYY format, where MM is the month, DD is the date and YYYY is the four-digit year.1, source 1 The cPanel backup process for an account near or over its quota may fail because the system cannot write necessary files such as a database lock file.1, source 1

In Plesk, Account > Back Up Websites backs up the websites of the selected subscription, and you click Back Up to create the backup.16, source 16

Common questions

How do I restore from a backup in cPanel?

Use the Backup Wizard for part of a site. Use File and Directory Restoration for individual files and folders.

Can I restore a full backup in cPanel?

No, not automatically. That function is only available in WHM, so you contact your hosting provider to automatically restore a full backup.

Does restoring from a backup overwrite my current files?

Yes. In cPanel's File and Directory Restoration interface, the system restores deleted files and overwrites existing files. In Plesk, restoring objects overwrites and replaces existing objects with the same name, with no prompt before an object is overwritten.

Do I need the database as well as the files?

Yes. A typical WordPress site needs both a files backup and a database backup to be fully restored.

How do I restore a WordPress database?

Import the SQL file in phpMyAdmin, or use the mysql command. The mysql command puts the backed-up SQL back into MySQL/MariaDB.

How many backups should I keep?

Keep at least three backups on file. Store them in different places and on different mediums, in case one is corrupted or lost.

Sources

Every fact on this page comes from one of these, checked before it goes live.

More guides

Email hosting

Does 123 Reg hosting include email?

123 Reg's Web Hosting, Hosting for WordPress and Premium Hosting plans include email addresses, and 123 Reg sells Titan and Microsoft 365 email plans.

· Mateo Cardenas

Email hosting

Does web hosting include business email?

Web hosting sometimes includes business email. See what SiteGround, Namecheap and HostGator state, then how MX records and SPF records work.

· Mateo Cardenas

Hosting glossary

How to build a website

Learn how to build a website by planning its look, getting hosting and a domain name, setting up files with HTML or WordPress, and publishing it live.

· Mateo Cardenas