Creating a baseline script
Published 29 July 2021
In v5, Redgate Change Control has been renamed to Flyway Desktop. Check out the latest documentation at https://documentation.red-gate.com/fd
When using an existing database, we recommend creating a baseline script that reflects the state of your objects and reference data that have already been deployed to production so that you can generate new migrations from this point. A baseline script is required to bring the Shadow Database up to the current state of production so that subsequent migration scripts only include changes from this point onwards. A baseline script is also necessary to spin up new environments for testing purposes or when deploying new installations.
- Open Redgate Change Control and open your project. Navigate to the Generate Migrations tab.
Note: You can only generate a baseline for a project with no migrations. - You will see a banner prompting you to baseline. Click Baseline
- A dialog will appear allowing you to fill in the connection details for the database you want to use as your baseline.
- Click Connect to database. You will be shown a connection dialog.
- Enter the credentials for the database you want to use as the baseline, then click Authenticate. If the databases across your environments are in sync, then you can use your development database for this. You can optionally customize the version number and description in the filename. Once the details have been filled in click Baseline to generate the baseline script.
- You may want to edit your baseline script if it contains Production only information like usernames or permissions that shouldn't be part of the baseline script. You may also want to include additional SQL statements to populate static data.
- If your development database is empty you can bring it in line with production by manually running the baseline script against your development database.