• Skip to main content

Pop Tug

Move SharePoint 2010 MySites to a New Database Using PowerShell

by pop tug

I was tasked with moving all of our Mysites to a new database because the way it was setup was to lump the Mysites data in with the main database for our homepage. This wasn’t ideal and so I was tasked with finding a way to move the Mysites data to its own database, luckily there is a relatively easy to use PowerShell command that will do the work for you. This article will discuss why you would want to do this and how to get it done.

Why would you want to move your Mysites data to their own database or databases? If you have the MySites in a database that is being used for another site collection like I did it’s not ideal and is a good reason to move it to its own database. The MySites should have its own database to host all of the MySites data, this is the main reason I found for wanting to move the MySites to its own database.

To move the MySites to their own database follow these steps:

  • Logon to your SharePoint server farm (preferably the server that hosts Central Admin)
  • Identify the managed path in which your My Sites have been created, e.g., ‘Personal’ (we used Personal)
  • Click Start
  • Click All Programs
  • Click SharePoint 2010 Products
  • Click SharePoint 2010 Management Shell (run as administrator)
  • Type Get-SpSiteAdministration -Limit All | Where-Object {$_.URL -Like “* Personal *”} | out-file C:Sites.txt (of course replace Personal with your managed path)

This will output all of your MySites to the text file located in the C:Sites.txt file (you can specify any directory and name this what you want). Next you will need to Create a new content database for My Sites (Must be in the same web application as current My Sites) and then import all of these MySites from the old database to a new one. Follow these steps:

  • Logon to your SharePoint server farm (preferably the server that hosts Central Admin)
  • Click Start
  • Click All Programs
  • Click SharePoint 2010 Products
  • Click SharePoint 2010 Management Shell (run as administrator)
  • Type Get-Content c: Sites.txt | Move-SpSite -DestinationDatabase ” WSS_Content_testmoveMysites ” (Sites.txt was my output file and WSS_Content_testmoveMysites is the database I wanted it to create to move the sites to, you can name this whatever works for you)

The command should run (how long depends on how many MySites you are moving), once it completes check to be sure all MySites are moved to the new content database. That is all there is to moving the MySites to a new database.

Related

  • Verify SharePoint 2010 User Profile Sync Results
  • Sync SharePoint 2010 Photos with Active Directory
  • PowerShell Ping Program – a Free Alternative to Plot Pings
  • Aurora Massacre Shows Need for Lone Wolf Syndrome Database
  • The Weapons of the Middle East Cyber-War: The Narilam Malware – a Database Destroyer
  • Creating an Index Using Microsoft Word 2010
Previous Post: « Tropical Storm Isaac Approaches: Five Common Emergency Grants for Nonprofits
Next Post: Family Life: How to Set a Family Food Budget »

© 2021 Pop Tug · Contact · Privacy