Copied to clipboard

Flag this post as spam?

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


  • John Dawson 24 posts 146 karma points
    Oct 22, 2018 @ 10:28
    John Dawson
    0

    Trouble running local clone of Umbraco site

    I've recently started work on an existing site which has been developed with Umbraco. To familiarize myself with the project they have sent me a cloned repository.

    I have checked this out locally with Tortoise SVN and restored the database from the .bak file with SQL Server in Visual Studio. I then opened the local repo and changed the connectionStrings.config file to point to the restored DB.

    When I press Ctrl-F5, it tries to load the site on localhost but displays this image: enter image description here

    ...and appears to be trying to run the initial installation of Umbraco. How can I tell it to just run the local copy from the cloned repo and not try to install Umbraco? Or have I done something fundamentally wrong along the way?

  • Michaël Vanbrabandt 863 posts 3348 karma points c-trib
    Oct 22, 2018 @ 10:36
    Michaël Vanbrabandt
    0

    Hi John,

    first of all welcome to the friendliest community of Umbraco!

    Sad to hear that you don't get any help or support from the others developers that gave you the repo to work with.

    Can you confirm that the connection string is correct which you have placed in the web config?

    Have a nice day!

    /Michaël

  • John Dawson 24 posts 146 karma points
    Oct 22, 2018 @ 10:56
    John Dawson
    0

    Thanks, Michaël.

    The connection string is:

      <add name="umbracoDbDSN" connectionString="Data Source=(localdb)\MSSQLLocalDB;Initial Catalog=master;Integrated Security=True;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False" providerName="System.Data.SqlClient" />
    

    I copied the actual connection string from the "Properties" tab under the SQL Server, (localdb)\MSSQLLocalDB which contains the DB I imported.

    Although I noticed now that, within Visual Studio, it's not actually connected to the DB and has the message

    Cannot open database "UmbracoDB" requested by the login. The login failed. Login failed for user "Campus\njd55"

    So maybe I need to do some more work on the SQL Server in Visual Studio to get it correctly connected and then add those connection details to the connection string?

  • Michaël Vanbrabandt 863 posts 3348 karma points c-trib
    Oct 22, 2018 @ 11:15
    Michaël Vanbrabandt
    100

    John,

    Normally the connection string when working with SQL server should be something like:

    <add name="umbracoDbDSN" connectionString="server=YOURSQLSERVER;database=YOURDBNAME;user id=YOURUSER;password='YOURPWD'" providerName="System.Data.SqlClient" />
    

    So here you only need to fill in following properties:

    • Your MSSQL server instance name
    • Your Database name
    • Your username
    • Your password

    an you try this and see if this works?

    /Michaël

  • John Dawson 24 posts 146 karma points
    Oct 22, 2018 @ 12:32
    John Dawson
    0

    So instead of running the DB in Visual Studio, I restored it in SQL Server Management Studio successfully and am correctly connected. I copied the connection properties and so set up the string as:

      <add name="umbracoDbDSN" connectionString="server=NICA10\SQLEXPRESS;database=voicenorth_20180611;user id=NICA10\John;password='****'" providerName="System.Data.SqlClient" />
    

    ...but that gives me the following error:

    enter image description here

    I'm using Windows Authentication method so I don't know if I still need the username and password?

    Another thing I wondered is whether admin privileges could be affecting it? My work computer doesn't have admin rights by default but I do have admin login details to override any restrictions as and when I need it. I'm wondering though whether, if it's using Windows Authentication, it's getting blocked by the admin restriction?!

    Thanks for your help!

    John

  • Michaël Vanbrabandt 863 posts 3348 karma points c-trib
    Oct 22, 2018 @ 12:44
    Michaël Vanbrabandt
    0

    John,

    maybe your SQL server version is different from the one the other devs where using?

    Also if you lookup in the logins of that database in your Management studio, can't you see the user in the original connection string? Maybe it was also restored so you can alter the connection string with the original user and pwd received by the other devs.

    Hope this helps!

    /Michaël

  • John Dawson 24 posts 146 karma points
    Oct 22, 2018 @ 13:11
    John Dawson
    0

    They told me SQL Server 2012 so I hope that's not the issue...

    I can see a bunch of Users here:

    enter image description here

    ...but I can't add a new User (gives me a permission denied). I guess the thing to try is to get a password from the original devs for one of those Users?

    Thanks!

    John

  • Michaël Vanbrabandt 863 posts 3348 karma points c-trib
    Oct 22, 2018 @ 13:18
    Michaël Vanbrabandt
    1

    Does the original connection string contains the user weblogin or vnweblogin? If that is the case, you can use this one because it also was restored with your bak file. Then you only need to change the SQL Server instance name.

    Hope this helps!

    /Michaël

  • John Dawson 24 posts 146 karma points
    Oct 22, 2018 @ 13:59
    John Dawson
    0

    I created a new Login called serverloginwith SQL Server Authentication and then added a new User called serverlogin with that Login name, and membership to db_owner.

    If I use these login details in the connection string, I no longer get the "cannot connect to the database" error, however I get a new error!

    I am guessing the new error is unrelated to the original topic of this thread so I'm asking the developers if it makes any sense to them. I'll post it here anyway just in case it is an obvious error that can be fixed easily:

    enter image description here

    Thank you so much for your help, Michaël. Great first experience with Our Umbraco forum!

    John

  • Michaël Vanbrabandt 863 posts 3348 karma points c-trib
    Oct 22, 2018 @ 14:11
    Michaël Vanbrabandt
    1

    John,

    correct, looking at the logs you now have access to Umbraco this case could be closed!

    Glad I could help you out and I really hope you enjoy Umbraco even more!

    If you want to start learning, have a look at umbraco.tv which help me a lot in the beginning!

    Have a nice day!

    /Michaël

  • Mohammad 14 posts 83 karma points
    Nov 16, 2020 @ 10:09
    Mohammad
    0

    did you get to solve your problem with the database connection error? If so what is the solution?

Please Sign in or register to post replies

Write your reply to:

Draft