Restore a MySQL database from a backup with JetBackup 5

Print
  • 1

If posts, products, orders or settings of your site have disappeared or been damaged, the content can usually be brought back by restoring the site's MySQL database. In cPanel open JetBackup 5, then Databases, select the database and the date, click Restore and confirm. The files of the site are not touched.

Three checks before you restore

1. Which database does the site use?

An account can hold several databases, and their names start with the cPanel username. The site's configuration file tells you which one it uses: for WordPress it is wp-config.php, line DB_NAME; Joomla keeps it in configuration.php and OpenCart in config.php. You can open these files with File Manager.

2. What will be lost?

The whole database goes back to the backup date. Orders, comments, registered users and pages saved after that date disappear. If there is something recent you want to keep, first export the current database with phpMyAdmin, as shown in exporting and importing a database with phpMyAdmin. You can then copy back individual records if you need them.

3. Which date?

Backups are made every 24 to 48 hours and kept for 30 days. Pick the last one taken before the problem started. If the files of the site also changed (for example a plugin update), restore the files from the same date too, following restoring website files with JetBackup 5.

Restore steps

  1. Log in to cPanel and click JetBackup 5 in the Files section.
  2. Under Restore & Download, click Databases.
  3. Find the database in the list. With many databases, type part of the name in the Search box. Each row shows the date of the newest backup and how many backups exist.
  4. To use an older date, click Choose Other Backup in that row and pick the date you need.
  5. Click the row so that it is selected, then click Restore under the list.
  6. In Restore Summary, check that the right database is listed under Items To Restore, then click Restore Selected Items.
  7. Follow the job in Queue. Once it shows Completed, the database is back. If it shows Failed, try another date.

After the restore

  • Open the site and its admin panel and check that the content is the expected one.
  • Clear the cache of the caching plugin and of the browser; otherwise you may still see pages saved before the restore.
  • If the site shows a database connection error (in WordPress: "Error establishing a database connection"), the database user may be missing or have a different password. Check in cPanel, under MySQL Databases, that the user exists and is added to the database, and compare the details with the configuration file. You can also restore the user from the Database Users tab of JetBackup. More on these details in the data needed to work with MySQL.

Frequently asked questions

Can I restore only one table?

Not from JetBackup directly. Select the database and the date and click Download instead of Restore. When the archive is ready in View Downloads, take the table you need from it and import it with phpMyAdmin. If you are not sure how, open a ticket and tell us the database, the table and the date.

The database I deleted is not in the list. What now?

It can only be restored if it existed when one of the last 30 days of backups was taken. If you cannot find it, write to us with its exact name.

Can I restore the database under a different name?

JetBackup restores it under its original name. To get a copy alongside the current one, create a new database (see how to create a MySQL database) and import the downloaded file into it with phpMyAdmin.

Related articles

Was this answer helpful?