Import Zip
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
Note
attachment-id is the ID used in the document attachments list in the JSON file, this should not be the filename.
Warning
Use this command with special care to prevent overriding existing documents and breaking associations.
Arguments
Argument |
Description |
---|---|
|
Path to the zip file or directory that contains zip files to be imported. |
Options
Option |
Description |
---|---|
|
Add an access |
|
Delete an access |
|
Do not grant access to associated files |
|
Subject name to which the access will be granted |
|
Subject type: |
Credentials
Authentication is done by username/password credentials.
Option |
Description |
---|---|
|
Mica server base url. |
|
User name. User with appropriate permissions is expected depending of the REST resource requested. |
|
User password. |
Extras
Option |
Description |
---|---|
|
Show the command help’s message |
|
Verbose output |
Example
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