
Create New or Restore Site Collection on a Specified Database Using Powershell
Below are the two commands I ran to perform the site collection creation and to restore the database in the development environment.
NEW Site Collection
New-SPSite https://BrightWork/pso -OwnerAlias “yourdomainbwuser” -Name “Projects” -ContentDatabase “WSS_Content_BrightWork” -Template “BWSITEPROVISION#0”
Restore Site Collection (To backup – replace Restore-SPSite with Backup-SPSite)
Restore-SPSite https://Brightwork/projects -Path “c:sitecollection.bak”
Restore Site Collection to a particular Database
Restore-SPSite https://Brightwork/projects -Path “c:sitecollection.bak” -DatabaseName “WSS_Content_BrightWork” -Force
Please test commands in your environment before you use them in production. These commands were submitted by one of BrightWork Community members. Many thanks to them for their feedback.
Regards
JB