Database Backup and Restore

There are many reasons that can cause data loss. These are, for example, an operating system crash, power failure, hardware problem and many others. So it is necessary to back up databases periodically. With dbForge Schema Compare for MySQL you can perform database backup easily using Database Backup Wizard. Schema Compare for MySQL backs a database up into a simple SQL script. You can read and correct this script.

Backing Up an Entire Database

  1. Select a database to back up, backup script file name and location, click the Next button.

  2. Select Structure and Data, check Include all objects, click the Next button.
  3. Set the backup options, click the Backup button.

  4. Choose whether to open the backup script file in SQL Editor and whether to save the backup project for future use, and click the Finish button.

Backing Up Certain Database Objects

  1. Choose a database to backup, script file name and location, click the Next button.
  2. Select required information to backup.
  3. Select database objects to backup their structure if you have chosen Structure or Data to backup on the Backup Content page, click the Next button.
  4. Select tables to backup their data if you have chosen Data or Structure to backup on the Backup Content page, click the Next button.
  5. Set backup options, click the Backup button.
  6. Choose whether to open the backup script file in SQL Editor and whether to save the backup project for future use, and click the Finish button.

Restoring Database from Backup Script

To call Database Restore Wizard and restore the database from the backup script:

  1. In the Database menu, navigate to Backup and Restore and select Restore Database.
  2. Select a backup script file to restore and a target database.

  3. Check that the SQL file encoding for the restored file is selected correctly. The program automatically selects it basing on the restored file, if it fails, the default encoding (the current Windows encoding on the machine where Schema Compare for MySQL is running) is selected. You can always select a required encoding from the drop-down list.
  4. Click the Restore button.

Note If you backup and restore database in different MySQL versions, you may encounter errors.