Read time 4 minutes
The SharePoint database files contain data for various SharePoint sites or collections of sites and operate akin to SQL database files. When you start working, the SharePoint Product Configuration wizard automatically creates the required database.
Here is the following table, which shows where the SharePoint Server can host the database.
SharePoint Database | Hosted Platform |
---|---|
SharePoint Server 2019 | SQL Server 2016 and SQL Server 2017. |
SharePoint Server 2016 | Microsoft SQL Server 2016 and SQL Server 2014 Service Pack 1 (SP1). |
SharePoint Server 2013 | SQL Server 2008 R2 Service Pack 1 (SP1) and SQL Server 2012. |
There are three types of database in the SharePoint Server which save different kind of content based on their functionalities.
- Configuration Database: This comprises information pertaining to various aspects within Internet Information Services (IIS), including websites, web applications, trusted solutions, web part packages, site templates, and distributed cache configuration objects.
- Central Administration content database: The Central Administration content database contains configuration data for the Central Administration site collection.
- Content Database: The content databases store comprehensive site collection data, encompassing documents within document libraries, web part properties, audit logs, list information, sandboxed solutions, and more.
Methods to Restore SharePoint content database
The content-database saves the majority of your SharePoint data. If you lose the database due to any corruption or unintentional deletion, then you can recover the data using different methods:
Restore SharePoint content database using Central Administration
To carry out this task, the account must hold membership in the SharePoint Farm Administrators Group. Once this condition is confirmed, proceed with the following steps:
- Open Central Administration and go to the Backup and Restore section. Here, click Restore from a Backup.
- Choose Backup to Restore page. Select the backup from the list of backups that has the content database. Click Next.
- Choose the Component to Restore page and click the box for the content database. Click Next.
- Select Restore Options from ‘Type of Restore’ and click Same Configuration. A confirm page asks you to validate your selection. Click OK.
- Click Restore.
Restore the SharePoint content database using PowerShell
To perform this action, you should be a member of the securityadmin fixed server role group and db_owner fixed database role group, and Administrators Group. After ensuring this, use the below step:
Open the SharePoint Management Shell and run the command:
It accesses the backup file and restores the database from it.
Restore SharePoint content database using SQL server tools
Make sure that your SharePoint account is a member of sysadmin fixed server role. Then, you can perform the database restore using the following steps:
- Stop the SharePoint Timer Service.
- Connect to the database server with SQL Server Management Studio.
- Expand Databases, right-click the database for the restoration, and follow Tasks >> Restore >> Database.
- A Restore Database dialog box appears. Mention the destination and source accounts and select backup set or sets.
- Click ‘Options’ in the ‘Select a page’ pane.
- Choose ‘Overwrite the existing database’ at the Restore options.
- At the ‘Recovery state’ section:
- Select ‘RECOVER WITH RECOVERY,’ to include all the transaction logs.
- Select ‘RECOVER WITH NORECOVERY,’ to restore additional transaction logs.
- Click OK to complete the restore operation. Now, you can restart the SharePoint Timer service.
Final words
The recovery techniques outlined earlier for restoring the SharePoint Server content database rely on having backup files. If you encounter database corruption affecting recent data without a corresponding backup, these methods may prove ineffective. In such a scenario, utilizing the Kernel for SharePoint Server Recovery software is advisable. This proficient recovery tool specializes in repairing corrupt MDF database files, offering two recovery modes and a preview feature. Following recovery, the retrieved data can be saved directly to a live SQL Server or as a batch file. The software is compatible with various SharePoint Server versions including 2019, 2016, 2010, and 2007. During the recovery process, the software ensures a clear preview and generates a comprehensive report upon successful recovery.