Move All Site Collections from One Content Database to Another


Scenario/Problem: You want to move all site collections stored in one content database to a different content database.


Solution: Use the Move-SPSite cmdlet with the Get-SPSite cmdlet.

You can pipe the results of Get-SPSite to the Move-SPSite cmdlet. Therefore, by using the ContentDatabase parameter with Get-SPSite, you can easily move all site collections from that content database to a new content database. Listing 8.18 shows a sample command line.

Listing 8.18. Moving All Site Collections from a Content Database


Get-SPSite -ContentDatabase "WSS_CONTENT_MAIN" | Move-SPSite
-DestinationDatabase "WSS_CONTENT_TEAMSITES"


As with moving a single site collection, the destination database must already exist.


Tip

Use the New-SPContentDatabase cmdlet to quickly generate a new content database to move your site collection.


..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.140.194.170