Command-line mode on Linux
Last modified: April 10, 2024
You can use the native Linux command line to run dbForge Studio for PostgreSQL.
Note
This topic describes the CLI-powered access to the functionality of dbForge Studio installed into a CrossOver bottle. For more information on the command-line functionality of the Studio, refer to the corresponding topics of the documentation.
As an example, let’s see how to compare schemas of two databases from the command line. To do that, run the following command:
"/opt/cxoffice/bin/wine" --bottle "dbForge_for_PostgreSQL" --check --wait-children --start "C:\Program Files\Devart\dbForge Studio for PostgreSQL\dbforgepostgresql.com" /datacompare /source connection:"User Id=[yourusername];Password=[yourpassword];Host=[X.X.X.X];Port=5440;Database=[database_name];Unicode=True;Connection Timeout=15;Integrated Security=False" /target connection:"User Id=[yourusername];Password=[yourpassword];Host=[X.X.X.X];Port=5440;Database=[database_name];Unicode=True;Connection Timeout=15;Integrated Security=False"
In this example:
"/opt/cxoffice/bin/wine"
…is the command that initiates CrossOver.
--bottle "dbForge_for_PostgreSQL"
…is the parameter that specifies the name of the bottle that contains dbForge Studio for PostgreSQL.
--check --wait-children --start
…are the options that configure the launch of the application.
"C:\Program Files\Devart\dbForge Studio for PostgreSQL\dbforgepostgresql.com" /datacompare /source connection:"User Id=[yourusername];Password=[yourpassword];Host=[X.X.X.X];Port=5440;Database=[database_name];Unicode=True;Connection Timeout=15;Integrated Security=False" /target connection:"User Id=[yourusername];Password=[yourpassword];Host=[X.X.X.X];Port=5440;Database=[database_name];Unicode=True;Connection Timeout=15;Integrated Security=False"
…is the command to run a schema comparison with the specified options.
Worked example
Let us look at a worked example demonstrating how to compare the contents of two PostgreSQL databases.
"/opt/cxoffice/bin/wine" --bottle "dbForge_for_PostgreSQL" --check --wait-children --start "C:\Program Files\Devart\dbForge Studio for PostgreSQL\dbforgepostgresql.com" /datacompare /source connection:"User Id=yourusername;Password=yourpassword;Host=10.10.102.84;Port=5440;Database=bikestores;Unicode=True;Connection Timeout=15;Integrated Security=False" /target connection:"User Id=yourusername;Password=yourpassword;Host=192.168.50.37;Port=5432;Database=bikestores_prod;Unicode=True;Connection Timeout=15;Integrated Security=False"
The schema comparison process begins and finishes successfully.
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.
"/opt/cxoffice/bin/wine" --bottle "dbForge_for_PostgreSQL" --check --wait-children --start "C:\users\crossover\My Documents\compare.bat"
In this example:
"/opt/cxoffice/bin/wine"
…is the command that initiates CrossOver.
--bottle "dbForge_for_PostgreSQL"
…is the parameter that specifies the name of the bottle that contains dbForge Studio for PostgreSQL.
--check --wait-children --start
…are the options that configure the launch of the application.
"C:\users\crossover\My Documents\compare.bat"
…is the parameter that specifies the path to the batch file.
Note
You can automate the launch of dbForge Studio from the command line using any scheduler for Linux.
Want to find out more?
Overview
Take a quick tour to learn all about the key benefits delivered by dbForge Studio for PostgreSQL.
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.