Synchronizing Schemas
Last modified: November 2, 2023
This topic explains how to synchronize two database schemas.
Note
Schema synchronization can not be rolled back! It may alter or drop schema objects in your Target schema. It is highly recommended to backup the Target database before synchronization.
1. Review the comparison results and select required objects for synchronization. Clear the checkboxes next to the objects you do not want to be synchronized. You can also select an object and then click Exclude Selection on the shortcut menu to exclude one from the synchronization process.
2. Click the View Schema Update Script button on the Comparison toolbar.
3. Click the Synchronize button to open the synchronization wizard. You can select what you want to do with the synchronization script (either open or save).
4. Click the Synchronize button to close the wizard and complete the synchronization process.
5. Review the sync script, and then execute it by clicking the Execute button on the MySQL toolbar.
Selecting synchronization output
After you have selected the objects for synchronization, you can use the Schema Synchronization Wizard to create the synchronization script. To open the synchronization wizard, click the following button:
There are the following possible steps in the wizard:
- Open the synchronization script in the internal editor
If this option is selected, the script for database synchronization will be opened in the internal editor of dbForge Studio for MySQL. You will be able to execute it by clicking the Execute button on the toolbar menu.
- Save the script to a file
If you can save the script locally on your PC, select this option and specify a path to a folder you want to save the script to. If you want to open the script in the internal editor after saving click to select the checkbox next to this option.
- Execute the script directly against the target database
Select this option, if you want to execute the script without reviewing it.
dbForge Studio for MySQL can also refresh comparison results after the successful deployment of object changes. If you want the results to be refreshed, select the checkbox next to this option.
Synchronizing backups
If you select a backup as a target, the synchronization wizard creates a script to update the database from which the backup was created. You can not modify backups directly.
If a backup is selected as a source, and a database is a target, the deployment script will deploy the database from the backup.
Synchronizing scripts folders
When a scripts folder is the target, Update the scripts folder option appears on the Output tab of the Schema Synchronization Wizard.
Select this option, if you want to synchronize a database and a script folder directly without reviewing a script.
You can also choose to open the folder containing the output files and refresh comparison results after successful deployment of schema changes. Click to select the checkbox next to these options if you want these actions to be performed.
Clicking the Scripts Folder Structure button allows you to specify a structure for scripts folder and file name templates.
Want to find out more?
Overview
Take a quick tour to learn all about the key benefits delivered by dbForge Studio for MySQL.
All features
Get acquainted with the rich features and capabilities of the tool in less than 5 minutes.
Request a demo
If you consider employing this tool for your business, request a demo to see it in action.