WHM - Plesk - CWP

MySQL Backup & Restore in cPanel (2025 Guide)

Backing up and restoring a MySQL database is essential for preventing data loss. In this guide, you’ll learn how to do both using cPanel safely and efficiently.

1. How to Backup Your Database via cPanel

Log in to your cPanel and follow these steps:

  1. Go to phpMyAdmin under the “Databases” section.
  2. Select your database from the left panel.
  3. Click the Export tab at the top.
  4. Choose Quick export method and SQL as the format.
  5. Click Go to download the backup file (.sql).

You now have a local copy of your database.

2. How to Restore a Database via cPanel

To restore a previously saved .sql file:

  1. In cPanel, open phpMyAdmin.
  2. Select the database you want to restore to (or create a new one).
  3. Click the Import tab at the top.
  4. Click Choose File and select your .sql backup file.
  5. Leave format as SQL and click Go.

After the upload, your database will be restored.

3. Advanced Database Backup Options

For large databases or complex backups, consider using the following advanced methods:

Using SSH & mysqldump

If your hosting supports SSH, you can use `mysqldump` to backup large databases from the terminal:

ssh [email protected] mysqldump -u username -p database_name > backup.sql

This will create a .sql file directly on your server. You can then download it via FTP.

Using BigDump for Large Imports

For large database restores, BigDump allows you to import `.sql` files in chunks:

  1. Download BigDump from here.
  2. Upload your .sql file and BigDump script to your server.
  3. Run the script via your browser and let it import the database in chunks.

4. Best Practices

  • Always keep multiple backups in different locations (local and cloud).
  • Do not overwrite live databases without checking the contents of the backup.
  • Use gzip format if the database is large to reduce file size.
  • Make sure the database user has the correct permissions before restoring.

5. Conclusion

Backing up and restoring your MySQL database via cPanel is a quick and reliable process. Regular backups ensure you can recover from unexpected issues without data loss. For larger sites, advanced tools like mysqldump or BigDump may be necessary.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top