Upgrading to DotNetNuke 4.5.1 from 4.x 

Due to popular request this article is an updated version of my DNN upgrade process.  Below I will walk you through all steps necessary to upgrade your DNN website from a previous 4.x version to the most current version 4.5.1.  This article is based on my first upgrade document as well as incorporating new recommendations such as the use of an app_offline.htm file and other items of that nature to provide a better user experience, especially for those of us using shared hosting providers where the file copy process can take a while.  Users upgrading to other 4.x versions should be able to use this guide successfully, however, I know this works 100% for upgrades to 4.5.1

Getting Ready

Even though the upgrade process is fairly simple and should not result in any critical errors it is very important that you perform a FULL site and database backup prior to starting your upgrade.  Having a backup grants you a few options should a situation arise where your portal doesn't function correctly.  If you would like information on how to backup a DNN installation I have a blog posting regarding backup procedures here on this site.

Once you have completed your site backup you will want to download the DotNetNuke 4.5.1 UPGRADE package from the DotNetNuke website.  I will explain what you need to do with this momentarily.

The last item that you should do prior to starting  the upgrade process is to create an "app_offline.htm" file.  This is a simple HTML document that you can place in your DNN root directory and it will take your website offline.  This serves two purposes; first you prevent your users from experiencing any errors as the files are copying and secondly you prevent anyone else from accidentially triggering your upgrade process.  For my websites I simply put a notice that the site is temporarily unavailable due to upgrades in process, this same message will be displayed to visitors from ALL portals.

Configuring Your Setup

Now that your backups have been completed and you have the 4.5.1 upgrade package we are ready to actually perform the upgrade. First, you will want to rename your current web.config file to web.config.old. This will keep the file around as in a few moments we will be merging settings from this file into the new web config file.

Now you need to extract all files from the 4.5.1 upgrade package into your root DNN folder. You will need to confirm the overwriting of your files. Once this process has completed, rename the release.config file to web.config and perform the following tasks using the information from your web.config.old file

Update Connection Strings

Be sure that the proper connection strings are loaded for your setup, both in the <connectionstrings>and <appsettings> sections of your web config, examples are provided below.

<connectionStrings>
    

    
< add name="SiteSqlServer" connectionString="<yourconnectionhere>" providerName="System.Data.SqlClient" />
  
connectionStrings >
  
<appSettings>
    
<!-- Database connection string (SQL Server 2000 or 2005 - kept for backwards compatability - legacy modules -->
    
< add key="SiteSqlServer" value="<yourconnectionhere>" />
    

Turn off AutoUpgrade

By default DotNetNuke will be set to "AutoUpgrade", this means that the first user to hit the default.aspx page on any portal within your DNN installation will trigger the upgrade process.  This is typically not a desired result as if an error occurs you might not be able to see the error log since the other individual started the upgrade.  The way around this is to update the "AutoUpgrade" appSetting, if you set this to "false" you will be required to navigate to the <yoururl>/Install/Install.aspx page to perform the upgrade. 

<add key ="AutoUpgrade" value ="False" />
Copy Machine Key and Validation Key Values

Another very important item to copy over is your machine and validation keys. These are the keys used to encrypt and decrypt passwords and other information within your application. If you forget these items your users will not be able to login to the system. This declaration is typically just after the opening <system.web> tag. Below is an example of the machine key, the values you will be concerned with are the ones that note "<value to copy>".

<system.web>
    
< machineKey validationKey ="<value to copy>" decryptionKey="<value to copy>" decryption="3DES" validation="SHA1"  />
    
Copy CodeSubDirectories Section (if used)

Depending on the modules you have been using in your website you might have a <codeSubDirectories> section within your web config.  If you have this section and it is NOT commented out you must be sure to copy this section otherwise you will encounter a compile-time error.  DotNetNuke will automatically add this section if you installed a module that uses C# as its programming language rather than VB. If this section exists it is a sub-element of the <compiliation> section. Below is a sample of what this section might look like. NOTE: you might have multiple directory names listed

<codeSubDirectories> 
   
< add directoryName ="sub-directory name"/> 
<
codeSubDirectories >
Copy the InstallationDate Application Setting

The last standard configuration element that needs to be copied over is the InstallationDate key. This is used to identify the time of last installation, it is a good idea to copy this over even though it does appear to be an optional step according to DNN documentation. Below is the format for the key, it is contained within the <appSettings> section.

<add key ="InstallationDate" value ="9/21/2006" />
Copy any other custom configuration options

If you have customized any other configuration settings or added new sections to the configuration you will want to add those to your new web config file at this time.  One section you might want to quickly check is the httpRuntime section as many individuals have modified this section to allow for larger file uploads and you will want to be sure to copy those settings. Once you have completed this, it is time for the next and final step!

Start the Installation Process

After completing the above setup you are now ready to start the upgrade process.  You will want to delete your app_offline.htm file if you created one so that you can access your site again.  Now simply navigate to <yourSite>/Install/Install.aspx?mode=upgrade.  Once the page appears you should see a status screen that shows you the progress as the site is upgraded.  At the end you should see an upgrade complete message with a link to your portal.  You should not see ANY errors on this page, if you encountered an error be sure to note ALL information displayed so you can investigate the issues.

Please feel free to share any comments/concerns below!  If you have specific questions, please use my DotNetNuke forum to ask those questions!

Posted by Mitchel on Friday, May 04, 2007
 

Comments

After upgrading i lost my contnet .could you please tell me what mistake i mad bcz i have back copy i will do it again

Thanks heaps

By Sukh on Monday, May 07, 2007 at 6:55 PM

I have noticed a few other individuals reporting similar issues out on the DNN forums. Did you encounter any errors while the upgrade process completed?

Also, was the content only gone when logged in under administrative view?

By mitchel.sellers@gmail.com on Monday, May 07, 2007 at 6:58 PM

After going through all the process mentioned above ,when i run my application,lost my content

Thanks

By Sukh on Monday, May 07, 2007 at 7:35 PM

That is very interesting, hundreds of individuals have upgraded their sites following these directions, infact this site has been upgraded following the same steps.

Do you have any custom or 3rd party modules? Were there any error messages during the upgrade install?

By mitchel.sellers@gmail.com on Monday, May 07, 2007 at 7:39 PM

Mitchel
Could you please give me any idea where could be i made mistake, bcz i am new to dotnetnuke i developed my own one module only .

Thanks for your help

By Sukh on Monday, May 07, 2007 at 8:17 PM

It is hard to say...but here are a few things to try.

1. Look in the Event Log (Event Viewer) and see if you notice any error messages in there
2. Try to switch to a default DotNetNuke skin, this will determine if it is skin related
3. Let me know exactly what isn't displayed. (Is it all content to all users or just admins etc..)

By host on Monday, May 07, 2007 at 8:29 PM

Hi Mitchel
i upgrade again, its work for me it was bcz i modified my skin page in old version,I made same changes here now its looks everthing ok

Thanks heaps for you help

By Sukh on Monday, May 07, 2007 at 8:36 PM

I'm glad that you got it working, sometimes those little changes can cause big problems.

By host on Monday, May 07, 2007 at 8:53 PM

Hi Mitchell,
Made a backup of my site and put it on a development server to try to do the upgrade from 4.4.1 to 4.5.1. Couple things I noticed and learned from this:
1) Third party modules can create problems. I have dnnstuff aggregator all over my site and it broke every page and any other module on any page I had the module on. Even all my content vanished. The developer had a new release in advance of 4.5.1, and made specifically for it, so I was able to install the new release and it fixed all the problems. Moral of story - if you rely heavily on any 3rd party modules, make sure they are following the upgrade path and are testing their modules with the new dnn versions before performing any upgrades. Richard at dnnstuff did a great job at this.

Great tutorial,

Paul Sellers

By Paul Sellers on Tuesday, May 08, 2007 at 3:57 PM

Paul,

That is actually a GREAT recommendation, I should have added that in my tutorial. 3rd party modules can be a bit troublesome when upgrading!!

By mitchel.sellers@gmail.com on Tuesday, May 08, 2007 at 7:08 PM

This is a good article, but there seems to be some items missing that will extend the use of this article. These are:

1) In the web.config file, there is no “InstallationDate value”. How do one determine at correct date? In the catalog Providers\DataProviders\SqlDataProvider there are some version.log files. Can one determine installation date based on the date of the first version.log (in my case 03.01.01.log) file?

2) There is upgrade problems related to “04.05.01.SqlDataProvider Error!”. These problems seems to be related to SQL routines missing the case where ObjectQulaifyer has been used in the web.config file, and there is a procedure “add unique constraint to Folders table” that will not run. Is there now a recommended solution to thise problems that will not generate new problems in the future release av DotNetNuke? If so what are they?

By Dag on Tuesday, May 15, 2007 at 7:51 PM

Dag,

Your existing 4.x installation should have an installation date value within the appSettings section. If it doesn't exist, you can simply add it to your new web.config and simply ensure that the install date is prior to the date of your upgrade. The installation date is simply a way of ensuring that DNN doesn't try to change your machine key values on upgrade!

As for the issues with the SqlDataProviders with 4.5.1. I do know there have been some issues with the constraints on the folders and files tables used by the file manager. The best way to prevent these types of issues would be to review those tables for duplicate entries PRIOR to upgrading and remove any duplicates that might be found. This however is a fairly un-common issue I believe and is most likely related to a bug that existed in pre 4.4.1 days of DNN. (At least my error was introduced when my site was on 4.3.7).

By mitchel.sellers@gmail.com on Wednesday, May 16, 2007 at 2:53 AM

Tank you for answering!!
(I can’t believe the level of detail one has do go thru running a small website). In my case there are no InstallationDate under appSettings (needier in old web.config or new web.config). I will therefore take your advice!

In the 04.05.01.SqlDataProvider (..\Providers\DataProviders\SqlDataProvider) I have so far done the following changes due to ObjectQualifyer. These changes make may website function in the 2 server virtual test environment.

BEFORE:
/* correct any File folderpaths which do not match the value in the Folders table */
update {objectQualifier}Files
set Folder = FolderPath
from {objectQualifier}Folders
where {objectQualifier}Files.FolderID = {objectQualifier}Folders.FolderID
and Folder <> FolderPath
GO

AFTHER:
/* correct any File folderpaths which do not match the value in the Folders table */
update {databaseOwner}{objectQualifier}Files
set Folder = FolderPath
from {databaseOwner}{objectQualifier}Folders
where {databaseOwner}{objectQualifier}Files.FolderID = {databaseOwner}{objectQualifier}Folders.FolderID
and Folder <> FolderPath
GO

04.05.01.SqlDataProvider will still not run. It is not able to set the constraints rotine priour to the abow section. I can confirm that duplicate entries in the file module are present. I am also able to view these items in MS SQL Server Enterprise manager. Apparently i should delete <Null> records in the files; xxx_Folder and xxx_Files. And I understand that this must be done prior to upgrade.

Is the abow something that you can confirm?

By Dag on Wednesday, May 16, 2007 at 11:07 AM

Dag,

Yes, you should be 100% correct on all of the above. As for the removal of the duplicate records that assumption should be correct as well.

By Mitchel Sellers on Thursday, May 17, 2007 at 4:10 AM

Reporting back
I have done it. I am now reporting back my experience to others that may need it. In my case I could not delete records containing <Null> in the PortalID field. These records seems to relate to the super user account, and they existed in the catalog structure on disk. I therefore started with the xxx_Folders file. Using MS Access unique query, I found duplicates Folder Paths. Using these FolderIDs I then investigated the xxx_Files listing file names and investigating these items for duplications. A tedious job for me because I have some thousand screen shot files.

New question
Lest say that I have deleted a catalog and some files to many. Will the new version repopulate this in a correct manner using file manager in DotNetNuke after the upgrade?

By Dag on Thursday, May 17, 2007 at 11:16 AM

You can find the website your helping her: http://smallbizserver.no

By Dag on Thursday, May 17, 2007 at 11:20 AM

Dag,

That assumption should be correct, if you accidentally removed a file or folder from the list if you do a Syncronize Recursive on the file system it SHOULD grab any missing files.

As for removing the duplicates you can actually delete them all at once with a single SQL Query, keeping 1 record each...

By mitchel.sellers@gmail.com on Thursday, May 17, 2007 at 11:34 AM

DNN Upgrade from 4.37 to 4.51 It all went smoothly. The only thing different that It stated that my Database was 4.37

By Robert Shevlin on Sunday, May 27, 2007 at 12:35 PM

Comments from the following blog entry: Upgrading to 4.5.2 from 4.x, located at: http://www.mitchelsellers.com/Blogs/tabid/54/articleType/ArticleView/articleId/93/Upgrading-to-452-from-4x.aspx

By Mitchel's Personal Web Portal on Wednesday, May 30, 2007 at 8:27 AM

Comments from the following blog entry: Upgrading to 4.5.2 from 4.x, located at: http://www.mitchelsellers.com/Blogs/tabid/54/articleType/ArticleView/articleId/93/Upgrading-to-452-from-4x.aspx

By Mitchel's Personal Web Portal on Wednesday, May 30, 2007 at 8:27 AM

I followed the directions and what happens is I get a fully working install but my portal is gone. It looks like a fresh install not an upgrade? Any idea why it would do that?
This is my second try. After it did it he first time I restored everything and now the same deal. It removes my portal. When I select upgrade it then takes me through a few pages and I end up recreating the superuser and admin acount and naming the portal. After that it is the only portal on the system the new blank one.
Any Ideas?
Thanks,
Jeremy Palmer

By Jeremy Palmer on Wednesday, June 06, 2007 at 10:18 AM

Jeremy,

I would guess that you have an error with your database connection. Ensure that you updated the xonnection strings and that it is not accidentally commented out.

My guess is that it tried to modify the dynamically attachable database rather than your existing one.

By mitchel.sellers@gmail.com on Wednesday, June 06, 2007 at 10:31 AM

Hi,
following your instruction, i have upgraded dnn 4.4.1 to 4.5.4.

Thanks for the article.

By Ricky Wang on Tuesday, July 24, 2007 at 5:13 AM

Excellent procedure. Learned a lot from it.
I have some suggestions to improve it even further for next releases that you may wish to consider.
1. I usually prepare the new web.config on advance by extracting the new release.config from the zip package, and using the data from the current web.config that I ftp to my pc. This way I am not under pressure when creating it, as my site is not down when I am editing it. I minimize the chance for mistakes, and the time that the site is down.
2. Since my site has its own favicon.ico, I delete the favicon.ico from the zip package before using it. This way my site’s favicon does not get overwritten every time I upgrade.
3. In recent releases, one needs to edit the Search.ascx.resx file in admin/skins/App_LocalResources and change the &client= statement to his own Google AdSense account.
Cheers,
S.B.

By Badihi on Thursday, July 26, 2007 at 8:02 AM

badihi,

Those are very good recommendations. I will incorporate them in my new version which I am posting now!

By mitchel.sellers@gmail.com on Thursday, July 26, 2007 at 9:45 AM

Great tutorial! I ran into one problem upgrading two sites from 4.4.1 to 4.5.5 where the images don't display when I'm logged in. If I view the page source, it looks like the directory structure isn't pulled correctly. One my first site, I updated the source code to pull images based on relative path. I'd rather have users use the add image tool in the HTML editor. Any suggestions?

-T

By treihmann on Monday, November 26, 2007 at 5:21 AM

This is about the same process we go through when upgrading our DotNetNuke portals. Looks like a pretty good tutorial.

Third party modules can be an issue, but doing this particular upgrade I don't think we had any problems.

By DotNetNuke Consultant on Saturday, April 05, 2008 at 12:52 PM

Comments from the following blog entry: Guide for Upgrading DotNetNuke 4, located at: http://www.halhayes.com/blog/PermaLink,guid,6baf6fd3-84e2-40bb-9bb4-403e82abaac0.aspx

By Morning Compilation on Sunday, September 07, 2008 at 5:09 PM

Comments from the following blog entry: Guide for Upgrading DotNetNuke 4, located at: http://www.halhayes.com/blog/PermaLink,guid,6baf6fd3-84e2-40bb-9bb4-403e82abaac0.aspx

By Morning Compilation on Sunday, September 07, 2008 at 5:09 PM
Click here to post a comment

Disclaimer