This topic describes the CLI-powered access to the functionality of dbForge Schema Compare installed into a CrossOver bottle. For more information on the command-line functionality of dbForge Schema Compare, refer to the corresponding topics of the documentation.
As an example, let’s see how to compare database schemas from the command line. To do that, run the following command:
"/opt/cxoffice/bin/wine" --bottle "dbForge_MySQL" --check --wait-children --start "C:\Program Files\Devart\dbForge Compare Bundle for MySQL Standard\dbForge Schema Compare for MySQL\schemacompare.com" /schemacompare /source connection:"User Id=[yourusername];Host=[host];Password=[yourpassword];Database=[database];Character Set=utf8" /target connection: "User Id=[yourusername];Host=[host];Password=[yourpassword];Database=[database];Character Set=utf8" /sync
Where:
Let us look at a worked example command to compare the schemas of two MySQL databases that reside on the dbfmylast server.
"/opt/cxoffice/bin/wine" --bottle "dbForge_MySQL" --check --wait-children --start "C:\Program Files\Devart\dbForge Compare Bundle for MySQL Standard\dbForge Schema Compare for MySQL\schemacompare.com" /schemacompare /source connection:"User Id=yourusername;Host=dbfmylast;Password=yourpassword;Database=db_staging;Character Set=utf8" /target connection:"User Id=yourusername;Host=dbfmylast;Password=yourpassword;Database=db_production;Character Set=utf8" /sync
The schema comparison and synchronization process begins and finishes successfully.
You can run not only individual commands, but also generated batch files (*.bat/*.cmd files), which are to be created as usual Windows batch files.
Let’s look at an example of code for a batch file.
"/opt/cxoffice/bin/wine" --bottle "dbForge_MySQL" --check --wait-children --start "C:\users\crossover\My Documents\schemacompare.bat"
Where:
Note
You can automate the launch of dbForge Schema Compare from the command line using the standard Linux scheduler.