Commands for exporting/importing objects
You can export and import Compose objects using the export_csv and import_csv CLI
Compose CLI requires Administrator permission. To grant Administrator permission, select "Run as administrator" when opening the command prompt. All commands should be run from the Compose bin directory (C:\Program Files\Qlik\Compose with a default installation).
Exporting objects
Run the following command from the Compose bin directory:
Command syntax
ComposeCli.exe export_csv --project project_name --outfolder folder
Parameters
Parameter | Description |
---|---|
--project | The name of the project. |
--outfolder | The name of the target folder for the CSV files. |
Example
ComposeCli.exe export_csv --project myproject --outfolder c:\MyCFDWProject
Importing objects
As CSV files do not have versions, Compose cannot know which Compose version the CSV file being imported originated from. If the default behavior has changed between versions, the rule is that the default of the new version will always be applied. For example, in the Compose May 2021 version, the option to update the fact with changes to Type 2 data warehouse entities is now enabled by default. In previous versions, facts were not updated with changes to Type 2 data warehouse entities and there was no option to change this behavior. Therefore, continuing with our example, if you want this option to be disabled by default, you would need to add the column for that setting (Fact As Type 1) to the fact.csv file and set the value to "FALSE" before importing.
Before performing any import operations, it is strongly recommended to review the topic(s) that discuss CSV file structure and the impact of missing columns and/or values on the target environment. For example, before importing Data Marts, review the Migrating Data Marts topic.
Run the following command from the Compose bin directory:
Command syntax
ComposeCli.exe import_csv --project project_name [--infolder folder] [--scope model|mappings|datawarehouse|DatawarehouseTasks|datamarts] [–-filetype objecttype] [–-infile filename]
Parameters
Parameter | Description |
---|---|
--project | The name of the project. |
--infolder | The full path to the folder containing the CSV files. This parameter is only required if you want to import all files. |
--scope |
Use this parameter to allow non-privileged users to import specific objects. When this parameter is omitted, all objects will be imported. Possible values are:
Warning noteThe --scope parameter cannot be included in the same command as the --filetype parameter
|
--filetype |
The type of CSV file to import. When this parameter is omitted, all objects will be imported. Possible values are:
Warning noteThe --filetype parameter cannot be included in the same command as the --scope parameter
|
--infile |
The full path to the file to import when using non-default file names. This must be specified together with the --filetype parameter described above. |
Examples
Import all CSV files
ComposeCli.exe import_csv --project myproject --infolder c:\composecfdw_csv
Import a specific CSV file with a custom Name
ComposeCli.exe import_csv --project myproject --filetype AttributesDomain --infile c:\myattributesdomain.csv