ImportRt
Schedules an import job for runtime files. File is specified using -f argument. To wait for job, use -w argument.
Examples
Basic usage:
octo-cli -c ImportRt `
-f "./runtime-data.json" `
-w `
-r
Options
| Short | Long | Required | Description |
|---|---|---|---|
-f | --file | yes | File to import |
-r | --replace | no | When defined, existing entities are replaced (upsert). Without it entities are only inserted: an entity that exists only as an archived (deleted) document with the same rtId is replaced and active again, an active one fails. |
-w | --wait | no | Wait for a import job to complete |
Notes
Replaced create
An import cannot create an entity of a type whose static CK method declares replacesGenericCreate (or of a type derived from it): only the method may create it, exactly as the generic create of the API is refused. If the file contains a new entity of such a type, the whole import fails before anything is written with message 137 (reason GENERIC_CREATE_REPLACED_BY_METHOD), which names the type, the method and the rtId of every refused entity. This applies with and without -r.
Entities whose rtId already exists in the tenant are updated as before (with -r). Files and tenants without such types behave as before. To bring such entities into a tenant, restore a backup of the tenant or create them by calling the method.
Hidden and MethodOnly attributes
An import cannot set an attribute whose CK assignment declares access: Hidden or access: MethodOnly (also as a member of a record): only a CK method may write it. If the file contains such a value, the whole import fails before anything is written with message 139, which names the type, the attribute path and the rtId of every refused value. ReadOnly attributes can be imported. This applies with and without -r, to YAML and JSON files. See Export and import.
Users
Since System.Identity 2.28.0 an import cannot create or update users (System.Identity/User): UserName and Email are MethodOnly, so a file that contains a user fails as a whole with message 139. An export still contains the users (without password and two-factor material); leave them out of the export or remove them from the file. To copy a tenant with its users, restore a dump of the tenant; to move single users, create them again with CreateUser. See Moving Users to Another Tenant.