Skip to main content

Moving DotNetNuke From One Host To Another

Have you built a DotNetNuke site and now want to move DNN to production? Or, are you simply moving a DotNetNuke website 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 moving a DotNetNuke website from development to production, 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…


The following instructions are provided to minimize any downtime of the production domain/website, assuming there is an existing website running. 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.




DNS and Subdomains

First, we need to create subdomains. For this example, we will use dev.domain.com and prod.domain.com. 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, 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 www.domain.com to your dev box, you can leave it there for now. For those who do not know what DNS is, see How Stuff Works.

We use the service of DNS Made Easy. 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 monitoring (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.

Once you have the new subdomains created, make sure they are working by pinging from the server(s) or use something like DNS Stuff. If you cannot ping, make sure your firewall is setup correctly to accept and route HTTP traffic to the correct server.

If it’s working, then you are ready for the next step…

The Development DNN Installation

Login as Host and go to Host > Portals > Edit Portal > Portal Aliases > Add New HTTP Alias

Add the following aliases, assuming localhost is the only one created:

1. domain.com

2. www.domain.com

3. dev.domain.com

4. prod.domain.com

Copy the entire DNN folder on development box to the location on your production box where DNN will reside.

SQL Server Database on Development and Production

Go into Enterprise Manager or SQL Server Management Studio, development database server, and find your DotNetNuke database. Right click and go to Tasks > Detach. 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 (Tasks > Attach) 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. 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 Attach 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.

IIS on Production Box

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.

**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…

If this site is NOT replacing an existing and running domain/website, go ahead and add domain.com and www.domain.com host headers from Website Properties > Web Site Tab > Web site identification > Advanced Button. 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.

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.

For performance enhancements, and as a necessity if you are running both ASP.NET 1.1 AND ASP.NET 2.0 websites, create a new application pool for the website and a web garden as described in the following entry on IIS 6 Horticulture.

Production DNN folder

Within Windows Explorer, go to your production DNN folder, right-click and select Properties > Security and make sure Network Service has the proper permissions. Now, modify the web.config’s database connection string(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.

Testing it out…

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…

Going Live with DotNetNuke 4

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 www.domain.com and domain.com to the host headers to the new website if necessary. Try 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.

Updates to this post

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!
Regards
Rashid Imran Bilgrami
CEO Best visualization
www.bestvisualization.com

Comments

Popular posts from this blog

OLEDB jet 4.0 driver In Vista 64bit / he 'Microsoft.Jet.OLEDB.4.0' provider is not registered on the local machine

Well i think you must be thankful for me specailly for this research i am really getting the solution after 6 month research that is how to enable the oledb jet 4.0 driver in vista, i read arround 100s of articles and maximum said that is not possible to enable it and ala bla well at the end i got the answer that is so easy Acctually that is correct that oledb jet 4.0 driver is not avaialble for 64 bit but if you run your IIS on 32 bit instead of 64 then Oledb jet will working fine Here are the steps Click on the Start > Program > Administrative Tool > IIS Management panel Select the Computer name Right click on the application pool and select properties Select "TRUE" in Enable 32 Bit Application by default it is false Then this problem will resolve if you need any assitance then feel free to email me rashidbilgrami@hotmail.com Regards Rashid Imran Bilgrami CEO Best visualization www.bestvisualization.com

How to convert and crack windows server 2012 from Evaluation to Full

Dear All This is a way how you Convert Evalution to Full Step1: Open CMD and run following command DISM /online /Get-CurrentEdition <edition ID> is like ServerStandard with out Eval Step 2: DISM /online /Set-Edition:<edition ID> /ProductKey:XXXXX-XXXXX-XXXXX-XXXXX-XXXXX /AcceptEula WINDOWS SERVER 2012 Serial Key Windows Server 2012 DataCenter: 48HP8-DN98B-MYWDG-T2DCC-8W83P Datacenter: Y4TGP-NPTV9-HTC2H-7MGQ3-DV4TW Standard: XC9B7-NBPP2-83J2H-RHMBY-92BT4 Standard R2: DBGBW-NPF86-BJVTX-K3WKJ-MTB6V Server Essentials: K2XGM-NMBT3-2R6Q8-WF2FK-P36R2 For Standard R2 here is a command For R2 its like that DISM /online /Set-Edition:ServerStandard /ProductKey:DBGBW-NPF86-BJVTX-K3WKJ-MTB6V /AcceptEula Regards

SQL Agent disabled / how to enable SQL agent

Dear Readers, Today i found that SQL agent is disabled and i can active through the below process First you can check first these points Go to run type services.msc Right click on the SQL Server Agent (MSSQLSERVER) Then check in the properties your startup type might be disabled change it to automatic or manual and try again it will enable the start option If the above process not workable then check this one SQL Server blocked access to procedure 'dbo.sp_get_sqlagent_properties' of component 'Agent XPs' because this component is turned off as part of the security configuration for this server. A system administrator can enable the use of 'Agent XPs' by using sp_configure. For more information about enabling 'Agent XPs', see "Surface Area Configuration" in SQL Server Books Online. You need to run the following script under you SQL management Studio 1) Open the new query 2) Past the code sp_configure 'show