Ever wanted to move a production install of DNN over to our local machine to do some bug finding and design refinements? It is usually an easy task to do, however if you are using DNN 5, you may come across a bug that may cost you some time. In this post I thought I would provide a solution to save anyone the 2 hours it cost me to fix.
A complete discussion of how to perform a migration from production to localhost install is beyond the scope of this post, there are many good resources available on web to provide this detail. I totally recommend the video tutorial available on DNN Creative.
Cook Book : Transferring Production to LocalHost
- On the Live Box add the Localhost portal aliases for the portals you plan to move in the Site settings Potal Aliases
- Back up the Database in SQL Management Studio.
- ZIP up all the files and folders in the website directory on the server.
- FTP files and database to local machine
- Restore and unzip files on local machine.
- Add SQL logins as required.
- Update web.config with local machine settings i.e Ammend connection strings.
- Set ASPNET user account to have read and write privilege on website folders
- Set up Virtual Directories corresponding to portal aliases. i.e http://localhost/threenine
After all this has been done you are ready to browse your DNN website in you browser.
If you recieve the following error page :
And if the error reported in the EventLog table is something similar too :
<LogProperties><LogProperty><PropertyName>AssemblyVersion</PropertyName><PropertyValue>05.00.00</PropertyValue></LogProperty><LogProperty><PropertyName>PortalID</PropertyName><PropertyValue>0</PropertyValue></LogProperty><LogProperty><PropertyName>PortalName</PropertyName><PropertyValue>Three Nine Consulting</PropertyValue></LogProperty><LogProperty><PropertyName>UserID</PropertyName><PropertyValue>-1</PropertyValue></LogProperty><LogProperty><PropertyName>UserName</PropertyName><PropertyValue /></LogProperty><LogProperty><PropertyName>ActiveTabID</PropertyName><PropertyValue>36</PropertyValue></LogProperty><LogProperty><PropertyName>ActiveTabName</PropertyName><PropertyValue>Home</PropertyValue></LogProperty><LogProperty><PropertyName>RawURL</PropertyName><PropertyValue>/threenine/Default.aspx</PropertyValue></LogProperty><LogProperty><PropertyName>AbsoluteURL</PropertyName><PropertyValue>/threenine/Default.aspx</PropertyValue></LogProperty><LogProperty><PropertyName>AbsoluteURLReferrer</PropertyName><PropertyValue /></LogProperty><LogProperty><PropertyName>UserAgent</PropertyName><PropertyValue>Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; InfoPath.2; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)</PropertyValue></LogProperty><LogProperty><PropertyName>DefaultDataProvider</PropertyName><PropertyValue>DotNetNuke.Data.SqlDataProvider, DotNetNuke.SqlDataProvider</PropertyValue></LogProperty><LogProperty><PropertyName>ExceptionGUID</PropertyName><PropertyValue>dd083ee4-12c2-48e4-8694-d8119769c15b</PropertyValue></LogProperty><LogProperty><PropertyName>InnerException</PropertyName><PropertyValue>Object reference not set to an instance of an object.</PropertyValue></LogProperty><LogProperty><PropertyName>FileName</PropertyName><PropertyValue /></LogProperty><LogProperty><PropertyName>FileLineNumber</PropertyName><PropertyValue>0</PropertyValue></LogProperty><LogProperty><PropertyName>FileColumnNumber</PropertyName><PropertyValue>0</PropertyValue></LogProperty><LogProperty><PropertyName>Method</PropertyName><PropertyValue>DotNetNuke.UI.Utilities.MSAJAX.get_IsInstalled</PropertyValue></LogProperty><LogProperty><PropertyName>StackTrace</PropertyName><PropertyValue /></LogProperty><LogProperty><PropertyName>Message</PropertyName><PropertyValue>DotNetNuke.Services.Exceptions.PageLoadException: Object reference not set to an instance of an object. ---> System.NullReferenceException: Object reference not set to an instance of an object.
at DotNetNuke.UI.Utilities.MSAJAX.get_IsInstalled()
at DotNetNuke.UI.Utilities.MSAJAX.RegisterClientScript(Page objPage, String Path)
at DotNetNuke.UI.Utilities.ClientAPI.RegisterClientScriptBlock(Page objPage, String key)
at DotNetNuke.UI.Utilities.ClientAPI.RegisterClientReference(Page objPage, ClientNamespaceReferences eRef)
at Dnnskin.Net.SkinObjects.V2.HorizontalTheme.Page_Load(Object sender, EventArgs e)
at System.Web.UI.Control.OnLoad(EventArgs e)
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
--- End of inner exception stack trace ---</PropertyValue></LogProperty><LogProperty><PropertyName>Source</PropertyName><PropertyValue /></LogProperty></LogProperties>
It is most probably the bug that is highlighted here : http://www.dotnetnuke.com/Community/Forums/tabid/795/forumid/118/threadid/294711/scope/posts/Default.aspx
All that is required to overcome this is to open up the web.config and locate the runtime configuration options, and add “urn:schemas-microsoft-com:asm.v1” to the blank xmlns attribute for the dependent assembly
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="bin;bin\HttpModules;bin\Providers;bin\Modules;bin\Support;" />
<dependentAssembly xmlns="">
<assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0" />
</dependentAssembly>
<dependentAssembly xmlns="">
<assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
The completed the section should look as follows:
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="bin;bin\HttpModules;bin\Providers;bin\Modules;bin\Support;" />
<dependentAssembly xmlns="urn:schemas-microsoft-com:asm.v1">
<assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0" />
</dependentAssembly>
<dependentAssembly xmlns="urn:schemas-microsoft-com:asm.v1">
<assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
Your site should be able to run after this.
Keep grinding the code,
Gary