From Flow 7.0.2, we introduced the Flow CLI that can be executed against the Flow Config.exe
Note
- This article assumes the default installation location of the Flow Configuration tool. Please be aware that your config tool might reside in a different location based on your specified installation path.
CLI Main features
The CLI can be used to perform the following actions/commands:
- Migrate - Migrate a Flow instance to the current version.
- Create - Create a new Flow instance.
- Backup - Perform a SQL database backup of a Flow instance.
- Import - Import a module (--file) or modules (--folder) into a Flow instance (Flow.pkg Files).
- Licence Update - Update the license key (--key) of a Flow instance.
- Version - Display version information.
The CLI is executed against the "Flow Config.exe" and can be found in the following default location:
C:\Program Files\Flow Software\Flow\Config\
To execute any of the CLI commands, open the Command Prompt and navigate to the directory as listed above:
Execute commands against the CLI - Help
Don't know what commands are available to execute? The CLI does have an --help option to get users started on the available commands and required parameters to pass per command executed:
C:\Program Files\Flow Software\Flow\Config\"Flow Config.exe" --help
This will list the following options:
Execute commands against the CLI - Migrate
The migrate command will migrate a previous version of the Flow instance to the version of the installed Flow Config tool.
C:\Program Files\Flow Software\Flow\Config>start /wait "" "Flow Config" --migrate --host=<SQLServerName> --database=<FlowDatabaseName> --user=<SQLUser> --password=<SQLUserPassword>
Parameters required for the command:
- --migrate - Migrate a Flow instance to the current version.
- --host - Server name of the SQL server where the Flow database resides.
- --database - Name of the Flow database to migrate.
- --user (Optional) - SQL user to use to connect to the database. (If not supplied, the command will use Windows integrated security and will use the account details of the user running the cmd prompt).
- --password (Optional)- SQL user password to use to connect to the database. (If not supplied, the command will use Windows integrated security and will use the account details of the user running the cmd prompt).
Best practise would be to perform a backup as part of the migration process. One can specify --migrate and --backup in the same action.
C:\Program Files\Flow Software\Flow\Config>start /wait "" "Flow Config" --backup --migrate --host=<SQLServerName> --database=<FlowDatabaseName> --user=<SQLUser> --password=<SQLUserPassword>
Execute commands against the CLI - Create
The create command will create a new Flow instance to the version of the installed Flow Config tool.
C:\Program Files\Flow Software\Flow\Config>start /wait "" "Flow Config" --create --host=<SQLServerName> --database=<FlowDatabaseName> --name=<YourFlowInstanceName> --user=<SQLUser> --password=<SQLUserPassword>
Parameters required for the command:
- --create- Create a new Flow instance.
- --host - Server name of the SQL server where the Flow database will reside.
- --database - Name of the Flow database to create.
- --name - Name of the Flow instance.
- --user (Optional) - SQL user to use to connect to the database. (If not supplied, the command will use Windows integrated security and will use the account details of the user running the cmd prompt).
- --password (Optional)- SQL user password to use to connect to the database. (If not supplied, the command will use Windows integrated security and will use the account details of the user running the cmd prompt).
- --timezone (Optional) -Specify the time zone to be used when creating a new Flow instance (defaults to local time zone)
- --culture (Optional) - Specify the culture to be used when creating a new Flow instance (defaults to local culture)
Execute commands against the CLI - Import
The import command will import a module (--file) or modules (--folder) into a Flow instance. Currently this support module imports only.
C:\Program Files\Flow Software\Flow\Config>start /wait "" "Flow Config" --import --host=<SQLServerName> --database=<FlowDatabaseName> --user=<SQLUser> --password=<SQLUserPassword> --file=<FileLocationOfModuleToImport>
Parameters required for the command:
- --import - Import a module (--file) or modules (--folder) into a Flow instance.
- --host - Server name of the SQL server where the Flow database will reside.
- --database - Name of the Flow database to create.
- --user (Optional) - SQL user to use to connect to the database. (If not supplied, the command will use Windows integrated security and will use the account details of the user running the cmd prompt).
- --password (Optional)- SQL user password to use to connect to the database. (If not supplied, the command will use Windows integrated security and will use the account details of the user running the cmd prompt).
- --file - Specify the path of a file to import.
- --folder - Specify the path of a folder to import.
Execute commands against the CLI - Backup
The backup command will create a backup of the specified Flow Database.
C:\Program Files\Flow Software\Flow\Config>start /wait "" "Flow Config" --backup --host=<SQLServerName> --database=<FlowDatabaseName> --user=<SQLUser> --password=<SQLUserPassword>
Parameters required for the command:
- --backup - Perform a backup of a Flow instance.
- --host - Server name of the SQL server where the Flow database resides.
- --database - Name of the Flow database to backup.
- --user (Optional) - SQL user to use to connect to the database. (If not supplied, the command will use Windows integrated security and will use the account details of the user running the cmd prompt).
- --password (Optional)- SQL user password to use to connect to the database. (If not supplied, the command will use Windows integrated security and will use the account details of the user running the cmd prompt).
The backup will be placed in the default location for SQL database backups.
NOTE: As of SQL Server 2022, the following command may be executed against the SQL server to return the default SQL database backup location: EXECUTE [master].dbo.xp_instance_regread N'HKEY_LOCAL_MACHINE', N'SOFTWARE\Microsoft\MSSQLServer\MSSQLServer', N'BackupDirectory'
Execute commands against the CLI - Licence
The license command will update the license key (--key) of a Flow instance.
C:\Program Files\Flow Software\Flow\Config>start /wait "" "Flow Config" --license --host=<SQLServerName> --database=<FlowDatabaseName> --user=<SQLUser> --password=<SQLUserPassword> --key=<NewKeyToUpdate>
Parameters required for the command:
- --backup - Perform a backup of a Flow instance.
- --host - Server name of the SQL server where the Flow database resides.
- --database - Name of the Flow database to backup.
- --user (Optional) - SQL user to use to connect to the database. (If not supplied, the command will use Windows integrated security and will use the account details of the user running the cmd prompt).
- --password (Optional)- SQL user password to use to connect to the database. (If not supplied, the command will use Windows integrated security and will use the account details of the user running the cmd prompt).
- --key - The new key string to update on the specified Flow instance.
CLI Response status
The CLI will respond with 3 types of responses, depending on the status of the commands executed. These will be:
- Success - Command competed with no errors.
- Configuration - A configuration issue id causing the command not to execute.
- Error - The actual command encountered an error during its execution.
One can also specify a logfile location using the --logfile parameter to log status steps to a file. It will automatically create a .txt file in the location specified.
An example of a successful response is shown below:
Not specifying a required parameter will result in a config error:
Errors during execution will result in an error: