Fix Commerce Server 2007 After Renaming Machine Name


 


There are time you have to change your machine name post a Commerce Server 2007 installation and after doing so you render your Commerce Server in operable. No matter what your scenario is I will give you two solutions. These solutions are recommended for single server deployments only.

Supported Solution


The supported solution only works for a very few scenarios for example, your Enterprise images Development Systems to prepare a computer for doing imaging and customization. Install Commerce Server but do not configure it, then make an image of the system. After installing the imaged system on to a computer run the Commerce Server Configuration.

Non Supported Solution


The non supported solution is exactly as it is, you will not get any support if you follow these steps. Now that I have made that disclaimer lets get down and dirty.


MSCS_Admin Database


Commerce Server holds all site configuration in MSCS_Admin database. This Database is created when you first configure your site and every time you unpackaged a site all it's configuration data will be stored in MSCS_Admin database. So how is it that MMC Console or Commerce Server knows where this database resides? That's a good question. Commerce Server holds the connection string for MSCS_Admin database in the registry key ADMINDBPS, this key is encrypted.



The Commerce Server MMC and the Configuration objects get the connection string from this location, to find the MSCS_Admin database. After configuration Commerce Server and un-packaging one more site(s), Server names and connection strings for a Commerce Site is held in this database. Hence if the machine name is changed post installation, the connections between resources might break and these connection strings needs to be changed manually.


Recovering Commerce Server After Machine Name Change



  1. Change the Commerce Server Administration database connection string. You can do by running CSConfig.exe command with /f command line to re-configure Commerce Server. This will also reset Service accounts for Commerce Server.
  2. Some global resources such as the Data Warehouse, Commerce Server Direct Mailer, and Profiles may have display names containing the server name on which they were created. So we need to fix this by updating the MSCS_Admin database and replace the old server name with a new one. Then we need to change all the connection strings.

    Before doing any changes lets understand a few tables relevant to our updates in MSCS_Admin database. The Commerce Site information is held in several tables. The Site Table holds the Site Name and by joining to SiteResources and Resources Table we can get a list of Resources associated with a particular site. To see the detail properties of the Resource we need to join to ResourceProps Table. So most of the data is held in Resources table and ResourcesProps and these are the two table we need to modify. First we need to update the Resources Table's s_Computer column. This columns holds the global display name which are server names. Next We need to update the ResourceProps Table s_Value column this table holds all of the connection strings and for some resources it holds server names as well.
     
    The following scripts is to be executed under the MSCS_Admin database:





    DECLARE @OldMachineName nvarchar(255)
    DECLARE @NewMachineName nvarchar(255)


    SET @OldMachineName = null -- name of your old computer
    SET @NewMachineName = null -- name of your new computer

    IF @OldMachineName is not null AND @NewMachineName is not null
    BEGIN
        UPDATE ResourceProps
        SET s_value=REPLACE(CONVERT(nvarchar(4000),s_value),@OldMachineName,@NewMachineName )

        UPDATE Resources
        SET s_DisplayName = REPLACE(s_DisplayName,@OldMachineName,@NewMachineName ) ,
        s_Computer = REPLACE(s_Computer,@OldMachineName,@NewMachineName)
    END


  3. Next we need to fix the profiles global connection strings. The following statement needs to be executed under the <SiteName>_Profiles database.





    DECLARE @OldMachineName nvarchar(255)
    DECLARE @NewMachineName nvarchar(255)

    SET @OldMachineName = null -- name of your old computer
    SET @NewMachineName = null -- name of your new computer

    IF @OldMachineName is not null AND @NewMachineName is not null
    BEGIN
        Update SourceDef
        SET ConnStr = REPLACE(ConnStr,@OldMachineName,@NewMachineName)
    END


  4. Also run the following SQL statement for Direct Mailer if you have it installed.




    DECLARE @NewMachineName nvarchar(255)

    SET @NewMachineName = null -- name of your new computer

    IF @NewMachineName is not null
    BEGIN 


        UPDATE Resources
        SET s_Computer = @NewMachineName
        WHERE (s_Type = 'DirectMailer') AND (f_IsGlobal = 'true')

    END


  5. Update all of your Business User Management Applications so that they are pointing to the new machine name.
  6. Also update local SQL accounts from OldMachineName\UserName with NewMachineName\UserName.

Summary


So you now have two solutions you can test in your Enterprise to ease you deployment pains.

Comments (12)

  1. dinh says:

    Hi, i followed the steps of your article to fix commerce server after renaming the machine name and as i am verifying that everything still works as before, i find the Customer and Order manager doesn’t open.  It complains about the Orders Web Service is unavailable but when I try to view it in internet explorer, it seems to be available since I can invoke one of the method. I already changed the connection string of the business application to the new machine name.  Any idea?  Is there anywhere else that i need to change the machine name…specifically for OrdersWebService?

    Thanks!

  2. MSDN Archive says:

    Yes this has to do with the SSL certifricate. You will need to remove the certificate and recreate it.

    Good luck,

    -Max

  3. Rob Czyzewski says:

    I had Commerce Server 2007 running on a Virtual Machine. I made a copy of the Virtual Machine, ranamed it, and followed the non-supported solution you outlined. I can not get into the Commerce Server Manager, I keep getting the error "Snap-in failed to initialize." Thanks for your help.

  4. MSDN Archive says:

    Did you follow step one by running "CSConfig.exe command with /f"?

  5. Brian Deitrick says:

    >># re: Fix Commerce Server 2007 After >>Renaming Machine Name @ Friday, January 05, >>2007 11:30 AM

    >>I had Commerce Server 2007 running on a >>Virtual Machine. I made a copy of the >>Virtual Machine, ranamed it, and followed >>the non-supported solution you outlined. I >>can not get into the Commerce Server >>Manager, I keep getting the error "Snap-in >>failed to initialize." Thanks for your help.

    >>

    >>Rob Czyzewski

    I’m interested to see if this was fixed?  I’ve built a Commerce Server 2007 Virtual Machine, and am trying to clone and rename it using the NewSID utility.  However, based on your "unsupported solution" when I run csconfig.exe /f, I get this…

    [14:42:24 ERROR] CSConfig failed during configuration of feature Administration Database (Feature.MS.CS.Admin).

    [14:42:24 ERROR] Exception occured during feature configuration: Microsoft.CommerceServer.Internal.Config.ConfigurationException: Failed to generate type library ‘C:Program Files (x86)Microsoft Commerce Server 2007AssembliesMicrosoft.CommerceServer.Interop.Configuration.MSCSCfg.tlb’ for ‘Microsoft.CommerceServer.Interop.Configuration.MSCSCfg, Version=6.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’. —> System.EnterpriseServices.RegistrationException: Failed to generate type library ‘C:Program Files (x86)Microsoft Commerce Server 2007AssembliesMicrosoft.CommerceServer.Interop.Configuration.MSCSCfg.tlb’ for ‘Microsoft.CommerceServer.Interop.Configuration.MSCSCfg, Version=6.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’. —> System.Runtime.InteropServices.COMException (0x80131163): Type library exporter encountered an error while processing ‘Microsoft.CommerceServer.Interop.Configuration.IGlobalConfig.get_Fields(#0), Microsoft.CommerceServer.Interop.Configuration.MSCSCfg’. Error: Referenced type is defined in managed component, which is imported from a type library that could not be loaded (type: ‘ADODB.Fields’; component: ‘C:WINDOWSassemblyGACADODB7.0.3300.0__b03f5f7f11d50a3aADODB.dll’).

      at System.Runtime.InteropServices.TypeLibConverter.nConvertAssemblyToTypeLib(Assembly assembly, String strTypeLibName, TypeLibExporterFlags flags, ITypeLibExporterNotifySink notifySink)

      at System.Runtime.InteropServices.TypeLibConverter.ConvertAssemblyToTypeLib(Assembly assembly, String strTypeLibName, TypeLibExporterFlags flags, ITypeLibExporterNotifySink notifySink)

      at System.EnterpriseServices.RegistrationDriver.GenerateTypeLibrary(Assembly asm, String tlb, Report report)

      — End of inner exception stack trace —

      at System.EnterpriseServices.RegistrationThreadWrapper.PropInstallResult()

      at System.EnterpriseServices.RegistrationHelper.InstallAssemblyFromConfig(RegistrationConfig& regConfig)

      at Microsoft.CommerceServer.Internal.Config.NativeComPlusApplication.CreateApplicationForAssembly(String applicationName, Guid assemblyComponentGuid)

      — End of inner exception stack trace —

      at Microsoft.CommerceServer.Internal.Config.NativeComPlusApplication.CreateApplicationForAssembly(String applicationName, Guid assemblyComponentGuid)

      at Microsoft.CommerceServer.Internal.Config.AdminConfig.ConfigureDotNetSiteConfig()

      at Microsoft.CommerceServer.Internal.Config.AdminConfig.Configure()

      at Microsoft.CommerceServer.Internal.Config.ConfigurationDriver.ConfigureHelper(List`1 orderedListOfFeatures).

    …Does anyone know why I’m getting this?

    Brian Deitrick

  6. MSDN Archive says:

    I have not tested this with the new sid utility. So, looking at the error message it seems that the objects are not configured correctly. You will need to run a repair first, and then try to configure Commerce Server.

    Good luck,

    -Max

  7. Joenius says:

    I have meet the same problem

  8. Chuck says:

    How does one fix a CS2007 install if you’ve added host headers to the web server post CS2007 install?

  9. MSDN Archive says:

    Take a look at the following link it should help http://www.visualwin.com/host-header/.

    Commerce Server shouldn’t care much about host headers, at least I have not heard of any issues. This is more to do with DNS and IIS.

    If the link doesn’t help post your question to CS207 Forum http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=1059&SiteID=1 and I will make sure to answer it and it will be of help to other folks.

    -Max

  10. MSDN Archive says:

    A bug was fixed to address the direct mailer issues on the post hope it will be of help to you guys who have been having issues.

    -Max

  11. betterisgood says:

    Is there a way to do step 1 using CS2002?  (CSConfig.exe doesn’t appear to exist…)

    So I get the following error:

    Server Error in ‘/MyWebSite’ Application.

    ——————————————————————————–

    The connection strings do not point to the same server.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: Microsoft.CommerceServer.Runtime.Profiles.CommerceProfileSystemException: The connection strings do not point to the same server.

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  

    Stack Trace:

    [CommerceProfileSystemException: The connection strings do not point to the same server.]

      Microsoft.CommerceServer.Runtime.Profiles.ProfileContext..ctor(String profilesvcConnstr, String providerConnstr, String bdaoConnstr, DebugContext dbgContext) +1124

      Microsoft.CommerceServer.Runtime.Profiles.CommerceProfileModule.CreateProfileContext() +515

      Microsoft.CommerceServer.Runtime.Profiles.CommerceProfileModule.get_ProfileContext() +80

      Microsoft.CommerceServer.Runtime.Profiles.CommerceProfileModule.Init(HttpApplication appInstance) +116

      System.Web.HttpApplication.InitModules() +100

      System.Web.HttpApplication.InitInternal(HttpContext context, HttpApplicationState state, MethodInfo[] handlers) +1330

      System.Web.HttpApplicationFactory.GetNormalApplicationInstance(HttpContext context) +392

      System.Web.HttpApplicationFactory.GetApplicationInstance(HttpContext context) +256

      System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +414

  12. MSDN Archive says:

    This is really targeted towards CS2007 I haven’t done any testing for CS2002.

    Once you cleared the registry key then open the MMC console and reconnect.

    -Max

Skip to main content