Copy Or Clone A Solution To Another Organization

Use the cloneAsync method to copy a Solution from one Organization to another. This is very useful when you have created standard Solutions that just need minor updates to implement them in another Organization.

Note: If you enable the byReference parameter in the cloneAsync method, the source and target Solutions share resources, such as Maps, and neither Solution can be edited. Enabling the byReference parameter improves performance when copying Solutions. For additional information, see Copy Or Clone A Solution Using Shared Resources.

This process assumes:

  • The Solution that you are copying is complete, runnable, and all Maps are complete and valid.
  • You want the most recent revision of each Map in the Solution.
  • You are a User in the source Organization and the target Organization.
  • The target Organization includes an installed and working Agent that is compatible with the source Solution, and all Connectors used by the Solution are installed and working.
  • The target Organization includes all the Connections used in the Solution, and those Connections are tested and working. The Name and Alias properties of these Connections must match the Name and Alias of the Connections that the source Solution uses.

Before you perform this task, you must have the following information:

  • Target Organization ID — Call the GET orgs method.
  • Target Agent ID — Call the GET agents method.

To copy and enable a Solution:

  1. Call the GET solutions method to find the source Solution ID.
  2. Call the POST cloneAsync solutions method to create the Solution in the target Organization.
  3. Call the GET cloneAsync status method with the ID returned by the previous command. Note that this is not the clonedSolutionId.
  4. Repeat the GET cloneAsync status method every 15 to 30 seconds until the isComplete property that is returned is set to true. If the hasError property that is returned is set to true, the error is shown in the message field.

    All subsequent calls should be made using the target Organization ID.

  5. To make custom changes to the Solution for this particular Organization:
    1. Call the GET solutions method, passing in the ID returned by the previous POST, to get the ID of the Map you wish to edit.
    2. Call the GET maps method, to get the JSON model for the Map you wish to edit.
    3. Edit the JSON model with any changes that are specific to this target Organization.
    4. Pass the modified model into the PUT advanced maps method to update the Map.
  6. Call the POST prepare solution method.

    This is a lengthy process that gathers all the Connections used in the Solution, gathers all the metadata that the Solution requires, and tries to compile each Map. This requires that the Agent and any Connections that the Solution uses are up, available, and valid. Because this is an asynchronous process, the method returns information that includes an ID that you can use to query the results of the POST prepare solution method.

  7. After 15 to 30 seconds, call the GET prepare solution method with the ID returned in the previous step.
  8. Repeat the GET prepare solution method every 15 to 30 seconds until the iscomplete property that is returned is set to true.

    When the haserror property that is returned is set to false, the Solution is ready to run. If there is an error, it is shown in the message field.

See

How Do I...