Renaming crazy SharePoint Database Names

Renaming crazy SharePoint Database Names

  • Comments 1
  • Likes

When SharePoint 2007 creates new Content Databases, by default it adds a GUID to the end of the database name.  While you can rename it during the creation process, maybe you forgot to and you now you have a Content Database that looks like the one below (which I intended to hold my “My Sites”).  Fortunately, my friend Priyo showed me how to rename the databases.

image

To rename it, we are going to:

  • Take the database Offline (so nobody adds anything to it while we are renaming)
  • Detach the database from SharePoint
  • Back up the database using SQL Management Studio
  • Restore the database using our desired name using SQL Management Studio
  • Re-attach the database to SharePoint

Start by going to Central Administration –> Application Management and click on Content Databases

image

Select the Web Application associated with the database you want to rename, and click on the Database name itself.

image 

Change the Database Status to Offline (which just makes it so that no new sites can be added to the database), click OK.  Click on the database again, select “Remove content database” and click OK.  This does not delete the database, just removes it from SharePoint.

image

image

Switch over to SQL Management Studio, and back up the database, then take it offline.

image

image

Next… restore the database

image

And choose a friendly name to restore the database to.  In this case, it will be the ContentDB for my My Sites.

image

Switch back over to Central Admin (you probably still have open) and click on “Add a content database”

image

Change the database to your new friendly name, and hit OK.  Voila!  You now have a database name that makes sense.  Once you have verified that everything still works, you can go back into the SQL Management Studio and delete the database that you previously took offline.

image

Note: There are some special considerations when talking about the SharePoint AdminContent database, as the GUI does not give you an opportunity to name it during initial setup, and following the GUI method will lock you out of the GUI as soon as you remove the database.  The three following posts will walk you through that process, and I’ll try to do the same with screenshots in the next few days.

http://guru-web.blogspot.com/2007/03/renaming-central-admin-content-database.html

http://www.whitworth.org/2006/08/07/moving-or-renaming-the-wss-central-administration-content-database/

http://blogs.msdn.com/krichie/archive/2006/10/30/psconfig-for-wss-3-0-and-moss-2007-is-your-friend.aspx

Comments
  • presuming you are on sql 2005/2008.  When you restore are you changing file names? if not, then why not back it up and then just rename and add? rather than restore and add which leaves the original still there.

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment