Command-line mode on macOS

Last modified: April 10, 2024

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 create a snapshot from the terminal. To do that, run the following command:

/Applications/CrossOver.app/Contents/SharedSupport/CrossOver/bin/wine --bottle 'dbForge_Schema_Compare' --check --wait-children --start "C:/Program Files/Devart/Compare Bundle for SQL Server/dbForge Schema Compare for SQL Server/schemacompare.com" /snapshot /connection:"User Id=[yourusername];Host=[host]" /database:[database] /password:[yourpassword] /file:"C:\users\crossover\My Documents\backup\file_name.sql"

Where:

  • /Applications/CrossOver.app/Contents/SharedSupport/CrossOver/bin/wine is the command that initiates CrossOver.
  • –bottle ‘dbForge_Schema_Compare’ is the parameter that specifies the name of the bottle that contains dbForge Schema Compare.
  • –check –wait-children –start are options that configure the launch of the application.
  • “C:/Program Files/Devart/Compare Bundle for SQL Server/dbForge Schema Compare for SQL Server/schemacompare.com” /snapshot /connection:”User Id=[yourusername];Host=[host]” /database:[database] /password:[yourpassword] /file:”C:\users\crossover\My Documents\backup\file_name.sql” is the command to create a snapshot with the specified options.

Worked example

Let us look at a worked example command to create a snapshot of the SQL AdventureWorks2016 database that resides on the demo-mssql\SQLEXPRESS server.

/Applications/CrossOver.app/Contents/SharedSupport/CrossOver/bin/wine --bottle 'dbForge_Schema_Compare' --check --wait-children --start "C:/Program Files/Devart/Compare Bundle for SQL Server/dbForge Schema Compare for SQL Server/schemacompare.com" /snapshot /connection:"User Id=yourusername;Host=demo-mssql\SQLEXPRESS" /database:AdventureWorks2016 /password:yourpassword /file:"C:\users\crossover\My Documents\snapshot\adventureworks2016.sql"

The snapshot has been created successfully.

Backup command

Run a batch file

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.

/Applications/CrossOver.app/Contents/SharedSupport/CrossOver/bin/wine --bottle "dbForge_Schema_Compare" --check --wait-children --start "C:\users\crossover\My Documents\snapshot.bat" 

Where:

  • /Applications/CrossOver.app/Contents/SharedSupport/CrossOver/bin/wine is the command that initiates CrossOver.
  • –bottle “dbForge_Schema_Compare” is the parameter that specifies the name of the bottle that contains dbForge Schema Compare.
  • –check –wait-children –start are options that configure the launch of the application.
  • “C:\users\crossover\My Documents\snapshot.bat” is the parameter that specifies the path to the batch file.

Note

You can automate the launch of dbForge Schema Compare from the command line using the standard macOS scheduler.