Red Gate forums :: View topic - Renaming a source-controlled DB
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

Renaming a source-controlled DB

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



Joined: 13 Oct 2011
Posts: 6

PostPosted: Thu Oct 13, 2011 11:35 pm    Post subject: Renaming a source-controlled DB Reply with quote

What is the best method for renaming a database that is source controlled?
Back to top
View user's profile Send private message
DavidSimner



Joined: 04 Feb 2010
Posts: 49

PostPosted: Sat Oct 15, 2011 4:43 pm    Post subject: Reply with quote

If you mean renaming the database on SQL server, then the best way is:

1. make sure that both the commit tab and the get latest tab are empty by committing all your outstanding changes and gettting all of your teammates
2. on the setup tab, right-click on the URL where it's linked to and click copy
3. on the setup tab, unlink the database from source control
4. rename the database
5. on the setup tab, link it to the same location (you can paste the URL that you copied above)
6. visit the commit tab and wait for the spinny to finish (you should see the spinny say "Accepting updates from source control" which is where it determines that your database is already fully up-to-date with no changes to commit or get, and we sort out our internal data structures to reflect this)

At this point you should be done. Let me know if you have any problems.
Back to top
View user's profile Send private message
JasonR



Joined: 13 Oct 2011
Posts: 6

PostPosted: Mon Oct 17, 2011 2:38 pm    Post subject: Reply with quote

Thanks for the reply. You were correct -- I did mean to ask how to change a database's name in SQL Management Studio while retaining its source control history.

Your process worked like a charm. Note that each user needs to re-link the database to the source control system after the name change.
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