Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • kyle 49 posts 240 karma points
    Mar 18, 2022 @ 12:11
    kyle
    0

    A connection string is configured but Umbraco could not connect to the database.

    Hi all!

    I get this error when trying to run my Umbraco website locally...(A connection string is configured but Umbraco could not connect to the database.)

    Here is a little context: I initially built the site on my personal laptop but later down the line I got a company laptop.

    So I uploaded the website from my personal laptop to azure DevOps and from my new laptop imported into vs from DevOps. but now I can't run it becuase im assuming th config file is pointing to the database that is on my peronal machine? how do I go about resolving this?? Please help me...

  • Kyle Eck 130 posts 280 karma points
    Mar 18, 2022 @ 13:36
    Kyle Eck
    1

    If I am understanding correctly, your connection string is still saying its your personal machine...

    Did you move your DB to azure as well as your site files? You need to do both.

    I would then change your connection string to point to the azure DB instead of your local machine.

    ~ Kyle

  • Lindow 154 posts 1301 karma points
    Mar 18, 2022 @ 21:28
    Lindow
    1

    Is the connection string pointing to the DB which is on your personal laptop or is the DB somewhere where it can be accessed from anywhere with the correct connection string?

    If it's on that personal laptop then I would say that it makes good sense that you can't spin the site up since the DB isn't available.

    Below is an example of a connection string that you should have in your web.config file :)

    <connectionStrings>
    <remove name="umbracoDbDSN" />
    <add name="umbracoDbDSN" connectionString="Data Source=|DataDirectory|\Umbraco.sdf;Flush Interval=1;" providerName="System.Data.SqlServerCe.4.0" />
    </connectionStrings>
    
  • kyle 49 posts 240 karma points
    Mar 21, 2022 @ 05:41
    kyle
    0

    Hi there Lindow!

    Yup, that is what the connection string looks like, except I deleted the flush interval because it gave me issues. But aside from that. I had a look at my personal machine and my local instance of SSMS, and then I remembered that I never set up a database when I setup Umbraco???

    Which is very confusing for me?? Where is the connection string pointing because I never set up a database for it?

    The reason for that is that it was my first Umbraco site and I thought that I would only be playing around with it but then I progressed quite far so now I have this issue... what do I do?

    Thank you!

  • Lindow 154 posts 1301 karma points
    Mar 21, 2022 @ 06:16
    Lindow
    1

    You must have set up one. The default installation sets up a .sdf file in the \App_Data folder

    Check if it's there :)

  • kyle 49 posts 240 karma points
    Mar 21, 2022 @ 07:01
    kyle
    0

    ok great! thank you,

    But now, how do I get the website on my company laptop to use this .sdf file that is on my personal machine...? Just making sure so that I do it correctly...

    Should I just copy the .sdf file to my new machine and modify the connection string? Thank you for your help and patience.. I'm an intern dev + new to umbraco :/

  • kyle 49 posts 240 karma points
    Mar 21, 2022 @ 07:21
    kyle
    0

    I uploaded the project to source control and cloned it again from there to my new laptop.. but I just checked, the .sdf file never go uploaded to source control...?

  • Lindow 154 posts 1301 karma points
    Mar 21, 2022 @ 07:29
    Lindow
    100

    That file IS your database :)

    Give this a read - https://fileinfo.com/extension/sdf

    Just zip everything up from your old laptop and move it to the new one.

    That should be enough.

  • kyle 49 posts 240 karma points
    Mar 21, 2022 @ 07:31
    kyle
    0

    Sweet thank you so much! Have a wonderful day

  • Lindow 154 posts 1301 karma points
    Mar 21, 2022 @ 07:32
    Lindow
    1

    You as well, Kyle mate :)

Please Sign in or register to post replies

Write your reply to:

Draft