Octopus Deploy Documentation

Moving the Octopus Server database

Last updated

This page outlines our recommended steps to move your SQL database to another server, without moving your Octopus Server. The following is our advised approach to moving your Octopus database while retaining all of your data.

Step-by-step process

  1. Place your Octopus instance into Maintenance Mode and stop the service when all deployments have completed. You can stop the service via the Octopus Manager, or via the command line using the following command. Octopus.Server.exe service --stop
  2. Ensure you have saved a copy of your Master Key.
  3. Take a backup of your Octopus database.
  4. Restore the database on your new server.
  5. On your original Octopus Server, run the following command to update the connection string (where "VALUE" is your connection string).
Octopus.Server.exe database --connectionString="VALUE"

Database connection string tips

  • Ensure the user specified in the connection string has access to the database as a dbo_owner. Refer to our SQL server database documentation page.
  • When running the Octopus Deploy service as a Local System account, Windows Authentication can be used only if the SQL server instance is hosted on the same machine. To host SQL Server remotely, use SQL Server Authentication, or run the Octopus Deploy service as a custom account.

Step-by-step process for Octopus HA

When you are using Octopus High Availability clusters, you should generally follow the same instructions as above, but repeat certain steps for each node.

  1. Place your Octopus instance into Maintenance Mode
  2. Toggle the Drain option for each Octopus Server node in Configuration ➜ Nodes
  3. Stop the service on each Octopus Server node when all deployments have completed. You can stop the service via the Octopus Manager, or via the command line using the following command. Octopus.Server.exe service --stop
  4. Ensure you have saved a copy of your Master Key.
  5. Take a backup of your Octopus database.
  6. Restore the database on your new server.
  7. On each Octopus Server node, run the following command to update the connection string (where "VALUE" is your connection string).
Octopus.Server.exe database --connectionString="VALUE"
  1. Start the service on each Octopus Server node. You can start the service via the Octopus Manager, or via the command line using the following command. Octopus.Server.exe service --start
  2. Disable the Node Drain option for each Octopus Server node in Configuration ➜ Nodes
  3. Take your Octopus instance out of Maintenance Mode.

Moving from Azure SQL to AWS RDS

If you want to move your Octopus database from Azure SQL to AWS RDS, replace steps 3 and 4 in the step-by-step process with the steps below:

  1. Take a backup of your Azure SQL database (.bacpac)
  2. Download the .bacpac backup from Azure
  3. Import the .bacpac backup to a local SQL Server
  4. Create a standard SQL backup (.bak)
  5. Import the SQL backup into your AWS RDS database

Need support? We're here to help.