Additional /datacompare Arguments

This topic gives detailed description of command line switches and examples of their usage.

You can select the required options while setting the comparison in the Data Comparison wizard and generate a file with command line arguments by clicking Save settings to a

Arguments

To get more information on switches related to data comparison in the command line interface, you can type:

C:\Program Files\Devart\dbForge Data Compare for PostgreSQL>datacompare.com /datacompare /?

Below all switches of this option are described, together with usage examples.

Action Parameter
Compare data /datacompare
Load command line settings from a comparison .dcomp project file /compfile:
Generate a comparison log file in the specified directory /log:
Generate data comparison report file. /report:”:
Specify report format /reportformat:<HTML/XLS>
Generate and save a synchronization script, specify the file location and name. If an output file path is specified, the program will generate only a synchronization script. /sync:”D:\sync_script.sql”

Usage Examples

To practice comparison and synchronization through the command line, try to generate a synchronization script for a database backup and a live database. To do this, you should first change the default path in the command line by typing cd (for example, C:\Program Files\Devart\Devart dbForge Data Compare for PostgreSQL\datacompare.com) and pressing Enter. After the default directory has changed, type the following arguments into the Command Prompt:

    /source connection:"Host=pgSqlHost;Port=5435;Database=db1;User ID=postgres;Password=postgres;Pooling=False;Unicode=true;" 
	/target connection:"Connection Lifetime=120;Host=pgSqlHost2;Port=5436;Database=db2;User ID=postgres;Password=postgres;Pooling=False" 
	/source server:db port:5440 user:postgres password:postgres database:db1
	/target server:db2 port:5440 user:postgres password:postgres database:db2 
  1. Compare data using settings from a file saved earlier:

    /datacompare.com /compfile:"D:\workDir\DC1vsDC2.dcomp"
    
  2. Compare and synchronize data using connection string. Log will be written to the specified file:

    /datacompare.com /source connection:"Connection Lifetime=120;Host=pgSqlHost;Port=5435;Database=db1;User ID=postgres;Password=postgres;Pooling=False" /target connection:"Connection Lifetime=120;Host=pgSqlHost2;Port=5436;Database=db2;User ID=postgres;Password=postgres;Pooling=False" /sync /log:"D:\sync.log"
    
  3. Compare data of the specified databases and save the synchronization script to the D:\compare_result.sql file:

    /datacompare.com /source server:db port:5440 user:postgres password:postgres database:db1 /target server:db2 port:5440 user:postgres password:postgres database:db2 /sync:"D:\compare_result.sql"
    
  4. Compare and synchronize data using settings from the file, do not generate comments in the synchronization script ; generate a report to the specified file in the html format:

    /datacompare.com /compfile:"DC1vsDC2.dcomp" /nocomments:yes /report:"report.txt" /reportformat:HTML /sync
    
  5. Compare data and generate data report using settings from a file. Comparison and data writing settings of the different objects will be included into the report.

    /datacompare.com /compfile:"DC1vsDC2.dcomp" /report:"report.html" /incdata:Yes /incsettings:Yes