Importing from SQL Source Control via the command line

The flyway-dev CLI is an internal component that performs some of the tasks that are surfaced in Flyway Desktop. It is currently available as Preview Software for users to trial and provide feedback.  The command syntax is likely to change in 2024 when we hope to release a fully supported command line with similar capabilities.  Learn more about Preview Software

In addition to using Flyway Desktop's user interface, it is possible to import SQL Source Control projects via the command line.

As with the Flyway Desktop approach, there are two options, importing to a new folder or importing in place.

Using this command line in a loop allows for bulk import of SQL Source Control projects.

Note that because SQL Source Control, being an SSMS plugin, does not store many connection details, the development database information in the new Flyway Desktop project will likely be incomplete. Anything missing can either be added to the connection information in the settings, or provided over the command line as needed.

Importing to a new folder

Importing to a new folder leaves the original SQL Source Control project unchanged, so it is a safe operation.

However, because it is a new folder, if it is committed, your version control history will start afresh.

flyway-dev import-project --import-type SqlSourceControl --database-type SqlServer --source-path <path to SQL Source Control project folder> --destination-path <file path where the new flyway.toml file should be created>

Importing in place

Upgrading a SQL Source Control project to a Flyway Desktop project in place modifies and deletes the existing files, such that it will no longer be a valid SQL Source Control project.

As such, it is advised that the project is up to date in your version control system or otherwise backed up before proceeding.

The benefit of upgrading the project in place is that git version control history will be preserved for your schema files.

flyway-dev import-project --import-type SqlSourceControl --database-type SqlServer --source-path <path to SQL Source Control project folder> --replace-existing-project

Didn't find what you were looking for?