Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Moving database fails with NullReferenceException at GetPortalAliasLookup, improve messagesMoving database fails with NullReferenceException at GetPortalAliasLookup, improve messages
Previous
 
Next
New Post
6/19/2016 7:44 PM
 

I have moved the database and it's contents from one server to another server. Running DNN722. No other structural changes. All data has been compared using SQL Compare from RedGate and dito for the data dictionary structure.

When changing the web.config in two places to point to the new server, the error is on any page:

[NullReferenceException: Object reference not set to an instance of an object.]
   DotNetNuke.Entities.Portals.PortalAliasController.GetPortalAliasLookup(String httpAlias) in c:\TeamCity\buildAgent\work\DNN_Platform_722\Packaging\DNN.Platform\DNN Platform\Library\Entities\Portals\PortalAliasController.cs:311
   DotNetNuke.Entities.Portals.PortalAliasController.GetPortalAliasInfo(String httpAlias) in c:\TeamCity\buildAgent\work\DNN_Platform_722\Packaging\DNN.Platform\DNN Platform\Library\Entities\Portals\PortalAliasController.cs:239
   DotNetNuke.Modules.ActiveForums.ForumsReWriter.OnBeginRequest(Object s, EventArgs e) in e:\websites\dnndev.me\DesktopModules\ActiveForums\components\Extensions\ReWriter.cs:77
   System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +141
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +91

 

The contents of PortalAlias table is identical on both, as is Portals. In the event log of Windows there is no further hint.

When I started debugview, I got massive:

 

[5924]  

[5924] System.Data.SqlClient.SqlException (0x80131904): Cannot open database "dotnetnuke" requested by the login. The login failed. 

[5924] Login failed for user 'dotnetnuke'. 

[5924]    at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection) 

[5924]    at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection) 

[5924]    at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection) 

[5924]    at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions) 

[5924]    at System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource`1 retry) 

[5924]    at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry) 

[5924]    at System.Data.SqlClient.SqlConnection.Open() 

[5924]    at PetaPoco.Database.OpenSharedConnection() 

[5924]    at DotNetNuke.Data.PetaPoco.PetaPocoExt.ExecuteReader(Database database, String sql, Object[] args) in c:\TeamCity\buildAgent\work\DNN_Platform_722\Packaging\DNN.Platform\DNN Platform\Library\Data\PetaPoco\PetaPocoExt.cs:line 40 

[5924] ClientConnectionId:13281f48-5782-4ac4-9fc2-d1ac97057756 

[5924] Error Number:4060,State:1,Class:11 

 

Please improve messages to be more obvious without using Trace and debugviewer.

 
New Post
6/19/2016 10:01 PM
 

DId you set up the security login and database user in the new instance of SQL server to which you migrated?

 
New Post
6/20/2016 4:42 AM
 
please make sure, the user DotNetNuke on the new SQL server is mapped to the database and is granted dbowner permission.

Cheers from Germany,
Sebastian Leupold (Microsoft MVP)

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
New Post
6/20/2016 5:16 PM
 
Yes, that was the cause. Please accept the suggested change to make it more readable for end-users what is wrong. Most users don't know how to attach a debugger or run debugview for trace messages.
 
New Post
6/20/2016 9:12 PM
 
Guido,

I am happy, you were able to solve your issue.
which suggestions are you referring to?

Cheers from Germany,
Sebastian Leupold (Microsoft MVP)

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Moving database fails with NullReferenceException at GetPortalAliasLookup, improve messagesMoving database fails with NullReferenceException at GetPortalAliasLookup, improve messages


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.

Content Layout

Subscribe to DNN Digest

DNN Digest is our monthly email newsletter. It highlights news and content from around the DNN ecosystem, such as new modules and themes, messages from leadership, blog posts and notable tweets. Keep your finger on the pulse of the ecosystem by subscribing.  


Copyright 2017 by DNN Corp Terms of Use Privacy
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out