Resolution
Note: We do not recommend exporting projects as a form of backup. We recommend backing up the database directly, or cloning the project if you wish to keep a backup of it for use in Octopus.
Octopus does not directly support exporting projects from a lower version and then importing them into a higher version of Octopus Server. If you are attempting to export a project and import it to another Octopus instance of a higher version you are likely to come across issues in the import. Between the versions there is likely uplift in backend processes, or additional data that is added to the JSON of the project. This will cause errors when attempting the project import.
The recommend solution is to use a test instance of Octopus Server that is on the same version as your older export, then upgrade this to match the version of Octopus Server you are attempting to import into. This will ensure any new data is added to the project itself, and should result in fewer issues when trying to import it onto the target server. While this is a time consuming solution, it is the only official recommendation we can give for importing older projects into new Octopus Server versions.
Symptom
There are numerous errors that can occur when exporting/importing projects between differing Octopus Server versions. Some examples are below.
Error processing Channel Ids Channels-<ID>, this could be because the project hasn't processed them before another document has tried to get the references.
Id Channels-<ID> was not in cache for type Octopus.Core.Models.Projects.SpaceChannel. This error can occur if you are calling GetImportedDocuments rather than ImportDocuments on a document source.
Reference path: Project 'test project' => Release 'x.x.x'
Value cannot be null. (Parameter 'source').
Object reference not set to an instance of an object.
Reference path: Project 'test project'
Scope: when this is the right article
You are attempting to export a project from one Octopus Server instance to another, and the version of the target Octopus Server is higher.
Cause
The issue is the potential backend and data changes between Octopus Server versions. A project on an older version of Octopus Server will have different data layouts and parameter names compared to an newer version of Octopus Server. This can result in issues between exported channels, releases, variables, etc.
Diagnosis and fix
- Create a test instance of Octopus Server using the same version that the project was first exported from.
- You can check the Octopus Database table
OctopusServerInstallationHistoryto find the versions that were installed at certain times if you are uncertain which version the project was on. - Import the older exported project into the test instance.
- Upgrade the test instance to the same version as the target Octopus Server.
- Export the project from the test instance.
- Import the project into the target instance.
Verify
The import task on the target instance should give a success when it has successfully imported correctly. The project should now be accessible in the target Octopus Server instance.