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:
...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?
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?
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:
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?!
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.
They told me SQL Server 2012 so I hope that's not the issue...
I can see a bunch of Users 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?
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.
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:
Thank you so much for your help, Michaël. Great first experience with Our Umbraco forum!
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 theconnectionStrings.config
file to point to the restored DB.When I press
Ctrl-F5
, it tries to load the site onlocalhost
but displays this image:...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?
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
Thanks, Michaël.
The connection string is:
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
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?
John,
Normally the connection string when working with SQL server should be something like:
So here you only need to fill in following properties:
an you try this and see if this works?
/Michaël
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:
...but that gives me the following error:
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
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
They told me SQL Server 2012 so I hope that's not the issue...
I can see a bunch of Users 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
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
I created a new Login called
serverlogin
with SQL Server Authentication and then added a new User calledserverlogin
with that Login name, and membership todb_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:
Thank you so much for your help, Michaël. Great first experience with Our Umbraco forum!
John
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
did you get to solve your problem with the database connection error? If so what is the solution?
is working on a reply...