Step-By-Step: Testing System Center 2012 Configuration Manager Backups for Restoration

Step-By-Step: Testing System Center 2012 Configuration Manager Backups for Restoration

  • Comments 1
  • Likes

Most organizations perform some sort of backup of their System Center 2012 Configuration Manager (CM12) sites. Unfortunately most do not actually tested their backup. This is because it can be very difficult to simulate a failure in production and perform a site recovery.  Backups are good.  Backups that you know you can actually restore from are better.
 

This post is intended to provide IT professionals the understanding of the general case backup requirements of CM12, a sample backup strategy, and how to test the backup by simulating a failure and performing a restore of the database portion of the site.  As a best practice I typically walk my clients through this process before handing them the keys to their new CM12 environment.
 
The instructions provided here are based on System Center 2012 Configuration Manager SP1 and MS SQL Server 2012 SP1.


Step 1: Scheduling the Backup Task

CM12 has a built in maintenance task call Backup Site Server.  It performs synchronization between the database and the site control file and other key configuration elements of the Configuration manager site.

As part of the site configuration, the maintenance task to perform a site backup should be configured to perform a daily backup stored in an easily accessible location.  For the purposes of this post, let’s use E:\CM12_Backup
 
image 
 
Figure 1 - Configure Backup Maintenance Task

 

The success of the backup task can be verified in the following ways:

  1. Review the timestamp on the SMSBKUP.LOG file that the Backup Site Server maintenance task created in the backup destination folder. Verify that the timestamp has been updated with a time that coincides with the time when the Backup Site Server maintenance task was last scheduled to run.  Review the log files for errors.
     
  2. In the Component Status node in the Monitoring workspace, review the status messages for SMS_SITE_BACKUP. When site backup is completed successfully, you see message ID 5035, which indicates that the site backup was completed without any errors.
     
  3. When the Backup Site Server maintenance task is configured to create an alert if backup fails, you can check the Alerts node in the Monitoring workspace for backup failures.
     
  4. In <ConfigMgrInstallationFolder>\Logs, review Smsbkup.log for warnings and errors. When site backup is completed successfully, you see Backup completed with a timestamp and message ID STATMSG: ID=5035.
     

The backup files in E:\CM12_Backup should be moved to an archival media as per corporate standards.  Multiple copies should be maintained in the event that one copy is corrupted or unavailable as it is preferable to restore from an older backup that to recreate the entire infrastructure manually if the latest backup is unavailable.
 
 
Step 2: Backing Up Additional Items
 
The Backup Site Server task is intended to backup key elements of the Configuration Manager site that require synchronization, or other special attention.
 
Items that are not backed up by the Backup Site Server maintenance task that should be considered for inclusion in any supplementary backup tasks are listed below:
 
 

  1. Any custom reports and extensions used to create them (models, views, tables, etc.)
     
  2. The content library stored in the <drive:>\SCCMContentLib folder
     
  3. Package source files
     
  4. User State Migration Data 

Step 3: Site Recovery

To restore a Configuration Manager Site Server, follow these steps:

  1. Run the Configuration Manager Setup Wizard from installation media or a shared network folder. For example, you can start the Setup wizard by using the Install option when you insert the Configuration Manager DVD. Or, you can open Setup.exe from a shared network folder to start the Setup wizard.
     
  2. On the Getting Started page, select Recover a site, and then click Next.
     
  3. Complete the wizard by selecting the options that are appropriate for your site recovery[1]
     

Once the site has been successfully recovered, the following tasks need to be performed:

  1. Re-enter the passwords for any accounts that are used by site systems (refer to the Configuration guide for a list of accounts – you have one right?)
     
  2. Reinstall and hotfixes or Cumulative Updates applied to the site since the initial build
     
  3. Restore the Content Library
     
  4. Restore the Package Source Files
     
  5. Restore the User State Migration Data
     

Step 4: Partial Recovery – Database Only

The site recovery wizard will run the same prerequisite checks that a full install will perform.  If a full rebuild of the server OS was not performed and only a database recovery is required, the restore process may fail on the detection of a dedicated SQL instance with the following error:

Dedicated SQL Server instance Failed

The same error may be encountered during a test of the restoration process due to remnants of the site in the registry that may indicate a previous installation.

To remedy this error, delete the following registry keys:

  1. [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\SMS\Components\SMS_SITE_SQL_BACKUP
     
  2. [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\SMS\Operations Management\Components\SMS_SITE_SQL_BACKUP
     
  3. [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\SMS\Tracing\SMS_SITE_SQL_BACKUP

The same issue may also arise when testing the DR process.  The same resolution method can be used.  I have created a batch file that I use to speed up this process.  Here is the source for my DelKeys.bat file:

REM *** DelKeys.bat                                                 ***

REM *** Delete the 3 registry keys to simulate CM12 site failure    ***

REM *** Do not prompt user before delete                            ***

REM *** Unsupported – Use at your own risk                          ***

REG.EXE DELETE "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\SMS\Components\SMS_SITE_SQL_BACKUP" /f

REG.EXE DELETE "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\SMS\Operations Management\Components\SMS_SITE_SQL_BACKUP" /f

REG.EXE DELETE "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\SMS\Tracing\SMS_SITE_SQL_BACKUP" /f

Step 5: Performing a Database Only DR Test

As the base OS, SQL Server and, Configuration Manager Application software can all be rebuilt from generic source media, the most important part of a DR test is to verify that the site configuration and database can be restored as these items will be specific to your organization. The following method can be used to simulate a failure and restore.

  1. Create one or more objects (such as collections) and make some configuration changes (such as a boundary).
     
  2. Perform a site backup.  To quickly start a site backup without modifying the backup schedule, use Service Manager to start the SMS_Site_Backup service.
     
  3. Once the backup has completed, delete the objects and configuration changes made in step 1
     
  4. Use the command PREINST.EXE /STOPSITE to stop all CM12 services.  Browse to “\Program Files\Microsoft Configuration Manager\Bin\x64\00000409” to find the executable.
     
  5. Use SQL server Management Studio to Detach the site database
     
    image 
     
    Figure 2 - Detach Configuration Manager Database
     
  6. Rename the <DB_Name>.MDF and <DB_Name>.LDF files which are found under \Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA
     
  7. Delete the following three registry keys:
     
    • HKLM\SOFTWARE\Microsoft\SMS\Components\SMS_SITE_SQL_BACKUP
       
    • HKLM\SOFTWARE\Microsoft\SMS\Operations Management\Components\SMS_SITE_SQL_BACKUP
       
    • HKLM\SOFTWARE\Microsoft\SMS\Tracing\SMS_SITE_SQL_BACKU
       
  8. Perform the Site Recovery task and select restore database from backup.
     
  9. Browse to the location of the database backup.
     
  10. The site recovery details will be pre-populated.
     
  11. Browse to the location of the downloaded prerequisites from the initial installation process.
     
  12. The pre-requisite check will run and complete and then the installation will begin.
     
  13. Site and installation settings will be pre-populated as will the database information.
     
  14. Once the process is started it will appear as the original installation.  Refer to the Server Build Guide for more details.
     
  15. Once the recovery is complete, verify that the objects and configuration items that you created in Step 1 are recovered.
     
  16. Remove the Test Objects and configuration items.
     
  17. Additional information about the restore can be found in the c:\ConfigMgrSetup.Log file
     

Now go test those backups.

 



[1] The actual recovery process has options to restore different portions of the system depending on the nature of the site failure.

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment
  • Always very informative, Thanks Colin.