Views:

MySQL: Exporting and Importing Databases

If you wish to move your MySQL database from one server to another, you can export and then import the tables and contents of your database using phpMyAdmin.

Is your database large?

If you have a very large database sometimes the backup process can time out or fail within phpMyAdmin. The workaround to this is to use a simple PHP script, uploaded to your home directory to run the mysqldump command. If you use the process below and the backup times out, here's how to perform a backup using PHP: MySQL: Database Dump with PHP

Exporting a MySQL Database

  1. Firstly, manage your database with phpMyAdmin by logging into Plesk and clicking on the Databases icon. Click on your database, and then the DB WebAdmin icon.
  2. Once phpMyAdmin has loaded (if it hasn't, check to make sure you allow pop-ups) click on your database in the left column.
  3. Click on the Export tab
  4. Select the tables that you wish to export. In the example below, we have selected all tables, table1, table2 and table3.
  5. Scroll to the bottom of the page, and select Save as file and click Go
  6. Save the resulting SQL dump file to a location on your computer.

Importing a MySQL Database

  1. Firstly, make sure you have created your new database in Plesk. Then manage your new database with phpMyAdmin by logging into Plesk and clicking on the Databases icon. Click on your database, and then the DB WebAdmin icon.
  2. Once phpMyAdmin has loaded (if it hasn't, check to make sure you allow pop-ups) click on your database in the left column.
  3. Click on the Import tab
  4. Browse to your saved SQL dump file, and click Go to import tables and content to the new database.

Get in touch

For any additional help, give us a call on 0800 477 333 (8AM to 10PM, 7 days a week).