How to use a project file in the CLI

Applies to
ApexSQL Data Diff, ApexSQL Diff, ApexSQL Doc, ApexSQL Log, ApexSQL Script, ApexSQL Trigger

Summary
This article explains how to use a project file in the CLI.

Description
Instead of setting the value of switches directly in the CLI, setting up a project file through the GUI with the desired options pre-set, saves time, because it requires only one switch to be used in the CLI.

Creating a project file
In this example we’ll use ApexSQL Data Diff, but for other products it is similar. Run ApexSQL Data Diff and open the New project dialog, from the Home tab in the top menu.

New project dialog in ApexSQL Data Diff

After setting up the source and SQL database destination, various comparison and synchronization options can be set. Furthermore, objects could be filtered and mapped, depending on the user preferred options.

Project options tab - Specifying comparison and synchronization options

When all options are set, the project can be saved by clicking on the Save button, in the bottom left corner of the New project dialog.

New project dialog - Clicking on the Save button

Name the project and set the path where it will be saved, in this example it’s saved to C:\Users\Nojro\Desktop\Projects\db_documentation.axdd

Naming the project and setting the path where the project will be saved

Quick tip icon

Quick tip:

Using a project file is particularly recommendable for repeated processes which have the same setup

Using a project file in the CLI
Run the Command Prompt as Administrator, and set the exact path to the installation directory of the app. e.g. ApexSQL Data Diff. To load a project file, use the switch /pf (for ApexSQL Doc, ApexSQL Log and ApexSQL Trigger the switch is /pr), and if it’s saved outside of the installation directory for mentioned tools, specify the path where it’s located. For the above example it’s:
C:\Program Files\ApexSQL\ApexSQLDataDiff2015\ApexSQLDataDiff.com
/pf:C:\Users\Nojro\Desktop\Projects\db_documentation.axdd

For the previous example, the project file is located in C:\Users\Nojro\Desktop\Projects\db_documentation.axdd. The extension .axdd has to be specified, so that a project file could be loaded correctly.

Extensions:
ApexSQL Data Diff: .axdd
ApexSQL Diff: .axds
ApexSQL Doc: .axdp
ApexSQL Log: .axlp
ApexSQL Script: .axsc
ApexSQL Trigger: .axap

Quick tip icon

Quick tip:

Full path of a project file, along with the project file extension e.g. .axds, has to be defined, so that command could be correct

The only switch that is added, beside the /pf switch, is the /v switch, to display all messages on the processed operation.

CLI - Adding the /v switch to display all messages on the processed operation

Quick tip icon

Quick tip:

Specified settings saved in the project file can be overridden if you add the appropriate switch, without the need to change the project file itself

Top FAQs about using the Project file in the CLI

  • Q: Can the same Project file be used in all ApexSQL applications?

    A: No, because each application has some settings that are specific only for it, and they cannot be used in other ApexSQL applications. The difference is made with specific extensions of the Project file for each application as listed above in the article.

  • Q: Can the Project file be modified?

    A: Yes. The Project file can be modified from the GUI and then saved with the changes made to replace the existing Project file or under a new name.