CLI Migration Guide
This migration guide is to assist users in migrating the old Konect tools KDExport and KDImport to the new Konect CLI. Most parameter names in the new CLI remain the same as those used in the old tools with most changes being syntactical in nature.
The previous Konect CLI used an older style of command line syntax, which has been modernised. The main differences between the new and the old styles are:
The new CLI uses a command structure where the first argument must be the CLI command (csvimport, shpexport, etc.).
Parameter names now start with a double hyphen unless there is an abbreviated version of the parameter
Parameter names and values are now separated by a space rather then the equals symbol
Parameter values that contain a list of values are now delimited by spaces rather than commas.
Flag parameters do not require a value for example flag_name=false is now just flag_name.
Shared parameters
The following shared parameters of KDExport and KDImport should be updated to use the new syntax
Old | New | Example value | Description |
---|---|---|---|
-user -pwd | -k, --key | --key XXXXXXXX | The username and password parameters are replaced with the key parameter which requires a valid API Key created from the Konect portal. |
-pin | -e, --env | --env "My Envionment" | The environment pin has been replaced with the environment name |
-dataset | -d, --dataset |
| Add a hyphen |
-file | -f, --file |
| Add a hyphen |
-proxyhost | --proxyhost |
| Add a hyphen |
-proxyport | --proxyport |
| Add a hyphen |
-proxyuser | --proxyuser |
| Add a hyphen |
-proxypwd | --proxypwd |
| Add a hyphen |
KDExport parameters
The following parameters of KDExport should be updated to use the new syntax
Old | New | Example value | Description |
---|---|---|---|
-format |
| csvexport | The format parameter has been retired. The CLI command is now used |
-photots | --photos | --photos | The photos parameter is now a flag so has no value |
-excludephotofooter | --excludephotofooter | --excludephotofooter | The exclude photo footer parameter is now a flag so has no value |
-listvalue | --listvalue | --listvalue both | The possible values for --listvalue are unchanged, just include an extra hyphen |
-fields | --fields | --fields field1 field2 "field 3" | The list of fields is now delimitated by spaces instead of commas |
-sysfields | --excludesysfields | --excludesysfields | The -sysfields parameter has been renamed to --excludesysfields and is now a flag so has no value |
-history | --history | --history | The history parameter is now a flag so has no value |
KDImport parameters
The following parameters of KDImport should be updated to use the new syntax
Old | New | Example value | Description |
---|---|---|---|
-action | --action | --action append | Some of the old action values have been retired. Please see the KDImport action parameter table for more details. |
-ufid | --ufid | --ufid fid | Add a hyphen |
-fields | --fields | --fields field1 field2 "field 3" | The list of fields is now delimitated by spaces instead of commas |
-longlat | --longitudefieldname --latitudefieldname | --longitudefieldname x --latitudefieldname y | The -longlat parameter has been replaced by the parameters --longitudefieldname and --latitudefieldname. |
-parentlink | --parentlink |
| Add a hyphen |
KDImport action parameter values
The following action parameter values of KDImport should be updated
Old | New | Description |
---|---|---|
new | new | Same |
replace
|
| The old replace action has been retired. This action would fail if the dataset had children datasets. |
replace-force | replace | The replace-force action has been renamed to replace. |
append | append | Same |
append_using_ufid |
| The append_using_ufid action has been retired. Using the append action with the --ufid pararmeter is the same as using the old action. |
append_update | append_update | Same |
update_matching | update_matching | Same |
update_nominated | update_nominated | Same |