Backup-Restore All SharePoint Databases in SQL Server using PowerShell

Requirement: We planned to move our SharePoint’s SQL database to a different server. So, we had to backup and restore all SharePoint databases from one SQL Server 2012 instance to another. How to Backup and Restore All SharePoint Databases from SQL Server using PowerShell? Here are the steps at a high level…

Read more

How to Set SharePoint Content Database to Read Only Mode using PowerShell?

Requirement: Set content database to read only in SharePoint Server using PowerShell. Solution:  We may have to set SharePoint databases to read-only mode in scenarios such as upgrades, disaster recovery / highly available maintenance, patching, etc. Setting SharePoint content database in read-only mode from SQL Server Management Studio is explained in another…

Read more

How to Move SharePoint Content Databases to Another Drive?

Requirement: Move SharePoint content database from one drive to another in SQL Server! By default, SharePoint creates its databases in the default SQL Server location: “C:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\MSSQL\DATA” folder (SQL Server 2016). We don’t have any option from the SharePoint side to specify where the data and log files for the…

Read more

The Current Number of Site Collections is 0 in SharePoint After Database Attachment

Problem:During a production SharePoint site cloning into UAT using Database attachment method, after attaching the content database to the web application in UAT environment, found the current number of site collections is 0 (zero). All site collections are missing! I tried “View All Site Collections”  from the SharePoint 2013 Central Administration site…

Read more

How to Move All SharePoint Databases to a New SQL Server?

Requirement: Move SharePoint databases to a new SQL Server! You’ll have to move SharePoint databases, including all content databases, configuration databases, and service application databases to another SQL Server at least in a couple of circumstances: Upgrading SQL Server to a new version. E.g. Upgrading SQL  Server 2012 to SQL Server 2016. …

Read more

SharePoint Content Databases – Top 10 Frequently Asked Questions

Content databases are the single most significant artifacts in SharePoint, and content databases are the repository where all SharePoint content lives. Let me summarize some of the frequently asked questions on SharePoint content databases. 1: Can a Site Collection spit into one or more Content Databases? No! This is by a design…

Read more

How to Remove Content Database in SharePoint using PowerShell?

SharePoint content databases are the most important artifacts in the SharePoint platform as they hold the majority of the data. However, we may have to delete the content database from SharePoint at times. Here is how you can utilize PowerShell to delete the database: How to delete a content database in central…

Read more

Mount-Dismount (Attach-Detach) Content Databases in SharePoint using PowerShell

There are occasions when you may need to attach or detach a content database to SharePoint web applications. E.g., during migrations, you want to restore a content database from another farm and would like to access the sites in the content database from a new web application. You can attach or detach…

Read more

Move Site Collection to Another Content Database using PowerShell

Requirement: Found a SharePoint Site collection growing in size over a period of time and wanted to move the SharePoint 2013 site collection to another content database. Solution: Use the PowerShell Cmdlet Move-SPSite to move site collection from one content database to another. Here is how: First, identify the target content database…

Read more

How to Rename SharePoint 2013 Content Databases with PowerShell?

Requirement: To follow standard naming conventions, We got to rename SharePoint content databases in our SharePoint 2013 environment. Solution: You can rename a SharePoint content database in these three steps as explained in my other post: How to Rename SharePoint 2013/2010 Central Admin Database and Remove GUID? Detach SharePoint content database from SharePoint…

Read more