Skip Ribbon Commands
Skip to main content

Quick Launch

Todd Klindt's home page > Todd Klindt's Office 365 Admin Blog > Posts > Get the GUID out of SharePoint databases
February 04
Get the GUID out of SharePoint databases

As a SharePoint consultant I get to see a lot of things about SharePoint that bug people. This blog post is dedicated to one of those SharePoint annoyances, a GUID at the end of the Central Admin content database.

If you do a regular, wizard driven configuration of SharePoint Central Admin is created. This is the part after the bits are installed, but before SharePoint is configured. The Configuration Wizard runs and if it's a new farm it sets up the farm. Part of that setup is creating the Central Admin web app, and its content database. Web apps in SharePoint can have many content databases. When you add a content database to SharePoint it checks to see if the database exists. If it does, then SharePoint adds the existing database to your web app. If the database doesn't exist, SharePoint creates it, then adds it to the web app. This is important when the configuration wizard creates the Central Admin web app. If SharePoint used a well-known name for the Central Admin content database, like "Admin_Content" then if that database already existed, the existing one would get mounted. This could happen since a SQL instance can hold the databases for many SharePoint farms. To keep this from happening the configuration wizard throws a random GUID at the end of the database name. For some folks, having a GUID in a database name really cheeses them off. To prevent this, you can script the configuration of your farm with a daunting combination of psconfig.exe and stsadm.exe commands. It's not for the faint of heart. Until recently when a customer took exception to the GUIDed database names I was able to tell give them the explanation you just read, explain to them that no other databases will be GUIDed against their well, and we move on.

Recently a customer voiced that same concern, and we had the same talk. Unfortunately they had some 3rd party software that didn't like the GUID in the database name. All my sweet talking was no good. I was forced to find a solution. It took a couple of minutes, then it occurred to me, Central Admin is just a site collection, so I can handle it like any other site collection. I ended up creating a 2nd content database for Central Admin and giving it a more reasonable name. Then I used STSADM's mergecontentdbs operations to move the Central Admin site collection to the new content database. Then we were free to dismount the GUIDed database in Central Admin and delete it in SQL. That made for a happy customer. Below are the steps I took. There's not a man, woman or child alive that doesn't like screenshots. So I've added lots of them to show what I did.

Here's where we start:

Here's how it looks in Central Admin:

First step was to add a new content database to move the site collection to.

Here's the next step

Now we have two content databases:

Next is a screenshot of the next few things I did on the Command Prompt to move the site collection. The line outlined in red is the actual command that moves the site collection.

I used "stsadm –o mergecontentdbs" with the full move option.

Now I can go into Central Admin and delete the GUIDed database. Central Admin will look like this:

There is one final, satisfying step left:

(And the crowd goes wild!)

Hope that helps clean up some SQL instances.

tk

Comments

Excellent!

Even though I'm not the client I prefer that DB names don't contain the GUID.  This makes it so easy to follow your steps and get it cleaned up!  Thanks!
 on 2/5/2010 9:44 AM

GUID

its always nice to see that DB names don't contain the GUID.
 on 2/6/2010 2:40 AM

Re: Get the GUID out of SharePoint databases

Out of curiosity, what was the tool that didn't like the GUID on the end? With my luck, we'll end up purchasing such a tool.
 on 2/6/2010 4:14 PM

Can merging an old DB into a new DB change the URL?

I have an old database at URL https://my.website.com:8443, and I need to change the database URL to https://my.website.com, is it possible that I can create a new database and get the URL to change?

When I ran the "stsadm -o enumalternatedomains" command it shows me that the IncomingUrl and MappedUrl both point to 8443, but I need it to point to only https (port 443).

I tried to use the "renamesite" command, but it says that it can only be used on host header site collections.

This whole problem started when I tried to install a 3rd party web part, and it points to the 8443 port during installation.  And after it installs it doesn't appear in the "Site Collection Administration" for that site collection.

The 3rd party product is SharePoint Password Change from http://www.sharepointboost.com/passwordchange.html.
 on 2/17/2010 7:36 AM

Alternative Approach

An alternative to this approach is to use stsadm to detach the database using stsadm -o deletecontentdb, then rename the database in SSMS and then finally add the content database back using stsadm -o addcontentdb.

Brendan Griffin
 on 2/17/2010 8:20 AM

Re: Can merging an old DB into a new DB change the URL?

Databases don't have URLs, the site collections inside of them do. You can't use "mergecontentdbs" to modify URLs in any way. What you probably need to do is create a new web application at http://my.website.com. Then detach your content databases from the web app that serves http://my.website.com:8443 and attach them to the http://my.website.com web application.

tk
Todd O. KlindtNo presence information on 2/18/2010 11:28 AM

Re: Alternative Approach

Yeah, that works too. I don't like it because it means more downtime and requires some complicated SQL work. I think it also results in a database with one name, but the MDF and LDF files have a different name, which can lead to confusion.

tk
Todd O. KlindtNo presence information on 2/18/2010 11:31 AM

Our DBA loves you. Are you single? :-)

Our DBA, Nicole, loves you. Are you single? ;-)
 on 3/3/2010 9:57 AM

Re: Our DBA loves you. Are you single? :-)

I'll have to check with my wife for the final answer on my availablity, but I'm pretty sure I'm spoken for. :)

Thanks for the compliment though.

tk
Todd O. KlindtNo presence information on 3/3/2010 10:04 AM

Our DBA loves you. Are you single? :-)

Our DBA, Nicole, loves you. Are you single? ;-)
 on 3/3/2010 10:07 AM
1 - 10Next

Add Comment

Items on this list require content approval. Your submission will not appear in public views until approved by someone with proper rights. More information on content approval.

Title


Body *


Today's date *

Select a date from the calendar.
Please enter today's date so I know you are a real person

Twitter


Want a message when I reply to your comment? Put your Twitter handle here.

Attachments

 

 SysKit