This page outlines our recommended steps for moving your SQL database to another server without moving your Octopus Server. The following is our advised approach to moving your Octopus database while retaining your data.
Step-by-step process
- 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 the command line using the following command.
Octopus.Server.exe service --stop
- Ensure you have saved a copy of your Master Key.
- Take a backup of your Octopus database.
- Restore the database on your new server.
- On your 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 can access 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 using Octopus High Availability clusters, follow the instructions above but repeat certain steps for each node.
- Place your Octopus instance into Maintenance Mode
- Toggle the Drain option for each Octopus Server node in Configuration ➜ Nodes
- Stop the service on each Octopus Server node when all deployments have finished. You can stop the service via the Octopus Manager or the command line using the following command.
Octopus.Server.exe service --stop
- Ensure you have saved a copy of your Master Key.
- Take a backup of your Octopus database.
- Restore the database on your new server.
- 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"
- Start the service on each Octopus Server node. You can start the service via the Octopus Manager or the command line using the following command.
Octopus.Server.exe service --start
- Disable the Node Drain option for each Octopus Server node in Configuration ➜ Nodes
- 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:
- Take a backup of your Azure SQL database (
.bacpac
) - Download the
.bacpac
backup from Azure - Import the
.bacpac
backup to a local SQL Server - Create a standard SQL backup (
.bak
) - Import the SQL backup into your AWS RDS database
Help us continuously improve
Please let us know if you have any feedback about this page.
Page updated on Monday, July 15, 2024