How to use Source Control and preserve ability to restore database from a backup

YogeshYogesh Posts: 1 New member
edited September 25, 2023 7:04AM in SQL Source Control
I'm new to Source Control too and after following a course on Redgate university, I plan on linking a SQL Server database to Azure Git repository. We have Test, Staging and Prod environments and developers are expected to share the database from the respective environments.

I have access to Test database and plan on creating a baseline of existing database and then I will track new development. My company is used to periodically updating Test & Staging database from Production database. When this happens, will it break the source control link? Has anyone run across such scenario? Can you recommend a workflow to use Source Control and still support database refresh/restore by DBAs?

Thanks for taking time to read and share your thoughts/workarounds.


  • Hi @Yogesh

    SQL Source Control is able to work with branches, and we even have a couple of documentation pages covering this:

    In regards to your question about test being updated from production, this shouldn't break your link in SQL Source Control. You will simply need to pull down the changes from the 'Get Latest' tab when you are connected to the test branch if changes are made on the repo, otherwise you will just push the changes to the repo from SQL Source Control. This should merge the changes that were pushed from prod into your test repository on the database/repo level.

    In terms of a workflow, that's hard to say. One recommendation I have is that developers should work on feature branches or separate development branches when making database schema changes. This ensures that changes are isolated and can be merged easily. I would then consult the documentation about merging branches as it explains how that is done. Other than that, do you have any specific questions about what you might want to achieve?

    Kind regards,

    Kurt McCormick
    Product Support Engineer, Redgate

    Need help? Take a look at our Help Center

Sign In or Register to comment.