Import from pre-existing repository

A SQL Server Management Studio add-in to source control your database in Subversion or Team Foundation Server.

Moderators: Chris Auckland, David Atkinson, sherr, PhilScrace

Import from pre-existing repository

Postby jj » Mon Oct 24, 2011 11:23 pm

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.
jj
 
Posts: 2
Joined: Mon Oct 24, 2011 11:06 pm

Postby chriskelly » Thu Oct 27, 2011 3:36 pm

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
Chris Kelly
Technical Support Engineer
chriskelly
 
Posts: 330
Joined: Mon Apr 19, 2010 1:44 pm
Location: Cambridge, UK

Postby jj » Thu Oct 27, 2011 5:12 pm

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.
jj
 
Posts: 2
Joined: Mon Oct 24, 2011 11:06 pm

Postby chriskelly » Thu Nov 03, 2011 1:37 pm

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.
Chris Kelly
Technical Support Engineer
chriskelly
 
Posts: 330
Joined: Mon Apr 19, 2010 1:44 pm
Location: Cambridge, UK


Return to SQL Source Control 2

Who is online

Users browsing this forum: No registered users and 1 guest