Options

Import from pre-existing repository

jjjj Posts: 3
Is there a way to link SQL Source Control to an existing repository of database scripts? Many years ago we setup an environment where we script our db objects as individual files (via SSMS Generate Scripts) and kept track of their changes in svn.

SSC seems like a much more robust method of keeping track of our database changes, but if it can't somehow link to our existing repository then we will lose years of change history for each object.

I know SQL Compare can compare an active db with a folder of scripts, so I figured there should be some sort of path to migrate our preexisting db object history into SSC.

Any thoughts?!?

Thanks in advance.

Comments

  • Options
    In some cases it is possible to migrate an existing repository to SVN. This document looks at migrating the evaluation repository, but the principals may be transferable.

    http://www.red-gate.com/supportcenter/C ... 432737.htm
  • Options
    Thanks for the link!

    I've done something similar to this before, but it takes a lot of time and you have to be very diligent. I'm not sure I'm going to go with this route, but just in case someone else is thinking about it, here is the general idea:

    The idea is similar to the link above. You add your db to SQL Source Control (SSC), which creates a new repository/folder, then inspect the folder/file structure it created. You then take your preexisting repository and rename each file to match the same structure as the one created by SSC. Renaming does a drop/add, but the history of the file is maintained. After you have committed your changes, you should be able to instruct SSC to switch to using your repository just like the link above mentions.

    This might make for an interesting project for Red Gate in the future: a program could inspect a preexisting repository and suggest what changes should be made to make it compatible with SSC. However, that seems like a lot of development work for something no one seems to be requesting.
  • Options
    Thank you for your suggestion. It definitely makes sense. I have added it to our uservoice forum so that other user can vote for it if they like it. Here is a link:

    http://redgate.uservoice.com/forums/390 ... positories

    The development team can then take the suggestion into consideration.
Sign In or Register to comment.