Cloning a Octopus Space

Hi,
I am trying to clone a space in Octopus. I am running the command:

.\CloneSpaceProject.ps1 -SourceOctopusUrl "https://deploy.octopus" `
-SourceOctopusApiKey "API-***************" `
-SourceSpaceName "MySpace" `
-DestinationOctopusUrl "https://deploy.octopus" `
-DestinationOctopusApiKey "API-********************" `
-DestinationSpaceName "MyNewSpace" `    
-ProjectsToClone "all"

I am cloning a space in the same instance. I have created the new space called MyNewSpace. I am Space manager in both the space I want to clone and the new space I created. I have created new API Keys too and still getting error.

I am getting the following error:

Even when I try to clone a space into a different instance I see the same issue.
Scripts are from - GitHub - OctopusDeployLabs/SpaceCloner: A tool to clone/sync a space, project, and/or other items between different spaces in the same Octopus Deploy instances or spaces in different instances.

Is there something simple that I am doing wrong?

Kind Regards,
Micheal Power

Hi @mikepower79

Thanks for reaching out. Sorry to hear you’ve run into an issue with SpaceCloner. I’m not sure why this is happening, but I will investigate further.

I can see that you recently asked about Octopus Server 2021. Did you get a chance to upgrade? The reason I ask is that we introduced a new way of importing/exporting projects that may be a workaround to your issue. You can read more about that here.

Please let me know if the new import/export helps; otherwise, I’ll continue to investigate your SpaceCloner issue.

Regards,

Hi,
Thanks for your quick reply. No I put off upgrading to version 2021 so I am still on 2020.5.8 at the moment.
Sorry my mistake. I am now running:
CloneSpace.ps1 with extra commands like CloneScriptOptions added.
For example:

.\CloneSpace.ps1 -SourceOctopusUrl "https://octopus.local" 
-SourceOctopusApiKey "API-***************" 
-SourceSpaceName "MySpace" 
-DestinationOctopusUrl "https://octopus.local" 
-DestinationOctopusApiKey "API-****************" 
-DestinationSpaceName "MyNewSpace" 
-EnvironmentsToClone "all"
-WorkerPoolsToClone "all" 
-ProjectGroupsToClone "all"
-TenantTagsToClone "all"
-ExternalFeedsToClone "all"
-StepTemplatesToClone "all"
-InfrastructureAccountsToClone "all"
-LibraryVariableSetsToClone "all"
-LifeCyclesToClone "all"
-ProjectsToClone "all"

It looks like I have to follow the CloneScriptOptions in the script and I don’t see the error now and it clones everything I have selected as “all”

Kind Regards,
Micheal Power

Hi @mikepower79

Great to hear you’re not seeing the error now. Thanks for letting me know.

Regards,

Hi @stuart.mcilveen,
Quick question. Is it possible to clone a project to a different space. Is cross space cloning supported?

Kind Regards,
Micheal Power

Hi @mikepower79

Absolutely! Our Solutions team recently hosted a webinar where they demonstrated exporting and then importing a project to a different space. You can find the webinar recording at the bottom of the blog page, or jump straight into the demo section of the video here.

Regards,

Hi @stuart.mcilveen,
Is that only available on 2021 version?

Kind Regards,
Micheal Power

Hi @mikepower79

Apologies, I thought you were asking about the new import/export feature.

Yes, for SpaceCloner you can use this script to set SourceSpaceName and DestinationSpaceName.

Regards,

Hi @stuart.mcilveen,
Its good to know that new feature in 2021 with the Export/Import projects feature.
Thanks again for your help.

Kind Regards,
Micheal Power

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.