Home
/
PHP & MySQL Tutorials
/
MySQL Backup Restore Tutorial

MySQL Backup Restore Tutorial

This tutorial explains how to back up the information from your MySQL databases and restore it when needed.

MySQL Export: How to backup your MySQL database?

To create a dump file of a database used by your account you can use the phpMyAdmin available in your Site Tools > Site > MySQL > phpMyAdmin:

Once the tool page loads, select the database in question from the panel on the left side.

A new page will be loaded showing the structure of the selected database. To create a backup of the database, click on Export.

On the page that opens you can choose from using the Quick or Custom export methods. The Quick method is usually the preferred choice, but if you would like to customize the export process and output you can use the Custom one. Once you choose the appropriate method, select the desired format of the backup from the Format: drop-down and click on Go.

A download window will pop up prompting for the exact place where you would like to save the file on your local computer. It is possible that the download starts automatically. This depends on your browser’s settings.

MySQL Import: How to restore your MySQL database from a backup

First, upload the database backup copy on your account. Make sure to place the backup file outside the public_html folder so that it is not accessible from a browser.

Then go to Site Tools -> Site -> MySQL tool. In it, find the database you want to import your backup, click the kebab menu -> Import Database Dump.

Click Browse and navigate to the location of your database backup in the popup that appears, select it and click Select. Then click the Import button.

N.B. Importing in the existing database will overwrite any matching existing data. We strongly recommend that you create a backup of your database first. You can learn how to do this by following the instructions in the first section of this tutorial.

MySQL Import: How to restore your MySQL database from a backup using phpMyAdmin

To restore a database via phpMyAdmin, first, choose the database you’ll be importing data into. This can be done from the menu on the left.

A new page will be loaded showing the structure of the selected database. To import data inside the database, click on Import.

On the new page that opens, click on Choose file and select the backup that you want to import from your local computer. You have the option to pick the character set of the file from the drop-down menu just below the upload box. If you are not certain about the character set your database is using just leave the default one. Once ready, click on Go to perform the import.

The import will start and once finished you will be redirected to a page with a confirmation notification that the import was successful.

Share This Article