Solved

Application not connecting to SQL database after disaster restore.

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

Assisted Solution

by:Pawan Kumar Khowal
Pawan Kumar Khowal earned 167 total points
Comment Utility
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 11

Assisted Solution

by:Nakul Vachhrajani
Nakul Vachhrajani earned 167 total points
Comment Utility
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 76

Assisted Solution

by:arnold
arnold earned 166 total points
Comment Utility
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
Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

 
LVL 1

Accepted Solution

by:
pyotrek earned 0 total points
Comment Utility
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
Comment Utility
Thanks for the effort
0
 
LVL 17

Expert Comment

by:Pawan Kumar Khowal
Comment Utility
@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
Comment Utility
Thanks for the effort
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Join & Write a Comment

Having an SQL database can be a big investment for a small company. Hardware, setup and of course, the price of software all add up to a big bill that some companies may not be able to absorb.  Luckily, there is a free version SQL Express, but does …
Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
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.

772 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

12 Experts available now in Live!

Get 1:1 Help Now