You can automate schema comparison and synchronization using the command line.
1. Click Start.
2. Type cmd in the Search programs and files text box and click ENTER.
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.
3. Type a path to the dbforgesql.com file, located in dbForge Studio for PostgreSQL installation folder on your PC, and press SPACEBAR.
4. Type all the arguments (actions you want to run) in the Command Prompt. You can do this in three ways:
/schemacompare /source connection:"Data Source=source_name;Integrated Security=False;User ID=yourusername;
Password=yourpassword;database=yourdatabase" /target connection:"Data Source=tartget_name;
Integrated Security=False;User ID=yourusername;Password=yourpassword;database=yourdatabase"
/schemacompare /compfile:"D:\file_name.scomp"
/argfile:"D:\file_name.txt"
"C:\Program Files\Devart\dbForge Studio for PostgreSQL Server\dbforgepostgresql.com" /schemacompare /argfile:file_name.txt /sync
Note
The path to the executable file will differ depending on how you have installed the Studio - as a standalone tool or as part of the dbForge Edge bundle. Make sure that you have specified a correct path. If you have installed the Studio as part of dbForge Edge, change the path accordingly:
C:\Program Files\Devart\dbForge Edge\dbForge Studio for PostgreSQL>dbforgepostgresql.com
Tip:
To see quick help on the arguments available in the command line, type:
dbforgepostgresql.com /?
5. Press ENTER to run the process.
/schemacompare
/schemacompare /source connection:"User Id=yourusername;Host=dbfmylast;Port=5432;Database=demo_dev;Unicode=True;
Connection Timeout=15;Integrated Security=False" /target connection:"User Id=yourusername;Host=JordanSanders;Port=5432;
Database=demo;Unicode=True;Connection Timeout=15;Integrated Security=False" /sync
You can also use the schema comparison document that already contains Source and Target connection strings.
/schemacompare /compfile:"C:\MyComparison.scomp"
/log:"C:\Log.log"
/report:"C:\Report.html"
/sync
/sync:"C:\sync_script_name.sql"