Perform a test upgrade of the database before ConfigMgr 2012 R2 installation
Before you go ahead and begin the installation of ConfigMgr 2012 R2 in your ConfigMgr 2012 SP1 hierarchy, it’s recommended that you perform a test upgrade of the database. This post will help you along the way to successfully perform just that. Let’s get started.
- Install a VM with SQL Server
- Copy the database backup
- Attach the database
- Perform a test-upgrade
Install a VM with SQL Server
This blog post will not cover the steps of installing any supported SQL Server version. You can find guides on how to do that here:
What’s most important though is that the SQL Server version that you install on the new VM, must be the exact same version that you’re running in production with ConfigMgr 2012 SP1. So if you’re running the ConfigMgr 2012 SP1 database on a server with SQL Server 2008 R2 SP2, that’s the SQL Server version you’ll need for the test upgrade scenario. In this post I’ll be test upgrading a database that was created on SQL Server 2012 CU3.
Copy the database backup
1. Once you have a VM with the same SQL Server version as you’ve got running in production, it’s time to copy the database files from your Site Backup location. You’ll find that location if you go to Administration – Site Configuration – Sites and selects your Primary Site server. Click on Site Maintenance, select Backup Site Server and click Edit. You’ll see the location in the Backup destination field. In my case it’s \\CM01\ConfigMgrBackups.
2. Now copy the two files from \\CM01\ConfigMgrBackups\P01Backup\SiteDBServer to the newly created VM. I’ve choosen to copy the file to C:\Databases.
Attach the database
1. On your server with the test SQL Server installed, launch SQL Server Management Studio.
2. In he left pane, right-click Databases and click Attach.
3. Click on Add, expand C:\Databases (or the location that you chose to store the two MDF files in) and click OK.
4. If no error occured, click OK in the Attach Databases window.
5. In the left pane of SQL Server Management Studio, expand Security – Logins. Right-click on the user or group that represents the currently logged on account (in my case CONTOSO\administrator) and select Properties.
6. Click on User Mapping in the left pane. Check the box in the Map column next to the newly attached database. In Database role membership for: <database_name>, select db_owner. Click OK.
7. Close SQL Server Management Studio.
Perform a test-upgrade
Since the ConfigMgr 2012 R2 RTM bits yet havn’t been released (they will soon), download the Preview bits and extract the contents to C:\Install\ConfigMgr2012R2Preview on the VM.
1. Open an elevated command prompt and navigate to C:\Install\ConfigMgr2012R2Preview\SMSSETUP\BIN\X64.
2. Run the following command:
setup.exe /testdbupgrade <database_name>
Remember to change <database_name> to the name of your attached database. In my case it was CM_P01.
3. In the window that appears, click Begin TestDBUpgrade. Click Yes if you get a prompt asking if you want to continue.
4. You can now follow the test upgrade of the database with CMTrace by opening C:\ConfigMgrSetup.log.
5. Once the test upgrade has completed, you should see a line with the following text:
INFO: Configuration Manager Setup has successfully upgraded the database.
That’s all. Good luck with your ConfigMgr 2012 R2 installation!
Principal Consultant and Enterprise Mobility MVP since 2016. Nickolaj has been in the IT industry for the past 10 years specializing in Enterprise Mobility and Security, Windows devices and deployments including automation. Currently working for TrueSec as a Principal Consultant. Awarded as PowerShell Hero in 2015 by the community for his script and tools contributions. Creator of ConfigMgr Prerequisites Tool, ConfigMgr OSD FrontEnd, ConfigMgr WebService to name a few. Frequent speaker at conferences and user groups.