This command allows to import a zip-archived file produced by Mica. The result of the import will be the creation or the update of the packaged documents and their attachments.
mica import-zip <CREDENTIALS> [EXTRA] PATH
A very useful usage of this command is when a series of associated documents should be imported together. For instance, this command permits to import an individual-study, its network and all its associated collected-datasets. Here is how the documents should be organized into sub-folders and archived such that the import command recognizes it as a valid input:
- study - individual-study-name - network-something.json - collected-dataset1.json - collected-dataset2.json - collected-dataset3.json - individual-study-name.json - attachments - attachment-id1 - attachment-id2
attachment-id is the ID used in the document attachments list in the JSON file, this should not be the filename.
Use this command with special care to prevent overriding existing documents and breaking associations.
||Path to the zip file or directory that contains zip files to be imported.|
||Add an access|
||Delete an access|
||Do not grant access to associated files|
||Subject name to which the access will be granted|
Authentication is done by username/password credentials.
||Mica server base url.|
||User name. User with appropriate permissions is expected depending of the REST resource requested.|
||Show the command help’s message|
Import the file import.zip in Mica server running on localhost with user administrator.
mica import-zip -mk https://localhost:8445 -u administrator -p password /path/to/the/file/import.zip
Import all the zip files located in a directory with user editor.
mica import-zip -mk https://localhost:8445 -u editor -p password /path/to/the/zips/directory