• Login
  • Register

DNN Forums

A community discussion page. We're starting from scratch, so...let's get the party started!

Access external DBs on module install/upgrade

You are not authorized to post a reply.
Sort:
Page 2 of 2 << < 12


Basic Member


Posts:31
Basic Member

    Would that be an interesting feature to add, or it's just me that finds this interesting?

    Vicenç Masanas
    Disgrafic ITec SL Banyoles - Spain


    New Member


    Posts:5
    New Member

      I believe that in the script all you would need to add is a USE Database directive referening the name of your database name maintained in the web.config file.



      Veteran Member


      Posts:291
      Veteran Member

        Posted By Brian Dukes on 09 Aug 2019 11:58 AM
        It always runs against the DNN database. You could use IUpgradeable to run other scripts, or use linked databases to run scripts on the other database from the DNN database.

        Yep... What he said ^^^

        Whenever we need data to live in another data source, we use DNN's built-in functionality to install normally, then have a process migrate it after.  For example, we do this a lot with custom modules that have PII.  

        Will Strohl

        Upendo Ventures Upendo Ventures
        DNN experts since 2003
        Official provider of the Hotcakes Commerce Cloud and SLA support


        Veteran Member


        Posts:291
        Veteran Member

          Posted By HansZ on 09 Aug 2019 01:03 PM

          I believe that in the script all you would need to add is a USE Database directive referening the name of your database name maintained in the web.config file.

          I haven't tried that specifically recently, but in my case, we're often using a different data source altogether (e.g., other server, other DB server, etc.) and it requires an additional data connection string instead of USE.  

          Oh, and to address an earlier comment... I wouldn't ever suggest putting any connection string details in the AppSettings.  You should use the connectionStrings section in the web.config instead.  :) 

          Will Strohl

          Upendo Ventures Upendo Ventures
          DNN experts since 2003
          Official provider of the Hotcakes Commerce Cloud and SLA support


          Basic Member


          Posts:79
          Basic Member

            I use Entity Framework in those situations, it migrates your database schema on the fly as soon as it notices it does not match your model. I love it!
            You are not authorized to post a reply.
            Page 2 of 2 << < 12

            These Forums are dedicated to discussion of DNN Platform.

            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.

            Would you like to help us?

            Awesome! Simply post in the forums using the link below and we'll get you started.

            Get Involved