Solved

Application not connecting to SQL database after disaster restore.

Posted on 2016-09-30
7
25 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 25

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 12

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 77

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
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 
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 25

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

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

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

Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

863 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now