It is not recommended, but we have seen companies split their projects across multiple Octopus Deploy instances, one for dev/test and another for staging/production. Keeping the processes in sync between the instances can be a massive pain. That also means the targets, workers, and connection strings are very different.
In other cases, there are two Octopus Deploy instances; they are mirror images of one another, except they deploy to different data centers. Just like with Dev/Test and Staging/Prod split, that means the targets, workers, and connection strings are very different.
These are the use cases the space cloner was designed for. However, it wasn't designed to determine all project dependencies (environments, variable sets, lifecycles, etc).
Please refer to the how it works page to get a full list of items cloned and not cloned.
The process does not attempt to walk a tree of dependencies. It loads up all the necessary data from the source and destination. When it comes across an ID in the source space, it will attempt to find the corresponding ID in the destination space. If it cannot find a matching item, it removes that binding.
For the initial clone, I would leverage the Project Export/Import Feature this copy everything (including sensitive variables) over to another instance.
This should be done once; after that, the space cloner should be used or subsequent projects and changes.
This example will clone a specific project, but it will exclude all environments, accounts, external feeds, tenants, and lifecycles, as those differences will likely be differences between the two instances.
Please refer to the Parameter reference page for more details on the parameters.
The other options are:
OverwriteExistingVariables
- set tofalse
to keep the differences preserved. Any new variable found will be added.OverwriteExistingCustomStepTemplates
- Set toTrue
so the step templates are kept in sync. You might have made some recent changes to the step template. It is important to keep them up to date.OverwriteExistingLifecyclesPhases
- Set toNeverCloneLifecyclePhases
as the two instances will have different phases.CloneProjectChannelRules
- set totrue
as you'll want to include the channel rules with the project.CloneTeamUserRoleScoping
- set totrue
as you'll want to include all the scoped permissions with the teams.CloneProjectVersioningReleaseCreationSettings
- set tofalse
as you'll want to exclude the release creation settings.CloneProjectDeploymentProcess
- set totrue
as you'll want to include the project deployment process.CloneProjectRunbooks
- set totrue
as you'll want to include the project runbooks.CloneTenantVariables
- set totrue
as you'll want to include the tenant variables.CloneProjectLogos
- set totrue
as you'll want to copy over the project logo.CloneTenantLogos
- set totrue
as you'll want to copy over the tenant logos.
The scoping options are:
ProcessEnvironmentScopingMatch
- set toIgnoreMismatchOnNewLeaveExistingAlone
in case you might have steps scoped toDev
orTest
ProcessChannelScopingMatch
- set toIgnoreMismatchOnNewLeaveExistingAlone
because you might have similar channels but not an exact 1:1 matchProcessTenantTagsScopingMatch
- set toSkipUnlessExactMatch
because the tenant tags should be cloned over as isVariableChannelScopingMatch
- set toIgnoreMismatchOnNewLeaveExistingAlone
because you might have similar channels but not an exact 1:1 matchVariableEnvironmentScopingMatch
- set toIgnoreMismatchOnNewLeaveExistingAlone
in case you might have steps scoped toDev
orTest
VariableProcessOwnerScopingMatch
- set toSkipUnlessPartialMatch
because you might have runbooks in your source instance not in the destination instancesVariableActionScopingMatch
- set toSkipUnlessPartialMatch
because you might have deployment process steps in your source instance not in the destination instancesVariableMachineScopingMatch
- set toSkipUnlessExactMatch
because will no machines will be shared between the two instancesVariableAccountScopingMatch
- set toSkipUnlessExactMatch
because you might have different accounts in your source or destinationVariableCertificateScopingMatch
- set toSkipUnlessExactMatch
because you might have different certificates in your source or destinationVariableTenantTagsScopingMatch
- set toSkipUnlessExactMatch
because you might have different tenant tags in your source or destinationInfrastructureEnvironmentScopingMatch
- set toIgnoreMismatchOnNewLeaveExistingAlone
in case you might have steps scoped toDev
orTest
InfrastructureTenantScopingMatch
- set toSkipUnlessPartialMatch
because you might have similar tenants but not an exact 1:1 matchInfrastructureTenantTagsScopingMatch
- set toSkipUnlessExactMatch
because the tenant tags should be cloned over as is
Deployment Process Option:
ProcessCloningOption
- Leave it as the defaultKeepAdditionalDestinationSteps
unless you plan on having no differences between the instances and you want the source instance to be your truth center. If the source instance is the truth center then set it toSourceOnly
.
CloneSpace.ps1 -SourceOctopusUrl "https://instance1.yoursite.com" `
-SourceOctopusApiKey "SOME KEY" `
-SourceSpaceName "My Space Name" `
-DestinationOctopusUrl "https://instance2.yoursite.com" `
-DestinationOctopusApiKey "My Key" `
-DestinationSpace Name "My Space Name" `
-WorkerPoolsToClone "AWS*" `
-ProjectGroupsToClone "all" `
-TenantTagsToClone "all" `
-StepTemplatesToClone "all" `
-ScriptModulesToClone "all" `
-MachinePoliciesToClone "all" `
-SpaceTeamsToClone "all" `
-LibraryVariableSetsToClone "AWS*,Global,Notification,SQL Server" `
-ProjectsToClone "Redgate - Feature Branch Example" `
-PackagesToClone "Redgate.*" `
-CertificatesToClone "MyCert::CertPassword,OtherCertName::OtherCertPassword" `
-OverwriteExistingVariables "false" `
-OverwriteExistingCustomStepTemplates "true" `
-OverwriteExistingLifecyclesPhases "false" `
-CloneProjectChannelRules "true" `
-CloneTeamUserRoleScoping "true" `
-CloneProjectVersioningReleaseCreationSettings "true" `
-CloneProjectRunbooks "true" `
-CloneProjectLogos "true" `
-CloneTenantVariables "true" `
-CloneTenantLogos "true" `
-CloneProjectDeploymentProcess "true"
-ProcessEnvironmentScopingMatch "SkipUnlessExactMatch" `
-ProcessChannelScopingMatch "SkipUnlessPartialMatch" `
-VariableChannelScopingMatch "SkipUnlessPartialMatch" `
-VariableEnvironmentScopingMatch "SkipUnlessExactMatch" `
-VariableProcessOwnerScopingMatch "SkipUnlessPartialMatch" `
-VariableActionScopingMatch "SkipUnlessPartialMatch" `
-VariableMachineScopingMatch "SkipUnlessExactMatch" `
-VariableAccountScopingMatch "SkipUnlessExactMatch" `
-VariableCertificateScopingMatch "SkipUnlessExactMatch" `
-InfrastructureEnvironmentScopingMatch "SkipUnlessExactMatch" `
-InfrastructureTenantScopingMatch "SkipUnlessPartialMatch" `
-ProcessCloningOption "KeepAdditionalDestinationSteps" `
This example will clone a specific project between a mirrored instance.
Please refer to the Parameter reference page for more details on the parameters.
The other options are:
OverwriteExistingVariables
- set tofalse
to keep the differences preserved. Any new variable found will be added.OverwriteExistingCustomStepTemplates
- Set toTrue
so the step templates are kept in sync. You might have made some recent changes to the step template. It is important to keep them up to date.OverwriteExistingLifecyclesPhases
- Set tofalse
as the two instances will have different phases.CloneProjectChannelRules
- set totrue
as you'll want to include the channel rules with the project.CloneTeamUserRoleScoping
- set totrue
as you'll want to include all the scoped permissions with the teams.CloneProjectVersioningReleaseCreationSettings
- set totrue
as you'll want to include the release creation settings.CloneProjectDeploymentProcess
- set totrue
as you'll want to include the project deployment process.CloneProjectRunbooks
- set totrue
as you'll want to include the project runbooks.CloneTenantVariables
- set totrue
as you'll want to include the tenant variables.CloneProjectLogos
- set totrue
as you'll want to copy over the project logo.CloneTenantLogos
- set totrue
as you'll want to copy over the tenant logos.
The scoping options are:
ProcessEnvironmentScopingMatch
- set toSkipUnlessExactMatch
ProcessChannelScopingMatch
- set toSkipUnlessExactMatch
ProcessTenantTagsScopingMatch
- set toSkipUnlessExactMatch
VariableChannelScopingMatch
- set toSkipUnlessExactMatch
VariableEnvironmentScopingMatch
- set toSkipUnlessExactMatch
VariableProcessOwnerScopingMatch
- set toSkipUnlessExactMatch
VariableActionScopingMatch
- set toSkipUnlessExactMatch
VariableMachineScopingMatch
- set toSkipUnlessExactMatch
VariableAccountScopingMatch
- set toSkipUnlessExactMatch
VariableCertificateScopingMatch
- set toSkipUnlessExactMatch
VariableTenantTagsScopingMatch
- set toSkipUnlessExactMatch
InfrastructureEnvironmentScopingMatch
- set toSkipUnlessExactMatch
InfrastructureTenantScopingMatch
- set toSkipUnlessExactMatch
InfrastructureTenantTagsScopingMatch
- set toSkipUnlessExactMatch
Deployment Process Option:
ProcessCloningOption
- Set it toSourceOnly
as the instances are a 1:1 mirror.
CloneSpace.ps1 -SourceOctopusUrl "https://instance1.yoursite.com" `
-SourceOctopusApiKey "SOME KEY" `
-SourceSpaceName "My Space Name" `
-DestinationOctopusUrl "https://instance2.yoursite.com" `
-DestinationOctopusApiKey "My Key" `
-DestinationSpaceName "My Space Name" `
-EnvironmentsToClone "all" `
-WorkerPoolsToClone "all" `
-ProjectGroupsToClone "all" `
-TenantTagsToClone "all" `
-ExternalFeedsToClone "all" `
-StepTemplatesToClone "all" `
-InfrastructureAccountsToClone "all" `
-MachinePoliciesToClone "all" `
-LibraryVariableSetsToClone "AWS*,Global,Notification,SQL Server" `
-LifeCyclesToClone "all" `
-ProjectsToClone "Redgate - Feature Branch Example" `
-TenantsToClone "all" `
-SpaceTeamsToClone "all" `
-PackagesToClone "Redgate.*" `
-CertificatesToClone "MyCert::CertPassword,OtherCertName::OtherCertPassword" `
-OverwriteExistingVariables "false" `
-OverwriteExistingCustomStepTemplates "true" `
-OverwriteExistingLifecyclesPhases "true" `
-CloneProjectChannelRules "true" `
-CloneTeamUserRoleScoping "true" `
-CloneProjectRunbooks "true" `
-CloneProjectLogos "true" `
-CloneTenantVariables "true" `
-CloneTenantLogos "true" `
-CloneProjectDeploymentProcess "true"
-ProcessEnvironmentScopingMatch "SkipUnlessExactMatch" `
-ProcessChannelScopingMatch "SkipUnlessExactMatch" `
-ProcessTenantTagsScopingMatch "SkipUnlessExactMatch" `
-VariableChannelScopingMatch "SkipUnlessExactMatch" `
-VariableEnvironmentScopingMatch "SkipUnlessExactMatch" `
-VariableProcessOwnerScopingMatch "SkipUnlessExactMatch" `
-VariableActionScopingMatch "SkipUnlessExactMatch" `
-VariableMachineScopingMatch "SkipUnlessExactMatch" `
-VariableAccountScopingMatch "SkipUnlessExactMatch" `
-VariableCertificateScopingMatch "SkipUnlessExactMatch" `
-VariableTenantTagsScopingMatch "SkipUnlessExactMatch" `
-InfrastructureEnvironmentScopingMatch "SkipUnlessExactMatch" `
-InfrastructureTenantScopingMatch "SkipUnlessExactMatch" `
-InfrastructureTenantTagsScopingMatch "SkipUnlessExactMatch" `
-ProcessCloningOption "SourceOnly" `
This example will clone a specific project between with a separate production-only instance.
Please refer to the Parameter reference page for more details on the parameters.
The other options are:
OverwriteExistingVariables
- set tofalse
to keep the differences preserved. Any new variable found will be added.OverwriteExistingCustomStepTemplates
- Set toTrue
so the step templates are kept in sync. You might have made some recent changes to the step template. It is important to keep them up to date.OverwriteExistingLifecyclesPhases
- Set toNeverCloneLifecyclePhases
as the two instances will have different phases.CloneProjectChannelRules
- set totrue
as you'll want to include the channel rules with the project.CloneTeamUserRoleScoping
- set totrue
as you'll want to include all the scoped permissions with the teams.CloneProjectVersioningReleaseCreationSettings
- set totrue
as you'll want to include the release creation settings.CloneProjectDeploymentProcess
- set totrue
as you'll want to include the project deployment process.CloneProjectRunbooks
- set totrue
as you'll want to include the project runbooks.CloneTenantVariables
- set totrue
as you'll want to include the tenant variables.CloneProjectLogos
- set totrue
as you'll want to copy over the project logo.CloneTenantLogos
- set totrue
as you'll want to copy over the tenant logos.
The scoping options are:
ProcessEnvironmentScopingMatch
- set toSkipUnlessPartialMatch
ProcessChannelScopingMatch
- set toSkipUnlessPartialMatch
ProcessTenantScopingMatch
- set toSkipUnlessExactMatch
VariableChannelScopingMatch
- set toSkipUnlessExactMatch
VariableEnvironmentScopingMatch
- set toSkipUnlessPartialMatch
VariableProcessOwnerScopingMatch
- set toSkipUnlessPartialMatch
VariableActionScopingMatch
- set toSkipUnlessPartialMatch
VariableMachineScopingMatch
- set toSkipUnlessExactMatch
VariableAccountScopingMatch
- set toSkipUnlessExactMatch
VariableCertificateScopingMatch
- set toSkipUnlessExactMatch
VariableTenantScopingMatch
- set toSkipUnlessExactMatch
InfrastructureEnvironmentScopingMatch
- set toSkipUnlessPartialMatch
InfrastructureTenantScopingMatch
- set toSkipUnlessExactMatch
Deployment Process Option:
ProcessCloningOption
- Set it toSourceOnly
as the instances are a 1:1 mirror.
CloneSpace.ps1 -SourceOctopusUrl "https://instance1.yoursite.com" `
-SourceOctopusApiKey "SOME KEY" `
-SourceSpaceName "My Space Name" `
-DestinationOctopusUrl "https://instance2.yoursite.com" `
-DestinationOctopusApiKey "My Key" `
-DestinationSpaceName "My Space Name" `
-EnvironmentsToClone "all" `
-WorkerPoolsToClone "all" `
-ProjectGroupsToClone "all" `
-TenantTagsToClone "all" `
-ExternalFeedsToClone "all" `
-StepTemplatesToClone "all" `
-InfrastructureAccountsToClone "all" `
-MachinePoliciesToClone "all" `
-LibraryVariableSetsToClone "AWS*,Global,Notification,SQL Server" `
-LifeCyclesToClone "all" `
-ProjectsToClone "Redgate - Feature Branch Example" `
-TenantsToClone "all" `
-SpaceTeamsToClone "all" `
-PackagesToClone "Redgate.*" `
-CertificatesToClone "MyCert::CertPassword,OtherCertName::OtherCertPassword" `
-OverwriteExistingVariables "false" `
-OverwriteExistingCustomStepTemplates "true" `
-OverwriteExistingLifecyclesPhases "true" `
-CloneProjectChannelRules "true" `
-CloneTeamUserRoleScoping "true" `
-CloneProjectRunbooks "true" `
-CloneProjectLogos "true" `
-CloneTenantVariables "true" `
-CloneTenantLogos "true" `
-CloneProjectDeploymentProcess "true"
-ProcessEnvironmentScopingMatch "SkipUnlessPartialMatch" `
-ProcessChannelScopingMatch "SkipUnlessPartialMatch" `
-ProcessTenantTagsScopingMatch "SkipUnlessExactMatch" `
-VariableChannelScopingMatch "SkipUnlessPartialMatch" `
-VariableEnvironmentScopingMatch "SkipUnlessPartialMatch" `
-VariableProcessOwnerScopingMatch "SkipUnlessPartialMatch" `
-VariableActionScopingMatch "SkipUnlessPartialMatch" `
-VariableMachineScopingMatch "SkipUnlessExactMatch" `
-VariableAccountScopingMatch "SkipUnlessExactMatch" `
-VariableCertificateScopingMatch "SkipUnlessExactMatch" `
-VariablesTenantTagsScopingMatch "SkipUnlessExactMatch" `
-InfrastructureEnvironmentScopingMatch "SkipUnlessPartialMatch" `
-InfrastructureTenantScopingMatch "SkipUnlessPartialMatch" `
-InfrastructureTenantTagsScopingMatch "SkipUnlessExactMatch" `
-ProcessCloningOption "SourceOnly" `