I have created 2 site collections on one web application. How do I now assign a different database for these 2 site collections?
2 Answers
For this process to work, the following must be true
- The destination content database must already exist.
- The source content database and destination content database must be located on the same instance of SQL Server.
- The source content database and destination content database must be attached to the same Web application.
Steps
- Add a content database to a web application by using Windows PowerShell
- Move your site collection to another content database
To add a content database to a web application by using windows PowerShell
Start SharePoint 2013 Management Shell -Type in the following command
New-SPContentDatabase -Name <ContentDbName> -WebApplication WebApplicationName
Replace
<ContentDbName>
with the name of the content database to createReplace
<WebApplicationName>
with the name of the Web application to which the new database is attached
To move your site collection to another database:
At the Windows PowerShell command prompt, type the following command:
Move-SPSite <http://ServerName/Sites/SiteName> -DestinationDatabase DestinationContentDb
Replace
<http://ServerName/Sites/SiteName>
with the name of the site collection.Replace
<DestinationContentDb>
with the name of the destination content database.
With PowerShell. Move-SPSite
Move-SPSite http://servername/sites/sitename -DestinationDatabase ContentDb2
Be aware that you have to do an IISreset on all the servers in your farm after you move a site collection to a different content database, which means downtime for the end users.
-
There is adding new content db to existing web application has any downtime to users? Commented Mar 30, 2016 at 9:40
-
Move-SpSite do down for moving site collections or whole web application? Commented Mar 30, 2016 at 9:57
-
No, adding a new content database does not add any downtime. And as stated in MS article, move-spsite move a single site collection between content databases. A web application does not exist in a content database. Commented Mar 30, 2016 at 11:45