/HiRe: Can I rename a Commerce Server Site?
The name of the site I'm building has changed, and so I need to rename the site in the Commerce Server Manager. How can I accomplish this. i'm aware I'll need to change all references in the web.config for the site, but in particular, how can I change the name of the site in the CSM?
Thanks,
Dave
[324 byte] By [
DMAR330] at [2007-12-27]
Dave,
The easiest way I can think of doing this is to package up your existing application using PUP.exe, and then unpackage it with a different site name. Ideally, this *should* allow you to rename databases, web config entries, and site names during unpackaging.
Not the renaming everything manually is a bad idea, but the last thing you want to do is make a typo and have everything break because of that.
Hi Dave,
The supported way is packing and unpacking your site. You may need to change certain references in your web.config if the packager didn't pick up on the proper attributes to auto-replace.
The unsupported way is by changing the tables in the MSCS_Admin database, modifying the web.config, and csapp.ini files.
Cheers,
Colin
Colin,
Yes, the packing and unpacking method worked supurbly, the only glitch being that I did have to manually rename all of the web.config references to the new name, but the error is quite to the point and easy to pinpoint :)
As an aside, have you or anyone you know had issues where when you package a site on a dev server and unpack it on the deployment box, the site appears in IIS and works correctly, but doesn't appear in the Commerce Server Manager as a Commerce Server Site?
It worked for the web service sites but not for my main app...i'm curious to know if I packed it wrong..I posted this under a different thread but have had no luck with thoughts so far :)
Thanks,
Dave
Hi Dave,
When you say the site doesn't appear in CSM do you mean the listings under Commerce Sites doesn't exist or the listings under the Applications folder in the site definition doesn't exist? If it's the former then your site shouldn't be working at all. If it is the latter then you may be missing an MSCS_Address resource entry in the site definition. To further validate this you can run a SQL query against your MSCS_Admin database to find the resources attached to the site:
SELECT * FROM Resources
INNER JOIN SiteResources ON SiteResources.i_ResourceID = Resources.i_ResourceID
INNER JOIN Sites ON SiteResources.i_SiteID = Sites.i_SiteID
WHERE Sites.s_Name = 'MySiteName'
The above query should show your web services and your core site (where s_Type = Address). Let me know if that helps.
Cheers,
Colin
Colin,
The query you gave me returns the web services for the site, but not the main site itself. I kind of figured this was the problem after I saw your last post in a different thread about this issue and checked the MSCS_Admin tables for the resources. The site does work however as expected. My main concern is that the lack of the site in the resources table may mess up something down the line without me knowing about it. I also don't know if populating that table with a record for my main site can be done manually because there are a bunch of resource flags I'm not familiar with that need to be set. Any thoughts on whether I should even bother to make it right?
Thanks for the help,
Dave
Hi Dave,
If you download the site configuration tools from my blog post you'll have a proper API-based method for setting those properties:
ECHO Creating the %SiteName% application resource
SiteConfig.exe %SiteName% %SiteName% /Create:MSCS_Address
SiteConfig.exe %SiteName% %SiteName% /Update:s_ProgidPUP="Commerce.AddressPuP"
SiteConfig.exe %SiteName% %SiteName% /Update:s_NumberOfServers="1"
SiteConfig.exe %SiteName% %SiteName% /Update:s_NonSecureHostname="%SiteHostName%"
SiteConfig.exe %SiteName% %SiteName% /Update:s_SecureHostname="%SiteHostName%"
SiteConfig.exe %SiteName% %SiteName% /Update:s_VirtualRootName="Store"
SiteConfig.exe %SiteName% %SiteName% /Update:f_EnableHTTPS="1"
SiteConfig.exe %SiteName% %SiteName% /Update:s_DirectoryIndexFiles="Default.aspx Default.asp Default.html Default.htm index.html index.htm#^~0"
SiteConfig.exe %SiteName% %SiteName% /Update:s_IPAddress="%SiteIPAddress%#^~0"
SiteConfig.exe %SiteName% %SiteName% /Update:s_IPPort="80#^~0"
SiteConfig.exe %SiteName% %SiteName% /Update:s_LocalDomain="#^~0"
SiteConfig.exe %SiteName% %SiteName% /Update:s_LogFileCodePage="0#^~0"
SiteConfig.exe %SiteName% %SiteName% /Update:s_LogFileDirectory="%LogFiles%#^~0"
SiteConfig.exe %SiteName% %SiteName% /Update:s_LogFilePeriod="1#^~0"
SiteConfig.exe %SiteName% %SiteName% /Update:s_LogType="1#^~0"
SiteConfig.exe %SiteName% %SiteName% /Update:s_SecureBindings="%SiteIPAddress%#:443:#^~0"
SiteConfig.exe %SiteName% %SiteName% /Update:s_SecureIPPort="443#^~0"
SiteConfig.exe %SiteName% %SiteName% /Update:s_ServerBindings="%SiteIPAddress%:80:%SiteHostName%#^~0"
SiteConfig.exe %SiteName% %SiteName% /Update:s_URLEncodingCodePage="0#^~0"
SiteConfig.exe %SiteName% %SiteName% /Update:s_UseHostName="#^~0"
SiteConfig.exe %SiteName% %SiteName% /Update:s_WebServerFullName="%ComputerName%/%SiteHostName%#^~0"
SiteConfig.exe %SiteName% %SiteName% /Update:s_WebServerInstance="%SiteIdentifier%#^~0"
SiteConfig.exe %SiteName% %SiteName% /Update:s_WebServerMachine="%ComputerName%#^~0"
SiteConfig.exe %SiteName% %SiteName% /Update:s_WebServerName="%SiteHostName%#^~0"
Unfortunately these sets of properties are the few that lack a description in the ExtendedProps table. I'll do my best to describe then:
s_ProgidPUP - Site Packager Module which is used to package/unpackage the site resource.
s_NumberOfServers - Number of web servers associated with the site.
s_NonSecureHostname - The domain name to use for non-secured links in your applications (General tab, "Nonsecure host name")
s_SecureHostname - The domain name for secured links in your applications (General tab, "Secure host name")
s_VirtualRootName - IIS application path (General tab, "IIS application path")
f_EnableHTTPS - Enable links to a secure HTTP host in your application (General tab, "Enable HTTPS")
s_DirectoryIndexFiles - Index files for the site
s_IPAddress - IP address of the site
s_IPPort - IP port of the site
s_LocalDomain - (Web Servers tab, "Local domain")
s_LogFileCodePage - (Log Files tab, "Log file code page")
s_LogFileDirectory - (Log Files tab, "Log file directory")
s_LogFilePeriod - (Log Files tab, "New Log Time Period")
s_LogType - Not sure where this shows up.
s_SecureBindings - (Identities tab, "SSL Identities")
s_SecureIPPort - Unsure where this shows up
s_ServerBindings - (Identities tab, "Identities")
s_URLEncodingCodePage - (Log Files tab, "URL encoding code page")
s_UseHostName - Unsure
s_WebServerFullName - Display name for the site (seen in the CSM tree under the Applications)
s_WebServerInstance - IIS site identifier
s_WebServerMachine - (Identities tab, "Server name")
s_WebServerName - Display name for the server instance
Hope that helps.
Cheers,
Colin