Your website's content -- posts, pages, products, orders and settings -- lives in a MySQL database. If a plugin update corrupted it, content was deleted, or the site was hacked, you can restore the database from an earlier backup yourself. This guide shows how to restore a MySQL database with JetBackup 5 in cPanel.
Before you restore a database
- Restoring replaces the current data. The database goes back to how it was on the backup date. Anything added since -- new orders, comments, form entries, posts -- will be lost from that database.
- Save today's copy first. In cPanel, go to Databases > phpMyAdmin, select the database and use Export to download it. If the restore doesn't help, you can import this copy back.
- Know which database your site uses. For WordPress, open
wp-config.phpin File Manager and look at theDB_NAMEline. You can also see all your databases in Databases > Manage My Databases. - Pick the right date. Backups run three times a week and the latest 7 are kept (about two weeks). Choose one from before the problem started.
How to restore a database with JetBackup 5
- Log in to cPanel and go to Files > JetBackup 5.
- If this is your first visit, read the terms, tick the I Agree boxes and click Continue to Panel.
- Click Databases on the dashboard (or Restore & Download in the left menu, then the Databases tab).
- Tick the database you want to restore, for example
exampleco_wp123. - The newest backup is selected by default. To use an older one, click Choose Other Backup and pick the date.
- If the database user is missing too (for example, you deleted it), also restore it from the Database Users tab. When you restore only a database, only the database is restored -- not its user.
- Click Restore.
- Check the items listed, accept any restore conditions shown, and click Restore Selected Items.
- Click Queue in the left menu and wait for the status to show Completed.
- Open your website in a private browser window and check that the content is back.
Restoring a WordPress site: files too?
A WordPress site is made of files (themes, plugins, uploads) and a database. If you only restore the database, the files stay as they are now. That's usually fine for lost or broken content. But if a plugin or theme update caused the problem, you may also need to restore the wp-content folder from the same date, or restore the whole site from a WP Toolkit backup. Mixing a very old database with brand-new plugin files can cause errors.
Troubleshooting
"Error establishing a database connection" after restoring
The database user may be missing or no longer linked to the database. In Databases > Manage My Databases, check the user exists and is added to the database with All Privileges. Make sure the username and password match what's in wp-config.php. See the database connection guide for details.
My database isn't in the list
It wasn't included in any of the kept backups -- for example it was created in the last day or two. Open a ticket if you think it should be there.
The restore worked but the site still shows old content
You're probably seeing a cached page. Purge the LiteSpeed Cache (in WordPress, LiteSpeed Cache > Toolbox > Purge All) and clear your browser cache.
Can I restore just one table?
Not directly. Download the database backup instead (see the download guide), open the .sql file, and import only the part you need with phpMyAdmin -- or open a ticket and the Instant Access Internet Services team will help.
Related guides
- How Website Backups Work on Your Hosting Account (JetBackup 5)
- How to Import and Export a Database with phpMyAdmin
- How to Fix "Error Establishing a Database Connection" in WordPress
- How to Back Up and Restore WordPress in WP Toolkit
- How to Download a Copy of Your Website Backup (JetBackup 5)
Still stuck? Open a support ticket and the Instant Access Internet Services team will help.
