Paginas

07 June 2017

Upgrade In-Place SCCM 2012 R2 - WIndows Server 2008 R2 to 2012 R2




Today, in the post I will show you how to migrate SCCM operating system from Windows Server 2008 R2 to Windows Server 2012 R2 in-place. I had some problems and that is what I will try to describe in more detail. You can do a in-place upgrade from:
  • Windows Server 2012 R2 to Windows Server 2016
  • Windows Server 2012 to Windows Server 2012 R2
  • Windows Server 2008 R2 to Windows Server 2012 R2 (SCCM 1602 or higher)
  •  
    You cannot go from Server 2008 R2 to Server 2016, Windows Server 2008 to Windows Server 2012 or Windows Server 2008 R2 to Windows Server 2012!
 
The key reason for this change is that most installations of SCCM 2012 R2 are based on Windows Server 2008 R2. And if the SCCM evolves, the operating system also has to evolve. Another possible approach would be to install a Windows Server 2012 R2 from scratch and do a restore of the SCCM and database (keeping the same name and IP). I think the first approach is simpler and I will describe it.
 

Scenario:
  • SCCM 2012 R2 SP1 (1702) in Windows Server 2002 R2 SP1 (Virtual Machine)
  • SCCM Database SQL Server 2008 R2 in Windows Server 2002 R2 SP1 (Virtual Machine)

Before upgrade:
  • Verify that SCCM Database in SQL Server is supported on the future Operating System
  • Uninstall WSUS 3.2.
Before you upgrade a server operating system to Windows Server 2012 R2, you must uninstall WSUS 3.2 from the server. For information about this critical step, see the New and changed functionality section in Windows Server Update Services Overview in the Windows Server documentation.

After restoring any missing prerequisites, restart the server one more time to ensure services are started and operational.

In this case I had several Distribution Points with SUP and WSUS installed.



Ok, first thing to do, remove SUP role in all of them:
 

You can check the log if it was removed:



Next, remove WSUS 3.2 in all of them. On server manager, remove Role:



Reboot!

After that I validated the services again and verified that the Reporting Services were not working correctly,
 
Event Log System.Net.SocketException: No connection could be made because the target machine actively refused it 127.0.0.1:443
 
To resolve this, go to this file
C:\Program Files\Microsoft SQL Server\MSRS11.MSSQLSERVER\Reporting Services\ReportServer\rsreportserver.config

And change this line:
<Add Key="SecureConnectionLevel" Value="2"/>
to be this:
<Add Key="SecureConnectionLevel" Value="0"/>

Restart the reporting services and check if it's all good. We don't want to Upgrade with issues left behind. Let's start inserting or mounting the Windows Server 2012 R2 ISO file:



The normal installation failed with error 0x80070490. This error means that Windows could not store the temporary files on the drive. That was strange, since I had 50GB of free space on Drive C.
Tried the installation with command line and specifying the /BTFolderPath


No luck! Still error 0x80070490



I realized that I have a Boot Drive with 100MB, but why is Windows trying to use it? So I had to extend the drive system boot partition to at least 1.5GB. Still no good.
After digging, I changed the boot record files do Drive C:\. This is the procedure:

  • Boot from your Microsoft Windows Disk (you might need to edit BIOS to start from CD-ROM drive)
  • Click "Repair your Computer", open the command prompt and type the following:
  • diskpart
    • select disk #
    • select partition #
    • active
    • exit
  • bootrec /fixmbr
  • bootrec /rebuildbcd
  • bootrec /fixboot
  • bootsect /nt60 C: /force /mbr
  • Reboot
Next, I ran the following in command prompt as administrator:
  • bcdboot c:\windows /s c:
  • You should get a message that states: Boot files successfully created.
  • Open Disk Management, right-click on your C: drive and select Mark Partition as Active.
  • Reboot
  • Open Disk Management, delete the system reserved partition (optional)

Then I started the Upgrade again with this: setup.exe /BTFolderPath:C:\$WINDOWS.~BT
And.. It worked! I took about 40 minutes to upgrade.
I had a new directory Windows.old (as expected) with 25GB. I decided to delete it with Disk Cleanup (after installing Desktop Experience Feature)


As per Microsoft, I had to install KB3095113 after Upgrade
https://support.microsoft.com/en-us/kb/3095113

Then, I checked and started all services in SCCM and Database Server (I had IIS and WAS stopped), The IIS Site was also stopped (not the service). I could start SCCM managment console and check Site Status:


More issues...

Application Catalog Broken:
Cannot connect to the application server.
the website cannot communicate with the server. this might be a temporary problem. try again later to see if the problem has been corrected. if this problem continues. contact your help desk.

Again, browsing to  http://localhost/CMApplicationCatalogSvc/applicationofferService.svc resulted in providing me a lead to an error in a line. This is the fix:

Go to “C:\Program Files\SMS_CCM\CMApplicationCatalogSvc\Web.config” and change from:
 
<serviceHostingEnvironment>
<baseAddressPrefixFilters>
<add prefix=HTTP://SCCM.U-BTech.COM:80/></baseAddressPrefixFilters>
</serviceHostingEnvironment>
 
To:
 
<serviceHostingEnvironment>
<baseAddressPrefixFilters>
<add prefix=HTTP://SCCM.U-BTech.COM:80/></baseAddressPrefixFilters>
</serviceHostingEnvironment>

And performing a iisreset resolved this issue.


Next, I had this error in the same site role:

Application Web Service Control Manager detected AWEBSVC is not responding to HTTP requests.  The http status code and text is 500, Internal Server Error.

Solution:
  • Install .NET Framework 4.5.2 and restart
    • or dism /online /enable-feature /featurename:IIS-ASPNET45
If it still doesn't work do the following:
  • Remove both Application catalog Roles and Restart
  • Install both Application Roles back.

Next I had WSUS errors. The service was stopping anexpectedly after a while. You need to install KB2919355 and follow the manual configurations https://support.microsoft.com/en-us/kb/3159706

  • Run "C:\Program Files\Update Services\Tools\wsusutil.exe" postinstall /servicing
  • Select HTTP Activation under .NET Framework 4.5 Features in the Server Manager Add Roles and Features wizard
  • Restart the WSUS service.
Then, do some web.config modifications
  • cd "C:\Program Files\Update Services\WebServices\ClientWebService\Web.config"
  • takeown /f web.config /a
  • icacls "C:\Program Files\Update Services\WebServices\ClientWebService\Web.config" /grant administrators:f
Add the red lines in the same Web.config file:

<services>
          <service
                name="Microsoft.UpdateServices.Internal.Client"
                behaviorConfiguration="ClientWebServiceBehaviour">
               <!--
                  These 4 endpoint bindings are required for supporting both http and https
                -->
                <endpoint address=""
                        binding="basicHttpBinding"
                        bindingConfiguration="SSL"
                        contract="Microsoft.UpdateServices.Internal.IClientWebService" />
                <endpoint address="secured"
                        binding="basicHttpBinding"
                        bindingConfiguration="SSL"
                        contract="Microsoft.UpdateServices.Internal.IClientWebService" />
               <endpoint address=""
                        binding="basicHttpBinding"
                        bindingConfiguration="ClientWebServiceBinding"
                        contract="Microsoft.UpdateServices.Internal.IClientWebService" />
                <endpoint address="secured"
                        binding="basicHttpBinding"
                        bindingConfiguration="ClientWebServiceBinding"
                        contract="Microsoft.UpdateServices.Internal.IClientWebService" />
          </service>
    </services>
        ....
          </bindings> <serviceHostingEnvironment aspNetCompatibilityEnabled="true"      
             multipleSiteBindingsEnabled="true" /> </system.serviceModel>


Now WSUS is up and running! Let's go to Reporting services that was broken after upgrade.
There was an error about the SMS_SRSRP location. I had the Reports installed on SQL Server D:\ Drive but the SCCM was pointing to C Drive, what a hell!!
The solution or the workaround was this:
  • Uninstall the RSP in SCCM
  • Before re-insatlling the role, copy the C:\SMS_SRSRP\ folder to your clipboard (CTRL+C) and open the D: drive
  • Open the SRSRPSetup.log file in CMTrace
  • Reinstall the role in SCCM
  • Monitor the log file. As soon as its starts, paste the SMS_SRSRP folder into the root of D:\. You must be quick doing this change.
 
I read somewhere that a change on registry will do the trick too:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\SMS\SRSRP, and find:
"InstallDir"="C:\\SMS_SRSRP\\"
I change the entry to:
"InstallDir"="D:\\SMS_SRSRP\\"


When I was thinking that everything was ok, one more problem and a big one! No one could open Configuration Manager console remotely (on the SCCM server was ok). This is a known WMI permission error after the upgrade. To workaround this problem, you must manually restore permissions for the SMS Admins group in WMI.
 
  • On the applicable servers, open the Microsoft Management Console (MMC) and add the snap-in for WMI Control, and then select Local computer.
  • In the MMC, open the Properties of WMI Control (Local) and select the Security tab.
  • Expand the tree below Root, select the SMS node, and then choose Security. Ensure the SMS Admins group has the following permissions:
    • Enable Account
    • Remote Enable

  • On the Security tab below the SMS node, select the site_<sitecode> node, and then choose Security. Ensure the SMS Admins group has the following permissions:
    • Execute Methods
    • Provider Write
    • Enable Account
    • Remote Enable
  •  Save the permissions to restore access for the Configuration Manager console.


After that everything was working as expected!
You can also upgrade SQL server to a supported version. Please view the requirements in here:
https://technet.microsoft.com/en-us/library/gg682077.aspx#BKMK_SupConfigSQLDBconfig

Don't forget that Windows Server 2008 R2 only support till SQL Server 2014. To use 2016 version you will need to upgrade to Windows Serevr 2012 al least.
https://docs.microsoft.com/en-us/sql/sql-server/install/hardware-and-software-requirements-for-installing-sql-server

I'm talking about this because my Reporting Service Point (RSP) was broken after upgrading SQL Server 2012 SP1 to 2014. After the upgrade I noticed that Reports were not longer available. Opening a random report resulted in an error:

Failed to load expressions host assembly. Details: Could not load file or assembly ‘SrsResources. Culture=Neutral’ or one of its dependencies. The system cannot find the file specified.
 
The root cause was that the installation directory of SQL Server changed after upgrade. It was
C:\Program Files\Microsoft SQL Server\MSRS10.50.MSSQLSERVER and changed to
C:\Program Files\Microsoft SQL Server\MSRS11.MSSQLSERVER
 
This issue can be solved by performing the following steps:
  • Open rssrvpolicy.config which is located in the new SSRS installation folder .\MSRS11.MSSQLSERVER\Reporting Services\Report Server\Bin
  • Change MSRS10.50.MSSQLSERVER to MSRS11.MSSQLSERVER and save it
  • Copy srsresources.dll from the old SSRS installation folder .\MSRS10.50.MSSQLSERVER\Reporting Services\Report Server\Bin to the new SSRS installation folder .\MSRS11.MSSQLSERVER\Reporting Services\Report Server\Bin
 
I hope this post has been useful to someone who has to make future upgrades to the SCCM operating system.
See you next time!
 

2 comments:

  1. Hi i am haaving the application catalog issue can you explain the difference between the two sets of code.

    Go to “C:\Program Files\SMS_CCM\CMApplicationCatalogSvc\Web.config” and change from:






    To:




    ReplyDelete
  2. Sorry for the late response Chris. If you notice there is a difference that I marked in red.
    ″HTTP://SCCM.U-BTech.COM:80“ --> ″HTTP://SCCM.U-BTech.COM:80" (notice the quotation marks at the end).

    ReplyDelete