The CLI import command imports a package that includes applications and their associated blueprints and deployment profiles, external services, policies, artifact repositories, services, logical templates, and available custom tasks between different Application Services instances.

You can import packages created with the export command only. You cannot import a package that has been altered or created by any means other than the export command.

You must belong to the owning business group of every object in the import package to import the objects.

When you run the import-package command, you import the entire package to the targeted server. You cannot selectively import objects from the package.

You cannot import external services with the same name into different business groups, and you cannot import an external service as a dependency if it is owned by another business group.

  • Make sure the application that contained the deployment profile in the source appliance, is either a shared application or privately owned by the target group in the target appliance. Importing a deployment profile into a private application owned by any business group other than the target group is not supported.

  • Make sure the blueprint that was used when creating the deployment profile is not changed when importing, any slight change in the blueprint will not allow nodes and components to map and this use case is not supported.

You can import a deployment profile as a dependency of a shared application, or as a dependency of a private application owned by the target business group. Also ensure that the blueprint used when creating the deployment profile does not change during the import because the slightest change prevents nodes and components from mapping. Before you import a deployment profile, save the custom task you added to the execution deployment plan. See Review the Execution Plan and Add Custom Tasks.

For the import process to finish successfully, the objects in the package cannot include non-ASCII characters.

The import-package command

The CLI import-package command has the following format.

import-package --importFilePath pathname --targetGroup obgname --ConflictResolutionAction action

The following table describes the required components of the import-package command.

CLI Command Component

Description

import-package

The import-package command name.

--importFilePath pathname

Specifies the path name of the import package. For example, --importFilePath /home/dev/joomla.zip specifies the location and name of the joomla.zip import package.

--targetGroup busgroupname

Specifies the owning business group of the object to import. Policies are excluded. Anyone in the tenant can access a policy, so the owning business group is ignored.

--ConflictResolutionAction action

Specifies the CHECK, SKIP, OVERWRITE, or IMPORTASNEW conflict resolution action. An import-package command must specify one conflict resolution action.

The following table describes the conflict resolution actions to use when importing objects with an import package.

Conflict Resolution Action

Description

CHECK

Lists all objects in the import package and indicates whether an object exists on the target. Determines a match by comparing the object names and version identifiers. A version identifier has the form major.minor.micro.qualifier, for example, 2.0.1.beta.

SKIP

Copies the object from the package if the object does not exist on the target. Does not copy the object If the object exists on the target. A copied object belongs to the owning business group specified by --TargetGroup.

OVERWRITE

Overwrites the contents of an object with contents from the package if the object exists on the target. Copies an object that does not exist on the target to the owning business group specified by --TargetGroup. The logged-in user must belong to the owning business group of the objects in the package to import them.

IMPORTASNEW

Copies an object from the package to the target with a new name if the object exists on the target. The new object belongs to the owning business group specified by --TargetGroup. You must specifiy a suffix for the renamed object with the --suffix option.

The following table describes the command options available.

CLI Command Option

Description

--shared

Shares the new items in the package with the members of all business groups in the tenant. If omitted, makes the new items in the package private to the members of the owning business group.

--suffix sfxtext

Adds an underscore and the specified text represented by sfxtext to the end of every object copied from the package as a match. For example, if you specify --suffix NEW and copy apache:1.0.0 from the package, the new name of the object is apache _NEW with version 1.0.0. The owning business group for the new object is the target group specified by --targetGroup.

SKIP and OVERWRITE

import-package --importFilePath /home/dev/dukes.zip --conflictResolutionAction SKIP --targetGroup Development
import-package --importFilePath /home/dev/dukes.zip --conflictResolutionAction OVERWRITE --targetGroup Development