Server crashed and lost master key and license

I am setting up an octopus deploy server demo for my company. I put a lot of time into setting up our deploys for the demo. We have many small web applications that get deployed independently. Recently our IT staff tried to alter the VM it was running on resulting in losing the C: drive. Octopus was installed there, but the data files and SQL db were on another drive, so I still have those. I know I cannot recover the master key, but I did not have any encrypted variables, so it looks like I could just import the old project data in SQL and change the server thumbprints on the agents. Do you think this will work, and/or what should I look out for?

Also lost my license if you could resend that, it would be helpful!! Thanks

Hi Adam,

Thanks for getting in touch! Unfortunately you are not able to simply set up a new instance and connect, Octopus requires the same master key.
The only way we can think of getting things back to a working state is quite hacky and a little messy.

First you need to install Octopus again as a new instance, this creates a blank database.
After that you can manually copy the specific tables you need from the old database to the new one such as projects and variables, you will have to manually pick and choose the tables to be copied. (Just not Certificates or Licences)
Again, this is a very hacky solution so make sure you are careful not to delete anything from your previous SQL db before and for some time after you attempt this.

As for your license. What was the name of the company the license was registered under?

Please let me know how this goes or if you have further questions.

Regards,
Daniel

Thanks Daniel.

For anyone else reading this: That’s exactly what I ended up doing, and so far everything seems to be working as expected.
Luckily I didn’t have any private variables, so the only thing I had to do over were the expected things like API keys and changing the server thumbprint on all the agents. (there was a help post describing how to change this manually in the agent config)

Also the license handled itself since I installed the new version using the same information as the first time.

Hi Adam,

That is pretty good news! Please, please put your master key information somewhere safe!

Vanessa

Hi,

Can you please specify what tables should I actually copy?

Thanks!

Hi Gustavo,

Thanks for getting in touch! Has a similar thing happened to your system recently?
Did you lose the machine you were running Octopus from?

Regards,
Daniel

Hi Daniel,

Yes. An electricity outage caused the death of the hard drive of our
Octopus server.

The colleague that installed Octopus (that no longer works in the company)
did no store they Master Key in our project documentation.

I’ve literally no knowledge about Octopus, but I now need to install a new
server. I was told that our deployment configuration is not easy.
Therefore, I need to restore the server to its original state using the
database.

Are you able to tell me in more details how the process should look like?
Basically, what tables should I copy and/or witch ones I should not.

Best regards,

Gustavo

Here is my understanding of why it worked for us:

  1.   The master key is only used for information that is stored encrypted in the database.
    

a. Server thumbprint

b. User API keys

c. Sercure variables (at all levels)

  1.   We did not have any sercure variables configured at the  time
    
  2.   All of our information of than the service install in program files were intact on a different drive.
    

The process for us was:

  1.   Rename the old Octopus database.
    
  2.   Create a fresh install
    
  3.   Compare the tables in SSMS watching for encrypted data.
    
  4.   If there was no encrypted data,  flushed the new table and copied the data in from the old table
    
  5.   If there was encrypted data, in most (possibly all) cases we left those alone.
    

a. Ex: we did not import user data from from the old

  1.   Manually  recreated the API keys for external integration (TeamCity)
    
  2.   Manually updated the server thumbprint in the config files on each agent.
    

Secure variables are encrypted and interspersed throughout the stored JSON strings. I don’t know what the behavior will be with a new master key. Like I siad, we were fortunate we didn’t have to find out.

Best of luck to you.

Hi Gustavo,

Thanks for getting back with that info!

Would you be able to let us know what version of Octopus you were using? If you were on version 3.x do you still have access to the database?

Also, any further information about you had your Octopus infrastructure set up would help us.

Thanks @Adam for updating the thread with your process it should help others.

Regards,
Daniel