Cannot copy a SQL Express file from a non-bootable machine

I have a user with a POS system that runs on MS SQL Express. I believe it is V2008. Their machine died and is unbootable but the system hard drive is readable. I am trying to copy the *.dat file their app uses to another machine to get them up again (no they didn't have a backup) but when I try to copy the file it tells me the file is in use. I have tried to take ownership of the file which appears to be successful but I still get the error.
I tried to use NovaStor backup to backup the file but it says it is in use. The hard drive is connected via a USB drive so the SQL program is not running or accessing the file. I assume it is an issue with the file type and SQL Express.
Is there a way to extract this file from the old hard drive and move it to a working machine so I can get their business up and running again?
Thanks so much in advance for your help.
TcAnthonyAsked:
Who is Participating?
 
Tom CieslikConnect With a Mentor IT EngineerCommented:
So this file must be corrupted.
AOMEI can do SYSTEM backup with all opened files., It's using VSS snapshot to backup files directly from memory. If you file can;t be read then it must be corupted.
I think in that case you not going to be able recover this file.
0
 
Tom CieslikIT EngineerCommented:
I think that Indexing is blocking your file.
Try to stop Windows Search service and try copy file again.
If this will not work from Explorer, try use CMD as Administrator and copy over file manually.
0
 
John TsioumprisSoftware & Systems EngineerCommented:
If everything fails find a bootable WinPE and boot form it and copy your files..
0
Improve Your Query Performance Tuning

In this FREE six-day email course, you'll learn from Janis Griffin, Database Performance Evangelist. She'll teach 12 steps that you can use to optimize your queries as much as possible and see measurable results in your work. Get started today!

 
TcAnthonyAuthor Commented:
I stopped the search services with no joy. I will try the WinPE next.
Thanks.
0
 
pcelbaCommented:
For what reason do you need the *.dat files?  And how do you know the "SQL program is not running"? What is the name of this program?

MS SQL Express is running as Windows Service and uses  *.mdf and *.ldf files by default.

If the machine died then it is highly probable these files will be corrupted so you have to run all the DBCC checks immediately after mounting them to the new SQL server.
0
 
Tom CieslikIT EngineerCommented:
You can try connect this disk to new working SQL Express and if you going to have SQL Management tool installed you can try attache database from affected disk, then backup it to file on new computer/SQL server then restore to new Database server.
0
 
TcAnthonyAuthor Commented:
I stated in the initial post that the data is on a hard drive connected to a usb interface because I took it out of the original machine. I know sql isn’t running because it isn’t installed on the machine I am working on. The program is called MIC Systems. It is a motorcycle pos system. It uses .dat as its database but MS SQL Express as its engine.
0
 
Tom CieslikIT EngineerCommented:
Ok, so use some backup software to backup drive or folder like AOMEI BACKUPER then restore only database from backup

https://www.backup-utility.com/
0
 
TcAnthonyAuthor Commented:
Didn’t use that app but did use a backup program (NovaStor) and it skipped the file due to it being in use.
0
 
Tom CieslikIT EngineerCommented:
Try AOMEI. It's simple and free
1
 
TcAnthonyAuthor Commented:
AOMEI results same as My $400 NovaStor Advance Server. No joy.
0
 
arnoldCommented:
Fsutil  needs to be used to see whether the file status is what indicates that it is in use.
https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/fsutil-file
https://blogs.technet.microsoft.com/askds/2008/11/11/dfsr-does-not-replicate-temporary-files/
Clearing the status reference if set, might help resolve your issue.
0
 
pcelbaCommented:
So you are telling you have all the necessary files on USB disk, this disk is connected to a new computer but you cannot copy the *.dat files from USB to computer's harddrive as it reports "file in use error".... Simple idea is "Who or what software could open use files?". Yes, you could download Process Monitor and look at the log but it is too technical step.

This whole story sounds like a nonsense. When you connect standard USB to a new computer then you have to see all the files. Or your computer is full of viruses or your USB disk is copy protected by some software or by access rights (it should not report file in use in such case but who knows).

So to summarize and go further you should answer a few questions:
1) The old computer cannot boot so how did you move the files to the USB drive? Did you dismount the system drive from the broken computer and mount it to the new one via USB?
2) Are you sure all the data are in *.dat files? Are you sure MS SQL Server uses just dat files and nothing else? The whole MIC Systems application does not mean just SQL Server but much more.
3) Did you install the MIC Systems on the new computer? I am sure the simple copy cannot work as the software installation means registry update and possibly more.
4) Did you call the MIC Systems support and ask them what is the correct procedure to move their software and data to the new computer?  Their support number is 714-545-4444. What was the answer?
0
 
TcAnthonyAuthor Commented:
I removed the old hard drive from the old system and installed it into a usb enclosure. I can move or copy all files on the old drive except the .dat file (which is leading me to believe it is corrupted).
I have been working with the support for MIC systems for the past 3 days but they are little help without the ability to move the file.
My request today will be for them to try to open the file directly from the usb drive without moving it.
For the record, the first thing I did and always do is check a system for malicious code or viruses. I would assume this being an experts Exchange that that is a given?
0
 
TcAnthonyAuthor Commented:
Also when I first got the error of the file being in use the first thing I did is checked for open files and used process monitor. Again, assuming this is expert Exchange I should do due diligence before asking questions.
Thanks for all of your suggestions.
0
 
TcAnthonyAuthor Commented:
Best assumption is a corrupted file.
0
 
John TsioumprisSoftware & Systems EngineerCommented:
well maybe you can  recover the file...but this is another question
0
 
pcelbaCommented:
This really seems to be corrupted disk and the only chance is recovery software. If you copy this file to a new location then it will be incomplete most probably and you will need to use some SQL Server file recovery software, e.g. http://www.officerecovery.com/repair-corrupted-mssql-database/ or https://go.veeam.com/microsoft-sql-server-explorer.html or something other.

I would highly recommend to give this work to professional as he knows the details about SQL Server file structures. Fortunately, SQL Server keeps data in one file and transactions in another file so it is possible to reconstruct data from the past transactions.
MS SQL database is not alone. It contains 3 system databases which are not used by your application so you don't need to restore them because they'll be created during SQL Express installation.

If the harddrive is not readable then repair it. Look e.g. here for more info: https://www.easeus.com/data-recovery/other-recovery-software/hard-drive-repair-software.htm

Your steps should be following:
1) Make a physical copy of the corrupted harddrive to a new  disk and work with this new disk preferably (use harddrive cloning software)
2) Copy the SQL Server files to a computer where SQL Server is installed and attach them
3) Check the file integrity by SQL Server tools
4) Use the SQL Server data recovery software mentioned above
0
 
pcelbaCommented:
And please tell how the AOMEI did help :-)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.