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.