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

HomeHomeGetting StartedGetting StartedInstalling DNN ...Installing DNN ...Moving Database to a new serverMoving Database to a new server
Previous
 
Next
New Post
10/9/2008 9:30 PM
 

I am trying to move my DNN SQL database to a new database server and I am getting a connection error.  The exact error I get is "Invalid Connection".  My DotNetNuke website is unchanged.  I just change the connection string in the web.config file to point to the new database.  I just "Detached" the database from the original SQL server and then copied it our to the new SQL server and then "Attached" it again.  Everthing looked fine (I could open and edit tables).  I am fairly confident that I am using a proper connection string. 

What am I missing?  Is there a test I can do to see if the connection string is valid?

A little more background:

1. Original SQL Server v8.0.2273

2. New SQL server SQL Express 2005

WEBCONFIG FILE:

<configuration>
  <!-- application specific settings -->
  <appSettings>
    <!--<add key="connectionString" value="Server=localhost;Database=DotNetNuke;uid=sa;pwd=;" />-->
    <add key="ConnectionString" value="Server=76.12.35.56;Database=PortalSports;UID=gmaggioli;PWD=XXXXX;" />
    <!-- database connection details -->
  </appSettings>
 
 
  <system.web>

    <httpModules>
      <add name="HTTPHandler" type="DotNetNuke.HTTPHandler, DotNetNuke" />
    </httpModules>
    <!-- set debugmode to false for running application -->
    <compilation debug="true" />
    <!-- permits errors to be displayed for remote clients -->
    <customErrors mode="Off" />
    <!-- forms or Windows authentication -->
    <authentication mode="forms">
      <forms name=".DOTNETNUKE" protection="All" timeout="60" />
    </authentication>
    <!--
        <authentication mode="Windows">
            <identity impersonate="true"/>
        </authentication>
        -->
    <!-- allow large file uploads -->
    <httpRuntime useFullyQualifiedRedirectUrl="true" maxRequestLength="8192" />
    <!-- Adapter configuration for mobile controls used in the portal -->
    <mobileControls>
      <device name="PortalHtmlDeviceAdapters" inheritsFrom="HtmlDeviceAdapters">
        <control name="DotNetNuke.MobileControls.TabbedPanel, DotNetNuke" adapter="DotNetNuke.MobileControls.HtmlTabbedPanelAdapter,DotNetNuke" />
        <control name="DotNetNuke.MobileControls.LinkCommand, DotNetNuke" adapter="DotNetNuke.MobileControls.HtmlLinkCommandAdapter,DotNetNuke" />
      </device>
      <device name="PortalChtmlDeviceAdapters" inheritsFrom="ChtmlDeviceAdapters">
        <control name="DotNetNuke.MobileControls.TabbedPanel, DotNetNuke" adapter="DotNetNuke.MobileControls.ChtmlTabbedPanelAdapter,DotNetNuke" />
      </device>
      <device name="PortalWmlDeviceAdapters" inheritsFrom="WmlDeviceAdapters">
        <control name="DotNetNuke.MobileControls.TabbedPanel, DotNetNuke" adapter="DotNetNuke.MobileControls.WmlTabbedPanelAdapter,DotNetNuke" />
      </device>
    </mobileControls>
    <!-- Mobile device filters used for customizing portal -->
    <deviceFilters>
      <filter name="isJScript" compare="javascript" argument="true" />
      <filter name="isPocketIE" compare="browser" argument="Pocket IE" />
      <filter name="isHTML32" compare="preferredRenderingType" argument="html32" />
    </deviceFilters>
    <pages enablev13wstat3Mac="true" validateRequest="false" />
      <!--Gregg Added to fix the A potentially dangerous Request.form value.. error-->
  </system.web>
</configuration>

 

 
New Post
10/10/2008 8:24 AM
 

make sure, the login for SQL server, used in your connection string, has access and is properly matched to a user of the attached database.


Cheers from Germany,
Sebastian Leupold

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
New Post
10/11/2008 3:07 PM
 

I've always used this method when moving the database:
After restoring or reattaching the db,
Create a new user in SQL Server and give it dbo access to the newly restored db
Change the connection string to use the new user

SQL Server has a problem using existing users in the db, since it doesn't match the users on the new server.


Jason Honingford - Web & Software Developer
www.PortVista.com
 
New Post
10/11/2008 6:15 PM
 

You can create the same user name in SQL Server and run this script to update the orphaned DB users SID.

--Detect orphaned users

USE YourDB;
GO
sp_change_users_login @Action='Report';
GO

--Resolve an orphaned user

USE YourDB;
GO
sp_change_users_login @Action='update_one', @UserNamePattern='YourUserName', @LoginName='YourUserName';
GO
 

HTH



 
New Post
10/13/2008 11:31 AM
 

CSmith wrote
 

You can create the same user name in SQL Server and run this script to update the orphaned DB users SID.

--Resolve an orphaned user

USE YourDB;
GO
sp_change_users_login @Action='update_one', @UserNamePattern='YourUserName', @LoginName='YourUserName';
GO

CSmith is exactly right.  It's what I'm currently in the process of doing.

Another thing to watch out for if you're moving to a newly built server.  Make sure that Computer Name of the new server has been finalized.  Renaming the server AFTER installing SQL will cause all sorts of problems.

 
Previous
 
Next
HomeHomeGetting StartedGetting StartedInstalling DNN ...Installing DNN ...Moving Database to a new serverMoving Database to a new server


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