Hey @magr,
I managed to get this to work by doing the export:
Octopus.Migrator.exe partial-export --instance=OctopusServer --project=Bug --password=password --directory=C:\Project
This put just the project export files into C:\Project (the folders you can see in my previous comment).
I then did an import using the Octopus.Migrator.exe through command prompt:
Octopus.Migrator.exe import --instance=OctopusServer --password=password --overwrite --directory=C:\Project
To be sure this worked I changed one of the JSON files in my Bug project in C:\Project- I added a word into a ‘Run a Script’ step. Once I ran the import the project changed to the new value in the UI.
I can see there being quite a few issues for you using this tool to be honest, if I zip all those folders together (which is how I imagine you will have your project after going through the build server) and try and import that using the same import command I get the error:
Directory does not contain an Octopus export
Octopus.Shared.ControlledFailureException: Directory does not contain an Octopus export
So the migrator tool only supports importing specific JSON files exactly as they were exported. It will also import everything in that folder, you cannot specify to import just one project, that could get very messy.
Unfortunately I do think the best way to do this is to create a Service Account in Octopus (with just the space manager permissions) for you to run the API calls from and use our import / export feature. That way is supported (the Octopus.Migrator tools is not so will not receive bug updates) and you have more control of what you are exporting and importing.
We have an API script you can use here to export the project. We also have a specific one for just importing the project here.
I know you wanted to shy away from giving a user Space Manager permissions but if it is just a service account only a handful of Admins can access (for looking into faults etc) then its not a big risk to give that account Space Managers. It is a greater risk trying to use the import feature from the Migrator tool as it doesn’t seem to drill down enough so you can specify exactly what to import.
I am sorry this is not the news you wanted to hear but there are no other options for us to try.
Let me know what you decide,
Kind Regards,
Clare