Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Application not connecting to SQL database after disaster restore.

Posted on 2016-09-30
7
Medium Priority
?
56 Views
Last Modified: 2016-10-06
This is probably something simple except my complete lack of knowledge of SQL etc prohibits me to solve it.

I have a client with "custom application" that was written for them over a decade ago. This application was connecting to SQL database that was hosted on it's own server. This server recently stopped to exist. Server is dead, drives are dead - the only thing that I have is the good backup of database.

I have build (as virtual machine) a Server 2008 R2 with SQL 2008 R2 installed and I managed to restore database from backup.
I gave the server the same name (and same IP) as the machine that died. This new server is build with windows authentication (and I was told that this is how it was previously)
I have setup SQL port exceptions on firewall and tested the connectivity to database on the SQL server itself and from the workstation successfully (I created text file and renamed it .udl and this gave me Database connection tool)

Regardless all this the "Custom App" is not connecting to database - it gives error: "The application is unable to connect to the database server."

I have found that this "Custom app" has a config file that mentions some kind of account and password.

Do I have to do something else to the restored database - recreate/relink accounts?
0
Comment
Question by:pyotrek
7 Comments
 
LVL 35

Assisted Solution

by:Pawan Kumar
Pawan Kumar earned 668 total points
ID: 41824687
Are you able to connect to DB using SSMS.

Can you share the config file (Connection string). ?


In few cases we may need to create accounts.
0
 
LVL 14

Assisted Solution

by:Nakul Vachhrajani
Nakul Vachhrajani earned 668 total points
ID: 41824730
If it uses some account and a password, then it is not using Windows authentication. A username + password would be required in case of SQL authentication. So, you probably need to enable SQL authentication on your server and create the necessary account with the given password.

The second probability would be the DB name - is it same as that on the original server?

The underlying error code and error state information are the only pieces which would tell for sure what the problem is. You are probably getting a 18456 error which has a lot of possible configuration related root causes - each of which would have a different value for error state.
0
 
LVL 80

Assisted Solution

by:arnold
arnold earned 664 total points
ID: 41824976
To identify whether it was using sql login, look at the security section under the database not under the database server, if you have logins other than sa, that us the user and credentials needed.

You may gave to capture logins to identify the username/password if they were hard coded.

Does the db backups include the system db backup. Master, msdb, model?

SQL trace ro capture the login attempt, might or using a network ....
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Accepted Solution

by:
pyotrek earned 0 total points
ID: 41825032
OK  - got it going - i had to use following to reestablish database account login:

use {DatabaseName}
GO
 
EXEC sp_change_users_login 'Auto_Fix', {UserName}, null, {UserName}{Password}'
GO

and had to enable Mixed Authentication as i installed it with Windows Authentication only.

Thanks for the help.
0
 
LVL 1

Author Comment

by:pyotrek
ID: 41825033
Thanks for the effort
0
 
LVL 35

Expert Comment

by:Pawan Kumar
ID: 41825035
@Author - Great to know that it helped. Could you please choose one or more answer as accepted solution and close the question. Thank you !
0
 
LVL 1

Author Closing Comment

by:pyotrek
ID: 41831402
Thanks for the effort
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
It is possible to export the data of a SQL Table in SSMS and generate INSERT statements. It's neatly tucked away in the generate scripts option of a database.
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

926 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question