This article demonstrates the steps to backup SCCM server. In the event of a disaster, a Configuration Manager site can be fully recovered using a backup of the databases.
Any organization using SCCM to manage devices must prepare backup and recovery approaches to avoid data loss. Backing up a Configuration Manager site is critical because it avoids the loss of critical data.
The ConfigMgr site database is a SQL Server database that contains data about your ConfigMgr infrastructure and objects, the client systems you manage, and other discovered resources. You will not be able to use any ConfigMgr resources if the database is damaged or corrupted. Hence, it is important to back up the Configuration Manager site database.
The SCCM backup and restore process is different from the Windows Server backup. The Configuration Manager provides a backup maintenance task that runs on a schedule and backs up the site database, specific registry keys, and specific folders and files. You can also create the AfterBackup.bat file to perform post-backup actions automatically after the backup maintenance task runs successfully.
Considerations before you back up a Configuration Manager site
Listed below are some considerations before creating a backup of the SCCM site data:
- The SMS Writer service must be running for the Configuration Manager site backup to successfully complete. The SMS Writer service must run under the Local System account.
- Configuration Manager can recover the site database from the backup task. It can also use a backup of the site database that you create with another process.
- The SMS_SITE_VSS_WRITER service (smswriter.exe) must be running to perform a successful backup.
- Backups can only be performed from the SCCM Central and Primary Site servers. Secondary sites cannot be backed up. If a secondary site fails, you’ll have to set up a secondary site in SCCM.
- You can automate backup for Configuration Manager sites by scheduling the predefined Backup Site Server maintenance task.
- The Local System account on the site server must have Write NTFS file system permissions to the local folder for the site server backup. The Local System account on the computer that is running SQL Server must have Write NTFS permissions to the folder for the site database backup.
- You can use System Center Data Protection Manager (DPM) to back up your Configuration Manager site database. If you are not licensed for DPM, you can backup the database using the built-in backup maintenance task.
Also Read: Fix ConfigMgr Database Suspect Mode Issue
Ways to back up ConfigMgr Site Database
There are two ways to back up the site data and database files of a ConfigMgr site:
- Configure site backup maintenance task to automatically back up the ConfigMgr database
- Manually back up a Configuration Manager site
In this article, we will go over both of the methods mentioned above.
How often should you run the Site Backup Task?
You must configure an appropriate schedule for the site backup maintenance task. Microsoft recommends running the default site backup task at a minimum of every five days. This schedule is appropriate because Configuration Manager uses a SQL Server change tracking retention period of five days. As a best practice, consider a backup schedule that is outside of active working hours.
Most organizations prefer to back up a Configuration Manager site over the weekends. This is because there are not many employers who work on weekends, and no application or update deployments take place during this time. Weekends are also good for troubleshooting database problems and backup errors.
Which service is responsible for SCCM backup?
The SMS Writer service must be running for the Configuration Manager site backup to successfully complete. The SMS Writer service must run under the Local System account.
In some cases, the SCCM backup fails with the error “The SMS writer service either does not exist or is not running.” To resolve this error, ensure that no security software, such as a firewall or antivirus, is preventing the SMS writer service from running. In addition, review the smsbkup.log for SCCM backup errors. Take a look at all the log files related to the SCCM backup.
What data is backed up?
When you run the site server backup maintenance task or manually initiate a site backup, the following data is backed up:
- Configuration Manager site database.
- Master site control file (.InboxesSitectrl.boxSitectrl.ct0).
- SMS and NAL registry keys on the site server.
- Configuration Manager installation directory on the site server.
What data does not get backed up?
When you back up the SCCM database, the following things are not backed up:
- This backup does not contain any of the programs, packages, OS images, or other data sources; all of these should be backed up individually.
- The backup maintenance task does not include a backup for the content library or the package source files. When a site server fails, the information about the content library files is restored to the site database, but you must restore the content library and package source files on the site server.
- Custom SCCM reports are not backed up. Ensure you copy the custom reports to a different folder. It is essential to create a backup of the report server database files if you have customized or altered pre-made Reporting Services reports, as these are not backed up during backup tasks.
- Backups of additional databases, like the SCUP database, must be made independently.
- The maintenance task for site server backup does not include backing up the user state migration data. As part of your backup plan, you must manually back up the folders that you specify to store the user state migration data.
When can I use option Recover the site database using a backup set ?
You can use Recover the site database using a backup set option when you have a backup of the Configuration Manager site database that was created as part of the Backup Site Server maintenance task run on the site before the site database failure.
Steps to Backup the SCCM Server
Backing up the database of an SCCM site requires multiple steps. We will go through each step in detail and show you how to enable and configure the site backup maintenance task.
Step 1: Launch the Site Maintenance
Follow these instructions to start site maintenance on a primary site:
- In the Configuration Manager console, go to Administration > Site Configuration > Sites.
- Right-click the primary site and select the option Site Maintenance.
Step 2: Enable Backup Site Server Maintenance Task
You can automate backup for Configuration Manager sites by scheduling the predefined Backup Site Server maintenance task. You will have to manually enable this maintenance task on a primary site. On the Site Maintenance window, right-click the “Backup Site Server” task and select Edit.
On the Backup Site Server Properties window, select Enable this task.
Step 3: Configure Backup destination
In this step, we will configure the backup destination to store the site data backup and the site database backup. Before you specify the location for SCCM backup, ensure that the site server machine account has full control of the destination folder.
On the backup site server properties window, select Set Paths. Here, you can select one of the two options to store the database backup.
- Local drive on site server for site data and database: Specify the backup files for the site and site database in the specified path on the local disk drive of the site server.
- Network path (UNC name) for site data and database: Configure the backup location for site data and the database on a network path.
Out of the two backup destinations, we do not recommend using a local drive as the backup location for the data. The ConfigMgr site and the backup would be lost if the system hosting the site server failed. Hence, use the network path option to store the site data and the database.
Click Apply and OK to save the changes.
Once you have configured the backup destination, the configured backup destination is visible on the backup site server properties window, as shown in the below screenshot.
Step 4: Configure the Schedule for SCCM Backup
After enabling the SCCM backup task and configuring the backup destination, the next step is to configure the schedule. The backup schedule defines how often the Backup Site Server maintenance task runs.
Configure the backup schedule (days of the week, start time, and latest start time). In the screenshot below, the following schedule is configured for the SCCM backup.
- Start after: 6:00 AM
- Latest Start time: 11:00 AM
Choose “Enable alerts for backup task failures“. These failure alerts are available in the Alerts node of the Monitoring workspace. Click Apply and OK.
After making the above changes, the backup site server maintenance task shows as enabled. Once you have configured the backup task, it runs on the specified schedule and backups the site database to the specified location. This is how you automatically configure backup for SCCM.
Step 5: Verify that the Backup Site Server maintenance task is running
Manually back up a Configuration Manager Site
If you don’t want to automatically back up the Configuration Manager site database, you have the option to manually back up the database when required.
If you want to backup the SCCM server immediately, you can use the manual backup method. As a SCCM backup best practice, we recommend you perform the manual backup when the site database is least utilized. Depending on the size of the ConfigMgr database, the backup may take a long time to complete.
There are two ways of manually backing up the Configuration Manager site:
- Start the SMS_SITE_BACKUP service
- Manually start SMS_SITE_BACKUP component using Configuration Manager Service Manager
Both of these methods do the same thing: they trigger the site backup immediately. Let’s look at each of these methods in detail.
Method 1: Start the SMS_SITE_BACKUP service
Perform the following steps to manually back up a Configuration Manager site: On the SCCM server, launch the Services console. Search for the service named “SMS_SITE_BACKUP” and start this service. The smsbkup.exe is located in the “C:\Program Files\Microsoft Configuration Manager\bin\x64\” folder.
When the backup maintenance task fails, restart the backup task by stopping and restarting the SMS_SITE_BACKUP Windows service.
Method 2: Run SMS_SITE_BACKUP from Service Manager
You can use the following steps to start the SMS_SITE_BACKUP component using the Configuration Manager service manager:
- Navigate to Monitoring > System Status > Component Status.
- Right-click any component and then select Start > Configuration Manager Service Manager.
- In the Configuration Manager Service Manager, expand your site code and choose Components.
- Right-click the SMS_SITE_BACKUP component and select Query. The component displays as stopped.
- Right-click the SMS_SITE_BACKUP component and select Start. This action starts the backup task.
Monitor SCCM backup
The above actions trigger the backup task on the primary site server. While the SMS Backup task runs, you can monitor the backup task by reviewing the smsbkup.log. This file is located in the C:\Program Files\Microsoft Configuration Manager\Logs folder. Any backup failures or warnings are logged in smsbkup.log.
After a few seconds, we see that the backup has been successfully completed. The following lines logged in the smsbkup.log confirm the successful completion of the site backup task. After the backup task is completed, the SMS_SITE_BACKUP service is stopped automatically.
Info: Starting asynchronous BackupComplete... SMS_SITE_BACKUP Info: Asynchronous BackupComplete finished. SMS_SITE_BACKUP Backup completed - Wed Nov 15 23:59:13 2023 SMS_SITE_BACKUP Created the backup ini file successfully. SMS_SITE_BACKUP SMS_SITE_BACKUP service is stopping.
Let’s open the SCCM backup folder and see what data has been backed up. The SCCM backup creates a folder called <SiteCodeBackup> at the destination location. This folder contains the following subfolders and files:
- CD.Latest: In this folder, you’ll find the Configuration Manager source installation files for the currently installed version.
- SiteDBServer: ConfigMgr database and log files (CM_SITECODE.mdf and CM_SITECODE_Log.ldf).
- SiteServer: This folder contains SMSbkSiteRegSMS.dat. It also contains two subfolders: SMSServer and AdminUIContentStaging.