Solved

Application not connecting to SQL database after disaster restore.

Posted on 2016-09-30
7
47 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 29

Assisted Solution

by:Pawan Kumar
Pawan Kumar earned 167 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 167 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 79

Assisted Solution

by:arnold
arnold earned 166 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
Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

 
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 29

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

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!

Question has a verified solution.

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

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
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.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.

627 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