Make adjustments to your database schema using SQL change scripts and Octopus Deploy

Automated database schema migrations

Easily deploy changes to your database schema by running SQL change scripts, using Entity Framework migrations, or with Redgate's database DevOps tooling.

Try it free Watch Video Demo

Your database schema evolves over time, and each new release of your application will come with changes to your database schema or reference data.

There are two main approaches to managing database definitions and applying differences when deploying:

  • Model-driven: where you define the desired state of your database in terms of tables and columns. During deployment, a tool compares the model with the actual target database, and then figures out what changes (column additions, table drops, etc.) need to be made to bring the target database in line with the model.
  • Change-script-driven: where the scripts to migrate from one version of the schema to the next are kept in source control, and are only ever run once.

Octopus can be used to orchestrate database changes using both approaches, and using a variety of tools. For a more in-depth discussion, read our documentation on managing SQL databases using Octopus.

Execute change scripts during deployments

Write your change scripts as sequentially numbered .SQL files, and have Octopus run them during deployments. You can use open source tools like Flyway or DbUp (originally built by people at Octopus), or using Redgate's ReadyRoll.

Zip file containing scripts

Migrations libraries

Many Object-Relational Mapping libraries include an approach for data schema migrations. These can also be packaged and invoked from a script in your deployment. This works for ORMs like .NET's Entity Framework code first migrations, Liquibase, and Rails Active Record migrations.

EF code first migrations

Database tasks

The Octopus library contains over 250 community-contributed step templates that you can use in your deployments. Among them are many steps for working with SQL databases, including:

  • Creating databases and granting permissions
  • Backing up and restoring databases
  • Executing arbitrary scripts

SQL database tasks

Creating happy deployments at more than 25,000 companies, including:

Shout out to @OctopusDeploy for making their software so easy to work with. Just upgraded a 2 year out of date instance and migrated it to a new server and it worked with no effort beyond what their documentation said to do.

Twitter user Alex Dent Alex Dent

We've been overhauling our internal infrastructure and back-end systems over the past month, including a move back to full @OctopusDeploy deployments; rediscovering how nice it is to have a platform-agnostic orchestrator that can deploy practically anything, anywhere ❤

Twitter user Nicholas Blumhardt Nicholas Blumhardt

Tools like @OctopusDeploy can be great in enabling culture change, we've been able to scale and improve our configuration story since we started using it

Twitter user Niel Chalk Niel Chalk

Give your team a single place to release, deploy and operate your software.

Octopus Server

Octopus on your infrastructure.
Free for small teams, no time limits.

Download Octopus Server Server

Octopus Cloud

Octopus hosted by us.
Free for small teams.

Sign up for Octopus Cloud Sign up