Automate data comparison and synchronization from the command line

You can automate data comparison and synchronization by using the command line.

Run comparisons from the command line

Note

To run the Command Line in Windows 10:

From the Desktop Mode

  • Move the mouse cursor to the exact lower left corner until the desktop shortcuts menu appears.
  • Right-click to see the shortcut menu and than click Run.

From the Charms Bar

  • Move your mouse to the upper right corner until the Charms Bar appears.
  • Select Apps from the list and type ‘run’ in the search box.
  • Click Run from the search results.

Use Windows + R Shortcut Keys

  • In desktop mode, press the Windows + R keys, to show the Run command line.
  • In the window that opens, type cmd and press Enter.

1. Type a path to the datacompare.com extension located in the dbForge Data Compare for MySQL installation folder on your PC, and press the SPACE key.

C:\Program Files\Devart\dbForge Compare Bundle for MySQL Standard\dbForge Data Compare for MySQL

2. Specify command-line arguments: connection strings and actions you want to run. For example, specify the type of the operation.

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

3. Specify the objects you want to compare and synchronize.

C:\Program Files\Devart\dbForge Compare Bundle for MySQL Standard\dbForge Data Compare for MySQL>datacompare.com /datacompare /compfile:"D:\mycompdoc.dcomp"

4. Synchronize data directly into the database and generate a synchronization script file.

C:\Program Files\Devart\dbForge Compare Bundle for MySQL Standard\dbForge Data Compare for MySQL>datacompare.com /datacompare /compfile:"D:\mycompdoc.dcomp" /sync:"D:\mysync.sql" 

To synchronize data automatically, use /sync without file name specification:

C:\Program Files\Devart\dbForge Compare Bundle for MySQL Standard\dbForge Data Compare for MySQL>datacompare.com /datacompare /compfile:"D:\mycompdoc.dcomp" /sync

5. Geneate a comparison and synchronization protocol into a file.

C:\Program Files\Devart\dbForge Compare Bundle for MySQL Standard\dbForge Data Compare for MySQL>datacompare.com /datacompare /compfile:"D:\mycompdoc.dcomp" /sync:"D:\mysync.sql" /log:"D:\mylog.log" 

6. Compose a comparison report.

C:\Program Files\Devart\dbForge Compare Bundle for MySQL Standard\dbForge Data Compare for MySQL>datacompare.com /datacompare /compfile:"D:\mycompdoc.dcomp" /sync:"D:\mysync.sql" /log:"D:\mylog.log" /report:"D:\myreport.html" 

7. Specify the report file format: HTML, XLS, or CSV.

C:\Program Files\Devart\dbForge Compare Bundle for MySQL Standard\dbForge Data Compare for MySQL>datacompare.com /datacompare /compfile:"D:\mycompdoc.dcomp" /sync:"D:\mysync.sql" /log:"D:\mylog.log" /report:"D:\myreport.html" /reportformat:HTML

8. To run the process, press ENTER.

Tip: To execute the synchronization script, use the /execute switch:

C:\Program Files\Devart\dbForge Compare Bundle for MySQL Standard\dbForge Data Compare for MySQL>datacompare.com /execute /connection:"User Id=yourusername;Host=db;Port=3320;Database=test;Character Set=utf8" /inputfile:"D:\mysync.sql"

Generate a file with command-line arguments

To generate a file with command-line arguments, perform the following steps:

1. On the Start Page, click New Data Comparison. Alternatively, you can click the File menu and navigate to New > New Data Comparison.

2. Select Source and Target for comparison. Go through other wizard pages to tune the data comparison.

3. On the Options tab, click Save settings to a command line arguments file and specify the file name and location to save the file. The selected Source and Target connection strings and comparison options will be saved as command-line arguments in the file. You can edit the values of comparison options in the file.

Note that the generated file does not contain password information for security purposes. You should edit the file and enter the passwords manually.

For more information about how to use available additional arguments, see Switches used in the command line.

The command-line string with /argfile parameter looks as follows:

C:\Program Files\Devart\dbForge Compare Bundle for MySQL Standard\dbForge Data Compare for MySQL>datacompare.com /argfile:file_name.txt

Want to Find out More?

Overview

Overview

Take a quick tour to learn all about the key benefits delivered by dbForge Data Compare for MySQL.
Request a demo

Request a demo

If you consider employing the Data Compare for your business, request a demo to see it in action.
Ready to start using dbForge Data Compare for MySQL?