Hello,
I moved many times my DNN site from production to local, but now I have no idea where the problem is.
My DNN is 6.0.2. Windows 7 with IIS 7.5 and MSSQL 2008 R2.
I copied copy of web files to inetpub folder and in IIS converted to application. Added Full control for defaultAppPool to my web folder. Connection string was updated.
I have backed up my database (let’s say ABC) and did following steps:
• Created database named ABC
• Restored backup to database ABC
• Deleted user from web.config (let’s say user MYUSER)
• Created new SQL login MYUSER and map it to database ABC (public, owner) and master (public). This step created also user MYUSER in ABC database. Login and password are the same like in web.config.
• Map NT AUTHORITY\NETWORK SERVICE and IIS APPPOOL\defaultAppPool to ABC database
When I run the site, error „This site is currently Unavailable“ occurs (…/Install/UnderConstruction.htm). In SQL log is written Login failed for user MYUSER. Reason: Failed to open the explicitly specified database. [CLIENT: <local machine>] Error: 18456, Severity: 14, State: 38.
Error: 18456, Severity: 14, State: 38 means that „Database doesn’t exist or login doesn’t have access to the database.“ BUT I can connect with the same user and password copied from web.config to SQL Management Sudio to ABC database and also to master database (which is default). This SQL error is logged only after restart of IIS and first web call.
When I run SQL profiler, I can see errors from DNNCore application:
• 2012-05-09 17:53:47.54 Logon Error: 18456, Severity: 14, State: 38.
• 2012-05-09 17:53:47.54 Logon Login failed for user MYUSER. Reason: Failed to open the explicitly specified database. [CLIENT: <local machine>]
• Cannot open database "ABC" requested by the login. The login failed.,
Login and password in both connection strings in web.config ARE REALLY correct. I tried it many times (ctrl+c, ctrl+v) in Management Studio and I can log to database ABC with user MYUSER using Management studio.
I created next DNN application (new install with new database) with the same user and password all works OK! All settings of file folder and all database setting are done the same way like for my moved DNN application with ABC database.
I tried everything what I know many times in various ways, but nothing works. I have really now idea. Please help me.