Migrating DotNetNuke From Development to Remote Production
Recently I have been answering a large number of questions regarding the processes
to deploy an existing development site from localhost to a remote hosting provider.
Typically this has been something that I was not willing to publish a tutorial on
due to the complex nature of the matter and the major differences between hosting
providers. However, due to popular demand this article will be my first documentation
of the end to end process to move a localhost DotNetNuke installation to a production
environment on shared hosting. I will be basing this article on the proceses
that are needed to deploy to 3Essentials which is my hosting provider of choice,
the process is similar for other hosts, but there may be charges or other complications
introduced.
Assumptions/Preface
Prior to starting the step-by-step process of migration I want to lay out the assumptions
that are being made PRIOR to starting this process. First and foremost you
have a local installation of DotNetNuke installed on you machine. This article
assumes that you followed the process I set forth in my "Installing DotNetNuke 4.8.2
Locally" which used a SQL Server specific database and did not utilize the dynamic
attachment feature. If you used dynamic attachment or are using SQL Server
2000 your process will be different for the database preparation steps below.
Additionally prior to starting this deployment it is expected that you have a hosting
account established with a hosting provider that supports ASP.NET 2.0, SQL Server
2005, and already have a domain name pointing to the account. These setup/prerequisites
are required to ensure a smooth transition from development to production.
This tutorial will be divided into multiple sections starting with DotNetNuke Preparation,
Hosting Provider Preparation, DotNetNuke Migration, and wrapping up with Testing.
This will take you step by step through the process and will complete the tasks
in an order to minimize the time to deploy and to minimize complication/confusion
for those new to this process.
DotNetNuke Preparation
This step is one of the most commonly overlooked portions of the development to
production process. DotNetNuke uses portal aliases to determine which portal
is associated with each respective incoming URL. If a DNN site is moved to
a new URL and a portal alias doesn't exist for the URL problems will be encountered.
Although possible to configure later, it is strongly advised to complete the portal
alias addition prior to deployment as it makes the process that much smoother.
To add a portal alias you must login as the host user and then navigate to "Admin"
-> "Site Settings". On this page scroll to the bottom until you see this
section.

You will then click on the 'Add HTTP Alias' link to add an alias. Simply input the
production URL in the textbox and click 'Add New Alias'

be sure to enter just the domain
name and no trailing forward slash as that will cause issues after the site is moved.
So for a site hosted on mysite.com the alias is simply mysite.com. Once yoou have
completed this step you are now ready to prepare the hosting environment to accept
DotNetNuke.
Preparing the Hosting Environment
As I mentioned before this tutorial is based on deploying to 3Essentials other providers might require different steps, or might have different processes
for deployment. The only host that I know that can cause a very large problem
is GoDaddy as they do not support root installations. If you have any questions
about this section and your hosting provider please post to the forums on this site
and I will do what I can to point you in the right direction.
Preparing the hosting environment is a step that is very important as it ensures
that you will have a properly configured site going foward and minimizes the chances
of errors appearing later on in the process. I have divided this section into
2 separate steps as you have two distinct operations that you must validate
Validate ASP.NET Permissions
When you completed your local installation you went through the process to ensure
that the ASP.NET worker process had proper permissions to your DNN installation,
well the same thing is needed when moving the site to a hosting provider.
In the case of 3Essentials to fully validate the permissions you will need to submit a support request to have
them modify the root file permissions. Other hosting providers might provide
permission tools, however, if using one of those be sure that you can modify the
root permissions as well. With 3Essentials You can simply submit the following request to support, obviously replacing mysite.com
with your domain name.
Support,
Please modify the root file permissions for mysite.com to ensure that the ASP.NET
Worker process has full permissions to all files/folders for my DNN Installation.
I have worked with their support team enough to know that this is more than enough
for them to get things up and going.
Validate ASP.NET Version
Another item that you must validate when depoying to a remote hosting provider is
that the proper ASP.NET version is enabled for your installation. For DotNetNuke
4.x you will need version 2.0.50727, for prior versions you will need 1.1.
Most hosting providers including 3Essentials allow you to validate this setting
in your site settings. With 3Essentials 2.0.50727 is the default version.
Configure Blank Database
In the next step of the process we will migrate your existing database to the hosting
provider, however, before we can do this a new clean database must be created.
You can do this via the Plesk control panel provided by 3Essentials. Simply
go in an create a database (It does not have to have the same name) and then additionally
create a new database user. When creating the database user please be sure
to use a DIFFERENT username than the one that was used on your local installation,
this helps to avoid issues with orphaned user accounts. Once complete be sure
to remember the database name, username, and password of the items you created we
will need these in later steps.
If you have problems with this step of the instructions please refer to your hosting
providers support process.
Migrating DotNetNuke
Now that all preparation steps are out of the way we can actuall perform the migration
of DotNetNuke. I recommend doing this this in a 3 phase process which will
be outlined below as this will help you ensure that all processes have been handled
successfully. Before continuing please ensure that ALL above listed steps
have been completed as if any are not complete you can encounter errors.
Backup and Migrate Database
The first step in moving your DotNetNuke site is to move the database from your
local system to the hosting provider. The easiest method to complete this
is to simply complete a SQL Server backup and then FTP this to your provider for
restoring. I will now walk you though this process using SQL Server Management
Studio (Express). If you are working with SQL Server 2005 this process will
be slightly different.
With SQL Server Management Studio (SSMS) open right click on your DotNetNuke Database,
in our case it is TestDNN, from the menu that appears select "Backup.." from the
"Tasks" menu item.

Now you will be presented with a backup window. In this window take note of the
backup location listed in the "Destination" section, then click "Ok" to complete
the backup procedure.

Once this has been completed you will want to take the .bak file that was created
and FTP it to your hosting provider. With 3Essentials I like to place files such as this inside the /private folder in the FTP area as
these files are NOT available any other way than FTP. Once you have FTP'ed
the file to the hosting provider you can then submit the following request to them
for support. Please replace [BACKUPFILE], [NEWDATABASE], and [DOMAIN] with
the proper values for your installation.
Support,
I have just uploaded a SQL Server database backup file to the /Private/[BACKUPFILE] folder on my
FTP location. Can you please take this SQL Server backup file and overwrite the [NEWDATABASE]
that currently exists for my domain [DOMAIN]. This will allow me to migrate my DNN site
to your server. Please delete the .bak file upon successful restore
This completes the first portion of the migration. You may proceed to the next step while your hosting provider performs the database restore. I have found that
I typically receive response from my provider within a few hours.
Migrate DotNetNuke Files
This step is the most simple of all DNN migration steps. Simply FTP all files
from your local DNN installation to your hosting providers site.. With 3Essentials
the /httpdocs/ folder is your webroot, just be sure when uploading files that you
are placing them in the proper location. If you have your local installation
in a sub folder (localhost/dnn) or something similar you do NOT have to keep that
setup, however, until you look at my "notes" section at the end of the article you
might have a few issues if removing a sub folder.
When loading the files to your remote host, be 100% sure that all files transfer
successfully. FTP programs commonly will encounter copy errors with such large
file copies as a DNN installation and will not notify you of errors. Therefore
I highly recommend copying files one folder at a time to ensure that you get all
files up successfully.
Modify Web.config Settings
This is the final step of your DotNetNuke migration, validating/modifying your web.config
settings to point to the new database. You cannot complete this step until
all above steps have been completed, as completing this prior to the restoring of
the database will cause issues when you go to test the site out in the next step.
Using the information that you obtained when preparing the hosting environment you
will want to update your web.config file to point to your hosting provider's database.
I personally recommend doing this in the following manner. Download a copy
of the web.config from your FTP location. Then open this file in Visual Studio
and modify the connection information. Remember you have 2 connection strings
to modify and you want to make sure that both are now pointing to the proper database
server and database. Once you have the file updated, simply re-upload the
modified file.
Following this process you are able to keep your local installation intact and still
migrate to production. Please note that if you have any questions on the proper
formatting of the connection strings or the items to modify, please refer to my
installation guides as they provide detailed information regarding the the connection
strings.
Testing the Migration
If you have made it this far you have now completed the migration of your site.
You will now want to validate that everything is still functioning properly.
If you moved from a location with a sub folder to a root installation please see
the "Missing Images?" section below for information on how to quickly resolve issues
with missing images inside Text/HTML module instances. Below I will walk through
a few common "breaking" points when migrating, this isn't an all inclusive listing
but should cover most of the key items that are common.
Images Not Appearing
If you find that you have images that are not appearing that have been linked inside
Text/HTML module instances and you migrated from an installation inside of a sub
directory to a root installation you will need to modify the image links.
If for example you had your development site at http://localhost/dnn and your production
site at http://www.mysite.com your image links inside the Text/HTML module would
have a path of /dnn/portals... you need them to be /portals to work successfully
inside your production system.
Luckily I have an easy solution to resolve this issue. My Text/HTML Replacement
Tool that is available on this site will give you exactly what you need to fix the
links. Using this tool you can match on the following (without quotes) "/dnn/"
and replace it with (again without quotes) "/". This will resolve all borken
links for instances of the sub-folder dnn being prefixed to image paths. After
using this tool you must remember that you must flush the application cache by clicking
"Restart application" to see the changes.
Repository Files Not Downloading
If you receive file not found errors, or simply do not get files on repository module
instances you will need to update the file path to the physical file store which
is stored inside the settings for each respository listing. If you are unsure
of the proper file path, you can build the path using the base path information
available via the "Host Settings" section of your site.
Conclusion
In conclusion I hope that this article has helped you migrate your development site
to a production environment with a remote hosting provider. This is a first
revision of this tutorial so please share any feedback or comments that you have
on this process and I will continue to upgrade this document as I do with my other
tutorials. If you have technical questions with an migration that you have
performed please make a post in my forum for assistance.
Posted by Mitchel on Monday, May 19, 2008
Click here to post a comment