You can automate schema comparison and synchronization using the command line.
Type a path to the dbforgemysql.com file, located in dbForge Studio for MySQL installation folder on your PC, and press the space bar.
Type all the arguments (actions you want to run) in the Command Prompt. You can do this in three ways: 1) Type all the arguments directly in the Command Prompt, for example:
/schemacompare /source host:<server_name> database:<database_name> [port:port] user:<user_name> [password:password] [charset:charset] /target host:<server_name> database:<database_name> [port:port] user:<user_name> password:password [charset:charset]
2) Specify a path to a previously saved comparison document to use the connection settings along with the comparison settings specified in the document.
3) Type the path to a previously generated file with required command line arguments (see below how to prepare the file), for example:
Type additional parameters that are not specified in the file into the Command Prompt, for example:
C:\Program Files\Devart\dbForge Studio for MySQL>dbforgemysql.com /argfile:file_name.txt /schemacompare /sync
Tip: To see a quick help on the arguments available in the command line, type the following:
Define what action you want to run, for example:
Define Source and Target connection strings:
/schemacompare /source connection:"host:host_name;port:port;user:user_name;password:password;database:database_name" /target connection:"host:host_name;port:port;user:user_name;password:password;database:database_name"
If you compare a database project, you should specify the path to its file on your PC. For example,
/schemacompare /source dbproject C:\MyProject.mydev /schemacompare /target dbproject C:\MyProject1.mydev
You can also use the Schema Comparison Document that already contains Source and Target connection strings.
To generate and save a log file, specify the file name and location. For example:
To generate and save a comparison report file, specify the file name and location. For example:
To synchronize the schemas, i.e., update the Target schema, type the following:
To generate and save a synchronization script, specify the file location and name. For example: