For whatever reason, Microsoft doesn’t provide very clear instructions regarding renaming the Managed Metadata Service Application Database on TechNet. In fact, for a number of the service applications, they go into decent detail about the steps here, but then they wimp out on the Managed Metadata Service with this…
And in that, they don’t mention renaming the database at all.
So, I took to the Google… and I came across a bunch of folks with pretty strange ideas and approaches many of which were either unclear, referenced other articles but with no clear examples, etc. So, I documented what I needed to do myself tonight and figured I’d share it.
High Level Steps
- Prepare for the change
- Stop the Managed Metadata Service
- Backup the existing Managed Metadata Service Database
- Restore it as the new name
- Point the database at the managed metadata service application
- Restart Managed Metadata Service and ensure it is healthy
- Blow away the old database when you are satisfied
Prepare for the change
Of course communicating your plan and timeline is part of preparing, but I’m going to dive into the technical bits and part of that means cataloging the settings that are important. In my case, I wanted to know what service application I was changing, what the old database name is and what I want it to be.
So let’s do that first…
- Name of Managed Metadata Service Application: Managed Metadata Service
- Old Name: Managed Metadata Service_522cdb15ed864f8da416521c87a5cb68
- New Name: itgrooveSP_ManagedMetadataDB
Right, let’s get started…
Stop the Managed Metadata Service
First off, stop the Managed Metadata Web Service in Central Admin:
Backup the existing Managed Metadata Service Database
Next, in SQL Studio Manager, take a backup of your database. I prefer this method as I’m not just renaming the database but I’m also renaming the database files. If I just rename the database, the files (Database and log) will still have the old name, which would be messy in a disaster recovery type situation, among other things…
Restore it as the new name
Hazaa! This is where I get to give it a new name (and possibly a new location if desired).
Point the database at the managed metadata service application
Now we just need to SharePoint know of our dirty little secret.
Open the SharePoint 2010 Management Shell (run as Administrator) and run the following:
1: $newdatabasename = "itgrooveSP_ManagedMetadataDB"
2: Set-SPMetadataServiceApplication -Identity "Managed Metadata Service" -DatabaseName $newdatabasename
Restart Managed Metadata Service and ensure it is healthy
Blow away the old database when you are satisfied
Finally, clean up your mess. No point in keeping that old stuff around now is there?
That’s it, hope it helps someone out there in the Interweb.
Very nice. Do you know any PS for taking backup and restore the managed metadata