Transfer

Cloud CMS supports transfer (import and export) for all data stores and objects.

Transfer allows you to export your data into Archives. An Archive is a ZIP file which contains a manifest file that fully describes the contents of the ZIP. Archives are automatically stored within Vaults.

Transfer lets you import existing archives into new data stores. This lets you quickly restore the state of previous projects or reuse previous projects within new endeavors.

You can download archives at any time for offline storage and backup.

Dependencies

Coming Soon

Publication vs. Replication

Coming Soon

Export an Archive

To export an archive, all you need to do is provide the target vault and the archive identification properties. These archive identification properties are groupId, artifactId and versionId.

Here is an example where we perform a full export of a domain.

// assume we have a domain
var domain = ...;

// assume the target vault where the archive will get placed
var vault = ...;

// export archive
domain.exportArchive({
    "vault": vault.getId(),
    "group": "org.example",
    "artifact": "my-domain",
    "version": "1.0"
});

By default, the export runs as a SYNCHRONOUS job. If you want to run the job in the background, you can do that as well. Take a look:

// assume we have a domain
var domain = ...;

// assume the target vault where the archive will get placed
var vault = ...;

// export archive
domain.exportArchive({
    "vault": vault.getId(),
    "group": "org.example",
    "artifact": "my-domain",
    "version": "1.0",
    "async": true
});

Here is an example of some code that exports synchronously and then grabs the archive from the vault.

// assume we have a domain
var domain = ...;

// assume the target vault where the archive will get placed
var vault = ...;

// export archive
domain.exportArchive({
    "vault": vault.getId(),
    "group": "org.example",
    "artifact": "my-domain",
    "version": "1.0",
    "async": false
}).then(function() {

    // this == export job

    var groupId = this.get("archiveGroupId");
    var artifactId = this.get("archiveArtifactId");
    var versionId = this.get("archiveVersionId");

    this.subchain(vault).lookupArchive(groupId, artifactId, versionId).then(function() {
        console.log("Successfully located the archive!");
    });
});

Export Configuration

You can pass in export configuration settings to tweak and control the export process. The full set of options is provided here:

Property Type Default Read-Only Description
startDate timestamp The starting date for the modification date of any resources to be included.
endDate timestamp The ending date for the modification date of any resources to be included.
startChangeset text The starting changeset id to include for any resources to be included.
This property applies only to branches.
endChangeset text The ending date for the modification date of any resources to be included.
This property applies only to branches.
payload text Read-Only Indicates whether the archive is a REPLICATION or a PUBLICATION.
includeACLs boolean true Whether to include ACLs during export.
includeTeams boolean true Whether to include Teams during export.
includeActivities boolean true Whether to include Activities during export.
includeBinaries boolean true Whether to include Binaries for data stores during export.
includeAttachments boolean true Whether to include Attachments for Attachables during export.

Export Job

An export produces an export job that either runs on a SYNCHRONOUS or ASYNCHRONOUS schedule. If it runs synchronously, then the export will complete before control is handed back to your code. If it runs asynchronously, then you will have wait for the job to complete. Meanwhile, you're free to do other things.

The Export Job contains a few properties which are interesting:

Property Type Description
archiveGroup text The group id of the archive.
archiveArtifact text The artifact id of the archive.
archiveVersion text The version id of the archive.
vaultId text The vault id of the archive.
configuration object The export configuration settings being utilized by the job.
sources array An array of objects which describe the source data stores or objects being exported.

Import an Archive

You can import any archive from any vault that you have access to. An archive can either be imported into an existing object or it can be imported into a container.

  • When importing into an existing object, you can specify whether you want to overwrite. If you elect to overwrite, the original object will be destroyed before it is imported again. If you do not overwrite, the new object will be merged with the old.
  • When imported into a container, you can specify whether you want to preserve IDs. If you elect to preserve IDs, the imports will keep their IDs and write into the container. If collisions then occur, the overwrite flag determines whether the colliding objects are overwritten or merged.

    Other the other hand, if you set do not elect to preserve IDs, the imports will take on new IDs and you will essentially create brand new copies.

Here is an example of a simple import:

// TODO

By default, the import runs as a SYNCHRONOUS job. If you want to run the job in the background, you can do that as well. Let's lay it down:

// TODO

Once the job completes, the properties of the job can be used to find out what was imported. Here is an example where we import a domain and then look to the job to tell us what was created.

// TODO

Import Configuration

You can pass in import configuration settings to tweak and control the import process. The full set of options is provided here:

Property Type Default Read-Only Description
overwrite boolean false Whether to overwrite any collisions.
preserveIds boolean true Whether to preserve the IDs of any collisions.
includeACLs boolean true Whether to include ACLs during import.
includeTeams boolean true Whether to include Teams during import.
includeActivities boolean true Whether to include Activities during import.
includeBinaries boolean true Whether to include Binaries for data stores during import.
includeAttachments boolean true Whether to include Attachments for Attachables during import.

Import Job

An import produces an import job that either runs on a SYNCHRONOUS or ASYNCHRONOUS schedule. If it runs synchronously, then the import will complete before control is handed back to your code. If it runs asynchronously, then you will have wait for the job to complete. Meanwhile, you're free to do other things.

The Import Job contains a few properties which are interesting:

Property Type Description
archiveGroup text The group id of the archive.
archiveArtifact text The artifact id of the archive.
archiveVersion text The version id of the archive.
vaultId text The vault id of the archive.
configuration object The import configuration settings being utilized by the job.
targets array An array of objects which describe the target data stores or objects that the job is importing into.
imports array An array of objects which describe the newly created or updated data stores or objects that are a result or product of the import process.