May 27, 2008 - DotNetNuke    Comments Off on Moving DotNetNuke to a new server

Moving DotNetNuke to a new server

by [email=support@venexus.com:20lu5kr3]Jeff Smith[/email:20lu5kr3]

Source: <A href="http://dnnblog.venexus.com/PermaLink,guid,8900aa61-f975-4a8e-8e80-da2df3884241.aspx[SIZE=2?][color=#003300:20lu5kr3][/color:20lu5kr3][/SIZE]">http://dnnblog.venexus.com/PermaLink,guid,8900aa61-f975-4a8e-8e80-da2df3884241.aspx[size=100:20lu5kr3][color=#003300:20lu5kr3][/color:20lu5kr3][/size:20lu5kr3]

[size=100:20lu5kr3][color=#003300:20lu5kr3][/color:20lu5kr3][/size:20lu5kr3]
[size=100:20lu5kr3][color=#003300:20lu5kr3]Have you built a DotNetNuke site and now want
to [b:20lu5kr3]move DNN to production[/b:20lu5kr3]? Or, are you simply [b:20lu5kr3]moving a DotNetNuke website[/b:20lu5kr3] from one server to some other server? Over the last month I have seen several searches in the logs from people trying to find instructions on [i:20lu5kr3]moving a DotNetNuke website from development to production[/i:20lu5kr3], or simply from one server to another. After looking around for similar detailed instructions, I really did not see anything out there that really explained how to setup a IIS box for DotNetNuke, optimized and ready for production. So, I decided to provide instructions on how we do it…[/color:20lu5kr3][/size:20lu5kr3]
[size=100:20lu5kr3][color=#003300:20lu5kr3][/color:20lu5kr3][/size:20lu5kr3]
[size=100:20lu5kr3][color=#003300:20lu5kr3][/color:20lu5kr3][/size:20lu5kr3][size=100:20lu5kr3][color=#003300:20lu5kr3]The following instructions are provided to minimize any downtime of the production domain/website, assuming there is an existing website running.[/color:20lu5kr3][/size:20lu5kr3]

[size=100:20lu5kr3][color=#003300:20lu5kr3]
However, the same instructions can be applied for a brand new domain/website that does not have a critical execution plan. These instructions will have a basic assumption that you understand how to
manage IIS, DNS, and DNN. While we do not provide any guarantees to your particular setup, the following has worked well for us, managing the release of many DotNetNuke websites from our development environment to our production environment, while allowing continued development during the process. [/color:20lu5kr3][/size:20lu5kr3]
[size=100:20lu5kr3][color=#003300:20lu5kr3][/color:20lu5kr3][/size:20lu5kr3]
[size=100:20lu5kr3][color=#003300:20lu5kr3][/color:20lu5kr3][/size:20lu5kr3][b:20lu5kr3][size=100:20lu5kr3][color=#003300:20lu5kr3][SIZE=130]DNS and Subdomains[/size:20lu5kr3][/color:20lu5kr3][/SIZE][/b:20lu5kr3]
[b:20lu5kr3][size=100:20lu5kr3][color=#003300:20lu5kr3][/color:20lu5kr3][/size:20lu5kr3][/b:20lu5kr3]
[b:20lu5kr3][size=100:20lu5kr3][color=#003300:20lu5kr3][/color:20lu5kr3][/size:20lu5kr3][/b:20lu5kr3][size=100:20lu5kr3][color=#003300:20lu5kr3]First, we need to create subdomains. For this example, we will use [b:20lu5kr3]dev.domain.com[/b:20lu5kr3] and [b:20lu5kr3]prod.domain.com[/b:20lu5kr3]. Assuming the development environment you are currently working on is using just localhost, adding a subdomain for dev.domain.com may not be neccessary, but provides an easy way
to work with multiple domains and projects. Point DNS for dev subdomain to the IP address of your development box and point the prod subdomain to your production box IP. Leave, http://www.domain.com pointing to where ever you have it pointing currently, but turn your TTLs down to 5 seconds. If this is a new website, you may already be pointing http://www.domain.com
to your dev box, you can leave it there for now. For those who do not know what DNS is, see [URL=http://dnnblog.venexus.com/ct.ashx?id=8900aa61-f975-4a8e-8e80-da2df3884241&url=http%3a%2f%2fcomputer.howstuffworks.com%2fdns1.htm]How
Stuff Works[/URL].[/color:20lu5kr3][/size:20lu5kr3]
[size=100:20lu5kr3][color=#003300:20lu5kr3][/color:20lu5kr3][/size:20lu5kr3]
[size=100:20lu5kr3][color=#003300:20lu5kr3][/color:20lu5kr3][/size:20lu5kr3][size=100:20lu5kr3][color=#003300:20lu5kr3]We use the service of [url=http://dnnblog.venexus.com/ct.ashx?id=8900aa61-f975-4a8e-8e80-da2df3884241&url=http%3a%2f%2fwww.dnsmadeeasy.com%2fu%2f20029:20lu5kr3]DNS Made Easy[/url:20lu5kr3]. Hands down, this is the best business decision we have made concerning management of DNS. While their site is unfortunately not a DNN site, it provides the interface to get the job done quickly and easily. We use their Business Membership plan that allows us
to turn down our domain TTLs to 5 seconds. They offer 100% uptime and have servers globally
to handle DNS request. They also provide services for MX backup (your domain will still receive emails, even if your email server is down) and site moni to ring (pings your site to ensure it is up, sends notification if down). We have never had a problem, they have excellent support, and great prices for their services.[/color:20lu5kr3][/size:20lu5kr3]
[size=100:20lu5kr3][color=#003300:20lu5kr3][/color:20lu5kr3][/size:20lu5kr3]
[size=100:20lu5kr3][color=#003300:20lu5kr3][/color:20lu5kr3][/size:20lu5kr3][size=100:20lu5kr3][color=#003300:20lu5kr3]Once you have the new subdomains created, make sure they are working by pinging from the server(s) or use something like [url=http://dnnblog.venexus.com/ct.ashx?id=8900aa61-f975-4a8e-8e80-da2df3884241&url=http%3a%2f%2fwww.dnsstuff.com%2f:20lu5kr3]DNS Stuff[/url:20lu5kr3]. If you cannot ping, make sure your firewall is setup correctly to
accept and route HTTP traffic to the correct server.<?xml:namespace prefix = o /><o:p></o:p>[/color:20lu5kr3][/size:20lu5kr3]

[size=100:20lu5kr3][color=#003300:20lu5kr3]If it’s working, then you are ready for the next step…[/color:20lu5kr3][/size:20lu5kr3]
[size=100:20lu5kr3][color=#003300:20lu5kr3][/color:20lu5kr3][/size:20lu5kr3]
[size=100:20lu5kr3][color=#003300:20lu5kr3][/color:20lu5kr3][/size:20lu5kr3][b:20lu5kr3][size=100:20lu5kr3][color=#003300:20lu5kr3][SIZE=130]The Development DNN Installation [/size:20lu5kr3][/color:20lu5kr3][/SIZE][/b:20lu5kr3]
[b:20lu5kr3][size=100:20lu5kr3][color=#003300:20lu5kr3]
[/color:20lu5kr3][/size:20lu5kr3][/b:20lu5kr3][b:20lu5kr3][size=100:20lu5kr3][color=#003300:20lu5kr3]Login as Host[/color:20lu5kr3][/size:20lu5kr3][/b:20lu5kr3][size=100:20lu5kr3][color=#003300:20lu5kr3] and go to Host [b:20lu5kr3]> Portals > Edit Portal > Portal Aliases > Add New HTTP Alias[/b:20lu5kr3][/color:20lu5kr3][/size:20lu5kr3]

[size=100:20lu5kr3][color=#003300:20lu5kr3]Add the following aliases, assuming localhost is the only one created:[/color:20lu5kr3][/size:20lu5kr3][size=100:20lu5kr3][color=#003300:20lu5kr3]
1. [/color:20lu5kr3][/size:20lu5kr3][size=100:20lu5kr3][color=#003300:20lu5kr3]domain.com[/color:20lu5kr3][/size:20lu5kr3][size=100:20lu5kr3][color=#003300:20lu5kr3]
2. [/color:20lu5kr3][/size:20lu5kr3][size=100:20lu5kr3][color=#003300:20lu5kr3][url=http://www.domain.com:20lu5kr3]www.domain.com[/url:20lu5kr3][/color:20lu5kr3][/size:20lu5kr3][size=100:20lu5kr3][color=#003300:20lu5kr3]
3. [/color:20lu5kr3][/size:20lu5kr3][size=100:20lu5kr3][color=#003300:20lu5kr3]dev.domain.com[/color:20lu5kr3][/size:20lu5kr3]
[size=100:20lu5kr3][color=#003300:20lu5kr3]4. [/color:20lu5kr3][/size:20lu5kr3][size=100:20lu5kr3][color=#003300:20lu5kr3]prod.domain.com[/color:20lu5kr3][/size:20lu5kr3]

[size=100:20lu5kr3][color=#003300:20lu5kr3][/color:20lu5kr3][/size:20lu5kr3]
[size=100:20lu5kr3][color=#003300:20lu5kr3]Copy the entire DNN folder on development box to the location on your production box where
DNN will reside. [/color:20lu5kr3][/size:20lu5kr3]
[size=100:20lu5kr3][color=#003300:20lu5kr3][/color:20lu5kr3][/size:20lu5kr3]
[size=100:20lu5kr3][color=#003300:20lu5kr3][/color:20lu5kr3][/size:20lu5kr3][b:20lu5kr3][size=100:20lu5kr3][color=#003300:20lu5kr3][SIZE=130]SQL Server Database on Development and Production[/size:20lu5kr3][/color:20lu5kr3][/SIZE][/b:20lu5kr3]
[b:20lu5kr3][size=100:20lu5kr3][color=#003300:20lu5kr3][/color:20lu5kr3][/size:20lu5kr3][/b:20lu5kr3]
[b:20lu5kr3][size=100:20lu5kr3][color=#003300:20lu5kr3][/color:20lu5kr3][/size:20lu5kr3][/b:20lu5kr3][size=100:20lu5kr3][color=#003300:20lu5kr3]Go into [b:20lu5kr3]Enterprise Manager[/b:20lu5kr3] or [b:20lu5kr3]SQL Server Management Studio[/b:20lu5kr3], development database server, and find your DotNetNuke database. [b:20lu5kr3]Right click[/b:20lu5kr3] and go to [b:20lu5kr3]Tasks > Detach[/b:20lu5kr3]. Clear the connections if you have to. Once the database has been successfully detached, go to the folder where the database files live (.mdf and .ldf files) and make a copy of your DotNetNuke database and transaction log. If you simply made a copy of the file in the same folder, you can now reattach the database ([b:20lu5kr3]Tasks > Attach[/b:20lu5kr3]) so development can continue if other developers are working on your project, minimizing development downtime, plus have a backup of development database in case of unexpected issues. If you have a very small database, it may not be an issue just to copy and paste the files to the production server, assuming you are on the same network.
[/color:20lu5kr3][/size:20lu5kr3]

[size=100:20lu5kr3][color=#003300:20lu5kr3]However, our “development DNN database” is almost 3 Gb and takes a minute to move over to our production box. So, however you decide to do it, copy the .mdf and .ldf file to production database server. Rename them if necessary and [b:20lu5kr3]Attach [/b:20lu5kr3]the database similar to the way you detached. Refresh database view if necessary and ensure the database is accessible. If you want to create a custom SQL Server login on production for security reasons, now is the time to do it. [/color:20lu5kr3][/size:20lu5kr3]
[size=100:20lu5kr3][color=#003300:20lu5kr3][/color:20lu5kr3][/size:20lu5kr3]
[size=100:20lu5kr3][color=#003300:20lu5kr3][/color:20lu5kr3][/size:20lu5kr3][b:20lu5kr3][size=100:20lu5kr3][color=#003300:20lu5kr3][SIZE=130]IIS on Production Box[/size:20lu5kr3][/color:20lu5kr3][/SIZE][/b:20lu5kr3]
[b:20lu5kr3][size=100:20lu5kr3][color=#003300:20lu5kr3][/color:20lu5kr3][/size:20lu5kr3][/b:20lu5kr3]
[b:20lu5kr3][size=100:20lu5kr3][color=#003300:20lu5kr3][/color:20lu5kr3][/size:20lu5kr3][/b:20lu5kr3][size=100:20lu5kr3][color=#003300:20lu5kr3]Create a new website in IIS. Map the website to the DNN folder you created on Prod. For the initial host header, use prod.domain.com.[/color:20lu5kr3][/size:20lu5kr3]

[size=100:20lu5kr3][color=#003300:20lu5kr3]**Note**
DNN Documentation show creating Virtual Directories. We have had great success with configuring and managing DNN websites as actual websites, instead of virtual directories and would recommend this route for anyone who is planning on running this in a production environment to reap the benefits of IIS, especially IIS 6 and performance as discussed further down…[/color:20lu5kr3][/size:20lu5kr3]
[color=#003300:20lu5kr3][size=100:20lu5kr3]

[SIZE=100][COLOR=#003300]If this site is NOT replacing an existing and running domain/website, go ahead and add domain.com and http://www.domain.com host headers from [b:20lu5kr3]Website Properties > Web Site Tab > Web site identification > Advanced Button. [/b:20lu5kr3]If you use internal IP addresses (Firewall routes the HTTP traffic), make sure you have the right IP addresses and port specified. By default HTTP traffic runs on port 80.[/color:20lu5kr3][/size:20lu5kr3]

[size=100:20lu5kr3][color=#003300:20lu5kr3]If this is a DNN 4 install, make sure you change ASP.Net version to 2.0 from the ASP.NET tab in Web site propoerties. [/color:20lu5kr3][/size:20lu5kr3]
[size=100:20lu5kr3][color=#003300:20lu5kr3][/color:20lu5kr3][/size:20lu5kr3]
[size=100:20lu5kr3][color=#003300:20lu5kr3][/color:20lu5kr3][/size:20lu5kr3][size=100:20lu5kr3][color=#003300:20lu5kr3]For performance enhancements, and as a necessity if you are [url=http://dnnblog.venexus.com/ct.ashx?id=8900aa61-f975-4a8e-8e80-da2df3884241&url=http%3a%2f%2fdnnblog.venexus.com%2fRunning%2bNet%2b11%2bAnd%2b20%2bFor%2bMultiple%2bDNN%2b3x%2bAnd%2bDNN%2b4x%2bInstallations%2bIn%2bIIS%2b6.aspx:20lu5kr3]running both ASP.NET 1.1 AND ASP.NET 2.0 websites[/url:20lu5kr3], create a new application pool for the website and a web garden as described in the following entry on [url=http://dnnblog.venexus.com/ct.ashx?id=8900aa61-f975-4a8e-8e80-da2df3884241&url=http%3a%2f%2fdnnblog.venexus.com%2fIIS%2b60%2bHorticulture%2bAnd%2bDotNetNuke.aspx:20lu5kr3]IIS 6 Horticulture[/url:20lu5kr3]. [/color:20lu5kr3][/size:20lu5kr3]
[size=100:20lu5kr3][color=#003300:20lu5kr3][/color:20lu5kr3][/size:20lu5kr3]
[size=100:20lu5kr3][color=#003300:20lu5kr3][/color:20lu5kr3][/size:20lu5kr3][b:20lu5kr3][size=100:20lu5kr3][color=#003300:20lu5kr3][SIZE=130]Production DNN folder[/size:20lu5kr3][/color:20lu5kr3][/SIZE][/b:20lu5kr3]
[b:20lu5kr3][size=100:20lu5kr3][color=#003300:20lu5kr3][/color:20lu5kr3][/size:20lu5kr3][/b:20lu5kr3]
[b:20lu5kr3][size=100:20lu5kr3][color=#003300:20lu5kr3][/color:20lu5kr3][/size:20lu5kr3][/b:20lu5kr3][size=100:20lu5kr3][color=#003300:20lu5kr3]Within [b:20lu5kr3]Windows Explorer[/b:20lu5kr3], go to your production DNN folder, [b:20lu5kr3]right-click[/b:20lu5kr3] and select [b:20lu5kr3]Properties > Security[/b:20lu5kr3] and make sure [b:20lu5kr3]Network Service[/b:20lu5kr3] has the proper permissions. Now, [b:20lu5kr3]modify the web.config’s database connection string[/b:20lu5kr3](s) (2 of them for DNN 4) to the production database server and production database. If you created new SQL Server accounts for access, you will want to update the id and pass as well.[/color:20lu5kr3][/size:20lu5kr3]
[size=100:20lu5kr3][color=#003300:20lu5kr3][/color:20lu5kr3][/size:20lu5kr3]
[size=100:20lu5kr3][color=#003300:20lu5kr3][/color:20lu5kr3][/size:20lu5kr3][b:20lu5kr3][size=100:20lu5kr3][color=#003300:20lu5kr3][SIZE=130]Testing it out…[/size:20lu5kr3][/color:20lu5kr3][/SIZE][/b:20lu5kr3]
[b:20lu5kr3][size=100:20lu5kr3][color=#003300:20lu5kr3][/color:20lu5kr3][/size:20lu5kr3][/b:20lu5kr3]
[b:20lu5kr3][size=100:20lu5kr3][color=#003300:20lu5kr3][/color:20lu5kr3][/size:20lu5kr3][/b:20lu5kr3][size=100:20lu5kr3][color=#003300:20lu5kr3]First, open up a command prompt and make sure you can ping prod.domain.com and dev.domain.com. You should get the production IP address for prod.domain.com and the development server IP address for dev.domain.com. Now try to navigate to prod.domain.com in a web browser. If you get a successful page load, you now can do your testing to ensure everything is there and working. Since you created a subdomain for dev.domain.com, you can do your development as needed, test, and when ready, move to production. Periodic replication of the database from Production to Development allows you to
keep a development environment that closely resembles your production environment. If you have tested everything and are sure the prod.domain.com is working correctly, you are ready to go live…[/color:20lu5kr3][/size:20lu5kr3]
[size=100:20lu5kr3][color=#003300:20lu5kr3][/color:20lu5kr3][/size:20lu5kr3]
[size=100:20lu5kr3][color=#003300:20lu5kr3][/color:20lu5kr3][/size:20lu5kr3][b:20lu5kr3][size=100:20lu5kr3][color=#003300:20lu5kr3][SIZE=130]Going Live with DotNetNuke 4[/size:20lu5kr3][/color:20lu5kr3][/SIZE][/b:20lu5kr3]
[b:20lu5kr3][size=100:20lu5kr3][color=#003300:20lu5kr3][/color:20lu5kr3][/size:20lu5kr3][/b:20lu5kr3]
[b:20lu5kr3][size=100:20lu5kr3][color=#003300:20lu5kr3][/color:20lu5kr3][/size:20lu5kr3][/b:20lu5kr3][size=100:20lu5kr3][color=#003300:20lu5kr3]Okay, so you have tested and are confident that the site is ready for primetime. First, go ahead and change your DNS settings to point domain.com traffic to the production server IP address. With IIS Manager open, stop the old website if one was running and add http://www.domain.com and domain.com to the host headers to the new website if necessary. Try http://www.domain.com and it should work. You now have a live DNN site. Assuming all went well, you can turn your TTLs back up in DNS for better caching.[/color:20lu5kr3][/size:20lu5kr3]
[size=100:20lu5kr3][color=#003300:20lu5kr3][/color:20lu5kr3][/size:20lu5kr3]
[size=100:20lu5kr3][color=#003300:20lu5kr3][/color:20lu5kr3][/size:20lu5kr3][b:20lu5kr3][size=100:20lu5kr3][color=#003300:20lu5kr3][SIZE=130]Updates to this post[/size:20lu5kr3][/color:20lu5kr3][/SIZE][/b:20lu5kr3]
[b:20lu5kr3][size=100:20lu5kr3][color=#003300:20lu5kr3][/color:20lu5kr3][/size:20lu5kr3][/b:20lu5kr3]
[b:20lu5kr3][size=100:20lu5kr3][color=#003300:20lu5kr3][/color:20lu5kr3][/size:20lu5kr3][/b:20lu5kr3][size=100:20lu5kr3][color=#003300:20lu5kr3]I hope you have found this useful. If you have any suggestions, please write a comment and share your experiences. I will try to keep this entry updated if I come across any other tips or updates and eventually may even get around to adding some pictures for futher help. Stay tuned![/color:20lu5kr3][/size:20lu5kr3]