Troubleshooting License Issues When Running dbForge Command-Line Tools in Automation

Troubleshooting License Issues When Running dbForge Command-Line Tools in Automation

A dbForge product works correctly in the graphical user interface (GUI), but the same operation fails when run from the command line as part of an automated process, such as a .bat or PowerShell script, Task Scheduler, a Windows service, IIS, SQL Server Agent, or a CI/CD pipeline.

The command-line tool may report that no active license is available or that the license or subscription has expired. In some cases, the process terminates without performing the requested operation or displaying any output.

Symptoms
  • The command-line tool displays the message "To continue using the program, an active license is required, or reports an expired license" or subscription even though the license is valid.
  • The process terminates without output or without performing the requested operation.
  • The same command works when run manually in an interactive session under the account used to activate the product.
Cause
The command-line tool is part of the dbForge product and does not require a separate license. It uses the same product activation as the graphical interface.

Product activation is associated with the Windows account under which it was performed. If the command-line tool runs under a different account (a task account, service account, IIS application pool account, SQL Server Agent proxy account, or CI/CD build agent account), the product may not find the activation and may report that the license is missing or expired.

Activation may also be required again after a hardware configuration change, including a BIOS update.

Command-Line Executable Names

In the examples below, dbforgetool.com is a placeholder. Replace it with the command-line executable for your product. The executable is located in the product installation directory, alongside the corresponding .exe file.

Product
Command-line executable
dbForge SQL Complete
sqlcomplete.com
dbForge Studio for MySQL
dbforgemysql.com
dbForge Data Compare for SQL Server
datacompare.com
dbForge Schema Compare for SQL Server
schemacompare.com

For other products, including other providers, refer to the Activation section of the corresponding product documentation: Documentation Center.

The installation directory depends on whether the product was installed separately or as part of a product bundle, such as Compare Bundle or SQL Tools.

Diagnostics

Before changing the activation settings, check the following:

1. Verify the product version. An active license without restrictions covers product versions released while the subscription was active. A subscription is required to use newer versions released after the subscription expires. Make sure the automated process uses the same product version as the GUI and that this version is covered by your subscription. You can check your subscription expiration date in the Customer Portal.

2. Identify the account running the command-line tool. Check the account configured in the corresponding automation environment:

- Run as for a scheduled task.
- Log on for a service.
- Identity for an IIS application pool.
- The proxy account for SQL Server Agent.
- The account used by the CI/CD build agent.

To verify the account, add the following command at the beginning of your script and redirect its output to a file: whoami > account.txt

3. Run the same command manually under the account used to activate the product. If it works when run manually but fails when launched by a task or service, the cause is that different accounts are being used.

If the accounts differ, choose one of the solutions below.


Resolution

Choose the option that best matches your automation scenario:


Option 1: Use the Same Account for Regular Automation

This option is recommended for regularly scheduled or continuous automation.

Use the same account to activate the product and run the entire process:

1. Activate the product under the account that will run the automation (through the GUI or by using the /activate /key:your_key command).

2. Configure the automation so that the CLI always runs under the same account and on the same computer.

The same requirement applies to Azure DevOps: the agent service must run under the account used to install and activate the product. For details, see Register Devart Tools.


Option 2: Activate and Deactivate the Product Around Each Operation

This workaround may be suitable for occasional use of the account (for example, when a particular user logs in to the system) or for infrequent automation.

You can create two .bat files: one to activate the product before running the command-line operation and another to deactivate it afterward.

1. First .bat file: Run it before executing the command-line operation.
  1. Open Notepad.
  2. Add the following command: "C:\Program Files\Devart\<product folder>\dbforgetool.com" /activate /key:your_key". The path in quotation marks is the full path to your product's command-line executable. For more information, see the Activate via the command line section in the Documentation Center. your_key is the full activation key copied from the Customer Portal.
  3. Save the file in a convenient location with the .bat extension, for example, activate_example.bat. Select All Files as the file type.
2. Second .bat file: Run it after the operation is completed.
  1. Open Notepad.
  2. Add the following command: "C:\Program Files\Devart\<product folder>\dbforgetool.com" /deactivate". Replace the path with the full path to your product's command-line executable.
  3. Save the file in a convenient location with the .bat extension, for example, deactivate_example.bat. Select All Files as the file type.
3. Run the scripts in the following order

activate_example.bat
Your existing command-line operation
deactivate_example.bat

All three steps must run under the same Windows account and on the same computer.

Info
Important:
  1. An Internet connection is required to deactivate the product.
  2. After deactivation, the product cannot be used until it is activated again.
  3. For dbForge SQL Tools, deactivation affects all tools included in the bundle.