Red Gate forums :: View topic - Import from pre-existing repository
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Source Control 2
SQL Source Control 2 forum

Import from pre-existing repository

Search in SQL Source Control 2 forum
Post new topic   Reply to topic
Jump to:  
Author Message
jj



Joined: 24 Oct 2011
Posts: 2

PostPosted: Mon Oct 24, 2011 11:23 pm    Post subject: Import from pre-existing repository Reply with quote

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.
Back to top
View user's profile Send private message
chriskelly



Joined: 19 Apr 2010
Posts: 308
Location: Cambridge, UK

PostPosted: Thu Oct 27, 2011 3:36 pm    Post subject: Reply with quote

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/Content?p=SQL%20Source%20Control&c=SQL_Source_Control/help/2.1/SSC_Migrating_Evaluation_Repository.htm&toc=SQL_Source_Control/help/2.1/toc1432737.htm
_________________
Chris Kelly
Technical Support Engineer
Back to top
View user's profile Send private message
jj



Joined: 24 Oct 2011
Posts: 2

PostPosted: Thu Oct 27, 2011 5:12 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
chriskelly



Joined: 19 Apr 2010
Posts: 308
Location: Cambridge, UK

PostPosted: Thu Nov 03, 2011 1:37 pm    Post subject: Reply with quote

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/39019-sql-source-control/suggestions/2364025-better-importing-of-existing-repositories

The development team can then take the suggestion into consideration.
_________________
Chris Kelly
Technical Support Engineer
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group