Upgrading to DotNetNuke 4.6.0 from 4.x 

This is my fourth revision DNN Upgrade guide.  This version of the document includes important updates for the upgrade process to DotNetNuke 4.6.  Many portions of this upgrade guide are the same as previous versions, however, there are some new items.  This is simply due to the LIMITED changes that have truly occured in the area of DotNetNuke upgrades.

This guide is geared towards performing an upgrade in-place directly to the server.  If you are on a hosted web server you will need to make modifications to the instructions to fit your access to the production environment.  Additionally I STRONGLY suggest attempting to perform an upgrade locally BEFORE you update a production hosted site to check all processes.

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 you may view my "Backing up a DNN site and database" tutorial.

Once you have completed your site backup you will want to download the DotNetNuke 4.6.0 install package from the DotNetNuke website.  I will xplain what you need to do with this momentarily.  For those that have used my install guides in the past I have changed my opinion on the usage of the install/upgrade packages.  I have found that it is just overall much safer to use the "install" package to do the upgrade, and you get the upgraded core modules at the same time, using this I have found my upgrade times to be a small amount faster, you may still use the "upgrade" version if you desire working from a 4.x upgrade.

Once you have the backups in place if you have a favicon.ico file saved for your website that is different than the standard DotNetNuke one you will want to temporarily re-name this file to something like favicon_site.ico so that it will not get overwritten in the upgrade process.  A second alternative to this would be to stage the upgrade on another folder before overwriting and remove the favicon.ico file from the upgrade files. 

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.6.0 package downloaded 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.6.0 install 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. (NOTE: You will need to delete any existing web.config file before renaming release.config, be 100% sure that you have a backup of your origional file before doing this!)

NOTE: if you are on a shared hosting environment you are most likely completeting these changes on your local machine and can still have your production site active.  This depends soley on how/where you are extracting files.

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.  With these settings remember that you should only have 1 value per section. 

<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.  If you have installed dnn 4.5 and later only this setting most likely will NOT exist in your web.config and should not cause any difficulties.

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

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.  If you are directed towards an "Under Construction" webpage please simply try this request again.  In my testing with DNN 4.6 I noticed that evey couple of installs would result in this direction on the first attempt at upgrading.

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.  This status screen should look like the following.

Upgrade progress screen

Modify Search Localization Files

One new item that is recommended after upgrading to 4.6.0 is to modify the localization file for the search.ascx control to include your own Google Adsense id rather than the one for DotNetNuke. If you do not have your own Google AdSense id you can get it from the Google AdSense website. You can modify this value by using the language editor and navigating under Admin/Skins/App_LocalResources/Search.ascx.resx. The value you need to change is directly after the "&client=" portion of the URL. This way you get credit for the adsense links!

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 Monday, September 17, 2007
 

Comments

Hi Mitchel,

I just want to point out that in the ‘Getting Ready’ section, you say ‘I have found that it is just overall much safer to use the "install" package to do the upgrade… ‘

Then in the ‘Configuring Your Setup’ section you say ‘Now you need to extract all files from the 4.5.5 upgrade package into your root DNN folder’.

This is confusing to me. I am guessing that you mean we should extract all files from the 4.6.0 Install folder, right?

Frank

By Frank on Monday, September 17, 2007 at 7:56 AM

Frank,

You are correct. I have modified the article, I had copied my previous version of this article as a template and missed that small change. I apologize for the confusion.

By mitchel.sellers@gmail.com on Monday, September 17, 2007 at 8:23 AM

For those of us upgrading from 4.5.5 are there many (or any?) differences in the web.config file? Is there anything stopping us from "reusing" the web.config file of our existing installations when upgrading? If there are new entries in the web.config with this new version can they be copy and pasted into the v4.5.5 web.config file instead of what you propose?

By eoghano on Monday, September 17, 2007 at 8:59 AM

From what I can tell there are no differences with the web.config file, however, I am not 100% sure of that.

Yes, you could just merge new changes into your existing one, just regardless make sure that all items are there.

By mitchel.sellers@gmail.com on Monday, September 17, 2007 at 9:08 AM

I have tried the upgrade on my local machine, a test version, and at first I got a bunch of errors having to do with mmissing tables and stored procedure, having to do with 'Packages'. I found the scripts to create them, ran them successfully, and now I get an huge error that I have no idea what to do about. Could you please spare a moment and take a look? The error is as follows:
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentNullException: Value cannot be null.
Parameter name: type

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[ArgumentNullException: Value cannot be null.
Parameter name: type]
System.Activator.CreateInstance(Type type, Boolean nonPublic) +2768503
DotNetNuke.Framework.Reflection.CreateObject(String ObjectProviderType, String ObjectProviderName, String ObjectNamespace, String ObjectAssemblyName, Boolean UseCache) +582
DotNetNuke.Framework.Reflection.CreateObject(String ObjectProviderType, String ObjectNamespace, String ObjectAssemblyName) +17
DotNetNuke.Security.Membership.Data.DataProvider.CreateProvider() +38
DotNetNuke.Security.Membership.Data.DataProvider..cctor() +13

[TypeInitializationException: The type initializer for 'DotNetNuke.Security.Membership.Data.DataProvider' threw an exception.]
DotNetNuke.Security.Membership.Data.DataProvider.Instance() +0
DotNetNuke.Security.Membership.AspNetMembershipProvider..cctor() +5

[TypeInitializationException: The type initializer for 'DotNetNuke.Security.Membership.AspNetMembershipProvider' threw an exception.]

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck) +0
System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache) +103
System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache) +261
System.Activator.CreateInstance(Type type, Boolean nonPublic) +66
DotNetNuke.Framework.Reflection.CreateObject(String ObjectProviderType, String ObjectProviderName, String ObjectNamespace, String ObjectAssemblyName, Boolean UseCache) +582
DotNetNuke.Security.Membership.MembershipProvider.CreateProvider() +38
DotNetNuke.Security.Membership.MembershipProvider..cctor() +13

[TypeInitializationException: The type initializer for 'DotNetNuke.Security.Membership.MembershipProvider' threw an exception.]
DotNetNuke.Security.Membership.MembershipProvider.Instance() +0
DotNetNuke.Entities.Users.UserController..cctor() +5

[TypeInitializationException: The type initializer for 'DotNetNuke.Entities.Users.UserController' threw an exception.]
DotNetNuke.Entities.Users.UserController.GetUserCountByPortal(Int32 portalId) +0
DotNetNuke.Entities.Portals.PortalInfo.get_Users() +17
DotNetNuke.Entities.Portals.PortalSettings.GetPortalSettings(Int32 TabId, PortalAliasInfo objPortalAliasInfo) +1302
DotNetNuke.Entities.Portals.PortalSettings..ctor(Int32 tabId, PortalAliasInfo objPortalAliasInfo) +83
DotNetNuke.HttpModules.UrlRewriteModule.OnBeginRequest(Object s, EventArgs e) +2848
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +92
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64


By Frank on Monday, September 17, 2007 at 9:43 AM

Frank,

It appears that it is erroring when creating the membership provider. Are you sure that all files copied successfully? Which version did you upgrade from? Also did you get any errors during the install.aspx page processing? If so what were they.

Also, could you please migrate this discussion to my forum?

By mitchel.sellers@gmail.com on Monday, September 17, 2007 at 12:36 PM

I followed this process to upgrade two sites. In the first I navigated to install/install.aspx and sae the upgrade screen. However, in the second upgrade I forgot that step and I navigated directly to the root of the website. It took a while to show, then it showed up. The site looks like upgraded properly. Is there any side-effects of doing so?
Thanks

By Alan on Tuesday, September 18, 2007 at 1:27 PM

Alan,

You should be fine, I would login as the host user and validate that the version shows 4.6.0 correctly.

By mitchel.sellers@gmail.com on Tuesday, September 18, 2007 at 1:35 PM

Great post - works like a treat. One point is that I would put the portals offline before starting the backups to ensure that no changes are made after the backups are complete.

By Steve Finn on Tuesday, September 25, 2007 at 4:06 PM

Hi,

I've tried to upgrade my DNN v 4.0x to 4.6 following your post but now I've a problem:

Upgrade progress seem to be ok, but when I try to log in my sites (host or portals) this Message appears:

"Module Load Warning
One or more of the modules on this page did not load. This may be temporary. Please refresh the page (click F5 in most browsers). If the problem persists, please let the Site Administrator know."
and I can't to see login Module.

One thing I've also saw is that when I've upgrade my old version, the success message was
"Upgrading DotNetNuke
Current Assembly Version: 04.05.03
Current Database Version: 04.06.02

Upgrade Status Report
00: - Upgrading to Version: 4.5.3
00: - Performing General Upgrades

Upgrade Complete"

and not
"Current Assembly Version: 04.06.02
Current Database Version: 04.05.03
" or similar like your post.

I really don't understand what is happening, have you some suggest?

Really thaks for every helpful response,

Marco

By marco on Monday, October 08, 2007 at 12:13 AM

Marco,

Make sure that all files copied and installed. Especially the DesktopModules/AuthenticationService folder (I believe that is the name).

If you need further assistance please migrate this posting to my forum!

By mitchel.sellers@gmail.com on Monday, October 08, 2007 at 4:44 PM

You may wish to mention that if you use the install (vice upgrade) that the database.mdf file must be deleted from the app_data directory if your prestage before copying:-)

By Rober Flynn on Monday, October 15, 2007 at 11:47 AM

Rober,

That is a good point, I recommend against using the dotnetnuke.mdb file at all so I bypassed it in my instructions..

By mitchel.sellers@gmail.com on Monday, October 15, 2007 at 3:14 PM

Hi,
The index.html "blocker" didn't work for me in inside tabs. The message appeared only at the domain.com or alias .com. what should I do?
Thanks.

By Avi on Wednesday, November 07, 2007 at 3:10 AM

Dear All,
It's was very useful for me to follow instructions above.

Only difference is that I haven't overwritten database.mdf.

Is correct my approach? .. I suppose that if DB is overwritten I lose all my configuration.

Thanks
Ale

By Ale on Saturday, November 17, 2007 at 4:42 AM

Ale,

Yes, if you are using the database.mdf dynamically attached you are 100% correct you don't want to overwrite that file!!

By mitchel.sellers@gmail.com on Saturday, November 17, 2007 at 11:11 AM

Great post, but please add to be sure to compare the <data> section. I had added an object qualifier in my original install (per a recomendation), but missed it during the upgrade. This may resolve the issue the user had in an earlier comment.

<data
defaultProvider="SqlDataProvider">
<providers>
<clear/>
<add
name="SqlDataProvider"
type="DotNetNuke.Data.SqlDataProvider, DotNetNuke.SqlDataProvider"
connectionStringName="SiteSqlServer"
upgradeConnectionString=""
providerPath="~\Providers\DataProviders\SqlDataProvider\"
objectQualifier="dnn_"
databaseOwner="dbo"/>
</providers>

By Clint on Monday, November 19, 2007 at 1:42 PM

I'm trying to upgrade my local version from 4.3.7 to 4.6.2 and I am receiving the following errors:
I was trying to upgrade to 4.8.0 but saw comment about upgradeing to 4.6.2 first



Upgrading DotNetNuke
Current Assembly Version: 04.06.02
Current Database Version: 04.03.07



Upgrade Status Report
00:00:00.171 - Upgrading to Version: 4.6.2
00:00:00.359 - Executing Script: 04.04.00.SqlDataProvider Error! (see 04.04.00.log for more information)
00:00:03.296 - Executing Script: 04.04.01.SqlDataProvider Success
00:00:03.578 - Executing Script: 04.05.00.SqlDataProvider Success
00:00:08.218 - Executing Script: 04.05.01.SqlDataProvider Success
00:00:08.796 - Executing Script: 04.05.02.SqlDataProvider Success
00:00:15.875 - Executing Script: 04.05.03.SqlDataProvider Success
00:00:16.093 - Executing Script: 04.05.04.SqlDataProvider Success
00:00:16.328 - Executing Script: 04.05.05.SqlDataProvider Success
00:00:16.406 - Executing Script: 04.06.00.SqlDataProvider Success
00:00:18.890 - Executing Script: 04.06.01.SqlDataProvider Success
00:00:18.906 - Executing Script: 04.06.02.SqlDataProvider Success
00:00:18.921 - Performing General Upgrades
00:00:36.125 - Installing Module File Adsense_01.00.01_Install: Success
00:00:45.593 - Installing Module File Announcements_03.03.05_Install: Success
00:00:45.625 - Installing Module File Blog_3.02.00_Install: Success
00:01:30.578 - Installing Module File Contacts_3.1_Install: Success
00:01:39.140 - Installing Module File Documents_03.01.05_Install: Success
00:01:39.171 - Installing Module File Events_3.2_Install: Success
00:02:12.156 - Installing Module File FAQs_3.1_Install:




--------------------------------------------------------------------------------

Server Error in '/DotNetNuke' Application.
--------------------------------------------------------------------------------

Thread was being aborted.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Threading.ThreadAbortException: Thread was being aborted.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[ThreadAbortException: Thread was being aborted.]
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +312
System.Web.ApplicationStepManager.ResumeSteps(Exception error) +2616819
System.Web.HttpApplication.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData) +214
System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +474




--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433

By skidwell on Wednesday, February 06, 2008 at 9:04 AM

This appears to be a timeout issue, can you please post this to the forum so we can discuss?

By mitchel.sellers@gmail.com on Wednesday, February 06, 2008 at 12:13 PM

First, super thanks for the well documented tutorial on DNN upgrades!

I'm upgrading on a shared host from 44 up to 48 in steps, and did the 4.6 as instructed... ran into one problem that had me going around a few times, but found the problem...

FIrst off, it showed me "INSTALL" messaging that had a couple of different errors including these major ones:
00:00:00.203 -   Executing Script: DotNetNuke.Schema.SqlDataProvider Error! (see DotNetNuke.Schema.log for more information)
00:00:08.687 -   Executing Script: DotNetNuke.Data.SqlDataProvider Error! (see DotNetNuke.Data.log for more information)
00:00:17.874 -   Error: Error creating Profile Definitions
00:00:17.874 -   Portal failed to install:Error!

doing searches for these returned a range of odd suggestions, but none worked.

I went back and line by line reviewed the config files and the problem was that the shared host had one item different at the bottom of the original web.config for this line

<add name="SqlDataProvider" type="DotNetNuke.Data.SqlDataProvider, DotNetNuke.SqlDataProvider" connectionStringName="SiteSqlServer" upgradeConnectionString="" providerPath="~\Providers\DataProviders\SqlDataProvider\" objectQualifier="DNN1" databaseOwner="dbo" />


where the objectQualifier had a DNN1 value, where the default 4.6 web.config had no value there.

Once I fixed that, and ran the install page, it showed success with UPGRADE message and everything was good!

By huntersville website design and DNN Development on Wednesday, March 12, 2008 at 2:00 PM

I have tried to upgrade from DNN 4.5.1 to 4.6.0 and everything appears to work ok. I can access my updated site however when I try to access the module definitions after logging in as host I get the follwing error:
Error: Module Definitions is currently unavailable.
DotNetNuke.Services.Exceptions.ModuleLoadException: C:\Inetpub\wwwroot\DotNetNuke\Admin\ModuleDefinitions\ModuleDefinitions.ascx.vb(142): error BC30456: 'Upgrade' is not a member of 'Upgrade'. ---> System.Web.HttpCompileException: C:\Inetpub\wwwroot\DotNetNuke\Admin\ModuleDefinitions\ModuleDefinitions.ascx.vb(142): error BC30456: 'Upgrade' is not a member of 'Upgrade'. at System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath) at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) at System.Web.UI.TemplateControl.LoadControl(VirtualPath virtualPath) at System.Web.UI.TemplateControl.LoadControl(String virtualPath) at DotNetNuke.UI.Skins.Skin.InjectModule(Control objPane, ModuleInfo objModule, PortalSettings PortalSettings) --- End of inner exception stack trace ---

By john k on Tuesday, March 18, 2008 at 6:03 PM

Wow this was great... I just upgraded my first DNN Install and your blog made this process much easier.

Thank-you

By Chris Smith on Friday, April 11, 2008 at 9:37 AM

First off, THank you for the great documentation and pointers to gettting the DNN installed.

I am going from 4.4.3 to 4.6.2 unsing the install package as suggested. Everything was successful on the install. The first time I try to browse to my site I get the following error: ( Please help, I am pulling out my hair over this for 2 days)

Server Error in '/RECON' Application.
--------------------------------------------------------------------------------

Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[NullReferenceException: Object reference not set to an instance of an object.]
DotNetNuke.Entities.Portals.PortalSettings.GetPortalSettings(Int32 TabId, PortalAliasInfo objPortalAliasInfo) +91
DotNetNuke.Entities.Portals.PortalSettings..ctor(Int32 tabId, PortalAliasInfo objPortalAliasInfo) +82
DotNetNuke.HttpModules.UrlRewriteModule.OnBeginRequest(Object s, EventArgs e) +2874
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +92
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64




--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433

By James Putra on Wednesday, May 21, 2008 at 7:04 AM
Click here to post a comment

Donate

Show your appreciation for the content/modules made available by MitchelSellers.com by making a donation. Donations are used to assist with dedicating time to creating free content.