Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

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 ...Copy data from one DNN database to another?Copy data from one DNN database to another?
Previous
 
Next
New Post
11/7/2006 11:25 AM
 

I installed DNN 4.03.05 and set up 60 pages. Made the mistake of opening the database in SQL Server Management Studio. After that, DNN would not reconnect to the database.

I have since wiped out and reinstalled DNN 4.03.05 and am wishing I could recover the 60 pages of work. I have the old database. Can I get it's data into the new, fresh one in the new installation of DNN?

Any help is appreciated!

Also, why did the SQL Management Server break the connection? I tried using it to attach to a new DNN database 5 times now on new databases. DNN can never reconnect after doing so.

 
New Post
11/8/2006 4:48 AM
 

Just opening a database in Management Studio does not change anything. The purpose of Management Studio is to allow you to inspect databases!

Please say exactly what you did in Management Studio and exactly what the error is in DNN.

 
New Post
11/8/2006 8:42 AM
 

Well lneville, that was the premise I understood when I blithely opened the database in Management Studio. But something when wrong, repeatedly. I’ll answer your questions and maybe we can figure it out.

 

I open SQL Server Management Studio, click “Connect” on the pop-up box to connect to SQLEXPRESS, Right-click “databases” in Object Explorer, Choose Attach, then the Add button, browse to the database file, choose it, OK button on browse dialog and OK button on the attach dialog. I was also going to the “tabs” table and opening the table to see the records. It shows the records fine. But the next time I refresh the site in the browser, it shows this error message.

 

Error Installing DotNetNuke

Current Assembly Version: 04.03.05

ERROR: Could not connect to database specified in connectionString for SqlDataProvider

__________________________________________________________________

(don't be fooled by the error message, DotNetNuke was fully installed and working before I attached to it with Management Studio Express, It would redirect the browser to the install.aspx page and then I  would get this message.)

I played with the connection strings, reset IIS, restarted SQLExpress. All to no avail.

 

Then I blew away the DNN installation, reinstalled it and had a new, working database and application web. And then, as a test, attached to the database again from SQL Server Management Studio and suffered the same error message setback. 

 

If I just used the DNN application without SQL Server Management Studio involved, it worked fine.

 

Of course there might be something else I did that I don’t realize that is messing me up. Could it have something to do with remote desktops through a VPN? That is how I access the server. Do you have a comment on any of this?

 
New Post
11/9/2006 6:22 AM
 

OK I think I see the problem! It has nothing to do with remote desktops or VPNs.

This is what I think is happening - SQL Express can work with a database in 2 different modes. I will call them "attached" and "unattached" (these are probably not the official terms). You have to chose which mode you want to use, and there are pros and cons to each.

In attached mode, the database is registered with the SQL Express database engine. In other words, when you look in SQL Server Management Studio it is already present in the Databases folder. In this mode you can examine the database in the Studio. You also need to create a login and password for DNN to use to access the database, and you need to use these two connection strings in web.config (add your settings for Server etc):

  <connectionStrings>
    <!-- Connection String for SQL Server 2000/2005   -->
    <add
      name="SiteSqlServer"
      connectionString="Server=(local);Database=DotNetNuke;uid=;pwd=;"
      providerName="System.Data.SqlClient" />
  </connectionStrings>

and

  <appSettings>
    <!-- Connection String for SQL Server 2000/2005 - kept for backwards compatability - legacy modules   -->
    <add key="SiteSqlServer" value="Server=(local);Database=DotNetNuke;uid=;pwd=;"/>

In unattached mode, the database is NOT registered with the SQL Express database engine. In other words, when you look in SQL Server Management Studio it is not present in the Databases folder. In this mode you cannot examine the database in the Studio. However I think you can easily swap your database for another by copying a new MDF file over the old one (not 100% sure about this). You will need to use these two connection strings in web.config (add your settings for Data Source etc):

  <connectionStrings>
    <!-- Connection String for SQL Server 2005 Express -->
    <add
      name="SiteSqlServer"
      connectionString="Data Source=.\SQLExpress;Integrated Security=True;User Instance=True;AttachDBFilename=|DataDirectory|Database.mdf;"
      providerName="System.Data.SqlClient" />
  </connectionStrings>

and

   <appSettings>
    <!-- Connection String for SQL Server 2005 Express - kept for backwards compatability - legacy modules   -->
    <add key="SiteSqlServer" value="Data Source=.\SQLExpress;Integrated Security=True;User Instance=True;AttachDBFilename=|DataDirectory|Database.mdf;"/>

So, try setting up "attached" mode, and see if it does what you want. You need to attach database in SQL Server Management Studio then create a login the Security>Logins folder. In the login setup, in the User Mapping section, you need to check your database and check the db_owner role.

 
New Post
11/9/2006 8:42 AM
 

Earlier yesterday, I was experiementing, and, after trying many things unsuccessfully, I set the web.config back to the original contents from the installation file (which seems identical to your second set of connection strings) and I deleted the database.mdf using Explorer and copied in my old database with all my pages inside. To my utter surprise, the web site portal worked. I went to the management studio and the database was still attached and showing, and I viewed some data and the website is still working.  This seems contrary to your advice shown above, however I am not challenging it. I also had created logins earlier and maybe that has helped too. At the moment, I'm willing to leave well enough alone. I will print and keep your advice for the next round of troubles that will no doubt come again.

Correct me if I'm wrong, but I thought if I used the first set of connection strings you offered above, that would be connecting using SQL Server database security and the second set of connection strings was for Windows Intigrated  security. Is that right?

 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Copy data from one DNN database to another?Copy data from one DNN database to another?


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.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out