IO
CLI to import and export objects into and from a repository.
Import
Import objects from a CSV or cJSON file into the repository.
Parameters
- -s - Source file path or URL to import from.
- -d - cPath to destination folder or field. If not specified, objects will be imported into the System folder. If an object specifically defines the Folders property for any objects, that will be used instead of the destination (or root) folder.
- -t - Type. If the import source is a CSV file, this is the identifier of the content type to import the data as.
- -v - Display verbose output.
- -h - Display help.
- --allow_dups - Allow duplicates of the same object unique field values in the same destination folder with different UUIDs.
- --update_uuids - Update object UUIDs if matching objects exist in the same collection with a different UUID.
- --only_validate - Do not import. Instead, validate the COMAND JSON and output JSON with no comments.
Example - Import a Local File
php comand.php io_comand_io import -s file:///path/to/install/import.js
Export
Export objects from a repository to cJSON or CSV files.
To export to a local cJSON file based on a cQuery:
php comand.php io_comand_io export -q [:User] -f json