Importing from SQL Source Control
Published 20 September 2023
To make the transition from SQL Source Control to Flyway as easy as possible we'll preserve all your settings (comparison options, filters, static data configuration) and your Git history. Read more about why we're moving to Flyway and its benefits. If you have any questions, get in touch with our Database DevOps Team.
Before importing your project, make sure you have a backup of your local repo.
After importing, you should no longer use SQL Source Control to capture changes on your development database.
If you are using Pre & Post Deployment scripts in SQL Source Control, please get in touch with our development team.
Team Leader
- Communicate upgrading to Flyway with your team. Only one person will import the SQL Source Control project into Flyway.
- Make sure everyone has committed and pushed any of their outstanding database changes into the remote Git repository.
- Pull all the latest changes from the remote repository to a local repository on disk. If there are any changes, apply them to your development database to make sure your environment is up to date.
- Tag or create a branch of the state of the repository at this point in case you need to revert back.
- In SQL Source Control, go to the Setup tab and copy the repository folder.
- Note: This only works for Git. If you are using Subversion or Team Foundation System Version Control, then you'll need to get the repository path from Under the hood > Open working base. Learn more about Working with other version control systems.
- Note: This only works for Git. If you are using Subversion or Team Foundation System Version Control, then you'll need to get the repository path from Under the hood > Open working base. Learn more about Working with other version control systems.
- Install Flyway Desktop on your desktop (developer's machine).
- Launch Flyway Desktop from the Start Menu and click Import project...
- Choose SQL Source Control, paste the directory you just copied into the Project folder, and click Import. Agree to the confirmation prompt by clicking Import again.
→ - Confirm your development database connection details and click Test and save. For more information. see configuring your development database.
- You're now on the Schema model tab. This compares the objects and static data from the Development Database to the Schema model folder on disk. If your database was in synch with your repository, then you won't see any changes.
- Expand the Version Control side panel. You may see a lot of added/deleted files. This is just how Git works. After entering a commit message (e.g., Converted to Flyway), Commit, and Push the changes to the remote repository. You should be able to see all the history of the objects in the schema-model folder in Git.
→
- To see all the history for an object, you may need to show the rename history. In Azure DevOps, this is called Show rename history.
→
- To see all the history for an object, you may need to show the rename history. In Azure DevOps, this is called Show rename history.
Other team members
- Install Flyway Desktop on your desktop (developer's machine).
- Launch Flyway Desktop from the Start Menu and click Open project... > From VCS.
- Navigate to the remote repository and select the project folder that contains the flyway.toml settings.
- You may be prompted to setup your development database connection details.
- You can start making changes on your development database and then come back and refresh the Schema model view to save any changes to your database objects. Then use the Version Control side panel to commit and push these changes.
- Learn more about working with Flyway Desktop.
Using SQL Source Control after importing
You should not use SQL Source Control on a project that has been imported into Flyway. If the project was imported in place, then any user that gets the latest changes in SQL Source Control from the remote repository will see the following message in SQL Source Control:
If you are trying to use SQL Source Control and Flyway together, please get in touch with our Database DevOps Team so we can understand what you're trying to do and why as we continue to improve Flyway.
Any Questions?
If you have any questions about transitioning to Flyway from SQL Source Control, please get in touch with our Database DevOps Team.