Can I restore the Octopus database from Production to Test?

I’m in the process of testing the upgrade of Octopus from a 3.x to 4.x/2018.x and so far so good. The one snag I’ve got is there is no clear way to copy a project in Production to Test (with all the processes and variables).

1- Is there a way to copy/export/import a project from one instance of Octopus to another?
2 - If I back up the Production database and restore it in Test, can I use it? Will the encryption key be an issue since they are two distinct instances?

Thanks!
Mike Lee

Hi Michael,

Thanks for getting in touch,

I’ve replied to each of your queries below; I appreciate your detailed explanation, this really helps out!

  1. You can use the Octo.exe tool to export the project (variables included) and then import this into your instance, in situations where you are importing into the same instance a unique project name is required, however, from your query you mentioned that this is a new instance so this should not be required.

I’ve included a link to our documentation on this below; (You can download the Octo.exe tool via the Downloads area of our website; https://octopus.com/downloads)

Export- https://octopus.com/docs/api-and-integration/octo.exe-command-line/export

Import - https://octopus.com/docs/api-and-integration/octo.exe-command-line/import

  1. It’s definitely possible to backup your existing database and restore this into your new instance, during the instance creation you will be required to enter the original master key to decrypt the variables etc.

It’s also worthwhile to mention that if you set up a second instance using a duplicate database (which stores the same thumbprints), the second server/instance will essentially hijack the connection to the same Tentacles, which could interrupt deployments. You would need to completely eliminate the ability to communicate with your Tentacles on your second instance, there are a couple of different methods you can utilize to mimic “offline mode” functionality, I’ve listed these options below;

  1. Deleting your Tentacles from your second instance database via an SQL script. You could consider keeping a test Tentacle (or however many you want) to test deployments, just note that they would be affected by this secondary instance. Please ensure you take steps to have a valid Database Backup in the event you need to restore your Database.

  2. Disable the internet connection on the Server so it can’t reach out to Tentacles. This route would eliminate the ability to test any deployments. however.

  3. Enabling Maintenance Mode, using this mode non-Administrative level users cannot make changes (i.e. queuing new deployments or other tasks).

I hope this helps!, if you require any further assistance or clarification please let me know :slight_smile:

If i’ve also misunderstood your query in any way, please don’t hesitate to correct me.

Have a great day!

Kind Regards,

Reece

1 Like

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