Renaming a source-controlled DB

JasonRJasonR Posts: 8
What is the best method for renaming a database that is source controlled?


  • 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.
  • 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.
Sign In or Register to comment.