Monday, 22 December 2014

How to Move content Databases using PowerShell

How to Move content Databases using PowerShell?
—————————–
Step1: Create an additional content database either using PowerShell (PS) or the UI namely:
Go to CA > Application Management > Manage Content Databases > Add a Content Database (I called my content database “WSS-Content-NewUserDB”).
Now we will Use PS
Syntax:
———-
PS C:\Users\Admin> Move-SPSite [-Identity] -DestinationDatabase [-
AssignmentCollection ] [-Verbose] [-Debug] [-ErrorAction ] [-WarningAction ] [-ErrorVariable ] [-WarningVariable ] [-OutVariable ] [-OutBuffer ] [-WhatIf] [-Confirm]
Eample:
——–
PS C:\Users\Admin> Move-SPSite -Identity http://sp2010 -Destinationdatabase WSS-Content-NewUserDB
Confirm
Are you sure you want to perform this action?
Performing operation “Move-SPSite” on Target “http://sp2010?
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is “Y”): y
WARNING: IIS must be restarted before this change will take effect.
Now you have to restart IIS.
open a command prompt window and type iisreset.