For this post I created a Search service application call Blog Search Service App using Central Administration. After it completed I was stuck with the following three databases with those unnecessary GUIDs stapled on the end.
Renaming the Crawl Store database
- In Central Admin go to manage service applications
- Click on your Search service application
- Scroll down the page and click on modify under Search Application Topology
- Under Databases click on your Crawl Database and from the drop down click Edit properties
- Find the database name and simply highlight the GUID and hit delete
- Click OK
When you return to the manage topology screen you will see pending update. The change will not be committed until you click the Apply Topology Changes button at the bottom of the screen. Don't do it yet though, lets rescue another GUID first.
Renaming the Property database
- Assuming you are still on the same page from the last step
- Under Databases click on your Property Database and from the drop down click Edit properties
- Find the database name and simply highlight the GUID and hit delete
- Click OK
Now all that is left is to scroll to the bottom of the page and click Apply Topology Changes. This will probably take a couple of minutes to run. So just kick back for a moment and think of what better planet you left for the children by saving these two GUIDs. It may take a while to run depending on the state of your databases. Mine took about 6 minutes on empty database for my VM.
Here is a screen shot of the results. That was really pretty painless too bad the next one is not.
Renaming the Admin database
Put on your big boy pants because this one is going to require some ninja like SQL and PowerShell skills. (Or I guess you can just cut and paste what I have here.)
- On your SQL Server open SQL Server Management Studio
- Find your Search admin database. From the screen shot mine was named Blog_Search_Service_App_DB_fe289c49b61344b48952a546e48e0135. Right click on it on the database and select Tasks > back up…
- Back the database up. If you are unsure how to do this the defaults should work fine so click OK.
- At the backup successful message click OK
- Scroll up to Databases, right click and select Restore Database…
- Click the radio button for From device: and the click the … button to the right.
- Click Add
- Now select the backup file you just created. If you just clicked OK on the backup screen SQL should open right to the file for you. Once you find it click OK.
- Click OK on Specify Backup
- Check the box under Restore next to your backup
- Now look toward the top of the window and enter your new database name in the To database field. For the example I entered Blog_Search_Service_App_DB. Double check yourself in the screen shot below.
- Click OK
- At the successful screen click OK
The SQL hard work is over but don't close management studio quite yet. You will need to come back to delete the old database in a little bit.
- Now go back over to your SharePoint server
- Open the SharePoint Management Shell by clicking Start > All Programs > Microsoft SharePoint 2010 Products > SharePoint 2010 Management Shell
- Now enter the following line of PowerShell remembering to change the identity to your service application name:
$searchapp = Get-SPEnterpriseSearchServiceApplication -identity "Blog Search Service App"
- Now enter the following line of PowerShell (it might take a minute to run):
$searchapp.Pause()
- Now enter the following line of PowerShell remembering to update your database name and database server:
$searchapp | Set-SPEnterpriseSearchServiceApplication -DatabaseName "Blog_Search_Service_App_DB" –DatabaseServer "2010server"
- Now enter the following line of PowerShell:
$searchapp.Resume()
- Double check yourself in the screenshot below.
- Now before you continue you need to make sure the database change is complete. The best way to do this I believe is to use this PowerShell:
Do {write-host -NoNewline .;Sleep 10; $searchInstance = Get-SPEnterpriseSearchServiceInstance -Local} while ($searchInstance.Status -ne "Online")
This will display a . every 10 seconds until all of the search components return to an online state. It might take a few minutes but be patient.
Now jump back over to the SQL Server to delete that final database with a GUID and restore peace and order to society.
- In SQL Management Studio find the database with the GUID, right click on the name, and click Delete. (If you are the nervous type backing it up first isn't the worst idea you have had today.)
- Check the box at the bottom for Close existing connections and click OK.
Finally! No more GUID's.
No comments:
Post a Comment