How many thousands of photos, videos, financial records, and other priceless files do you have stashed away in digital-only form?

Unfortunately, mechanical hard drives last only about five to 10 years, thanks to normal wear and tear. Knock the thing off your desk while it’s running and its 7200 rpm spindle motor and metal read/write heads can shred the drive’s delicate glass-cobalt alloy platters full of data. Flash drives and newer solid-state drives have no moving parts, but their chips also live only so long.

There are many other ways to lose files, including accidental file deletion and disc reformatting, viruses, and failed upgrades and installs that corrupt data.

So, what if all your digital files suddenly go poof?

Don’t panic. Lost data can probably be recovered. But resurrection often ain’t cheap: You might have to pay a professional hundreds or even thousands of dollars to do it.

Here’s what to do if disaster strikes—and how to avoid it in the first place.

First, Do No Further Harm

If you hear strange grinding, clicking, or other noises coming from a mechanical drive, stop. This could indicate drive failure or physical damage caused by a torn or dead head, scratched platter, or stuck spindle motor. Serious stuff.

Immediately turn it off. Don’t try to get it running again, because that could cause more damage and data loss. Fixing this involves complex electronic surgery and will cost the biggest bucks.

Getting Help

Start at a good computer repair shop. Our ratings of shops include several that receive high ratings in our surveys of local consumers plus our price ratings, based on quotes collected by our undercover shoppers.

Most shops can handle simple data recovery but typically lack the training, equipment, and facilities to operate on a physically damaged drive. If they can’t solve your problem, they’ll likely refer you to a specialist.

Local Data Recovery Specialists

Get referrals to local specialists, if possible. That way, you can talk face-to-face with the person who will do the work. That’s key, since “there’s no industry standard certification for data recovery, so you want to get a gut sense of whether he’s competent,” says Steve Burgess, president of Burgess Consulting and Forensics in San Luis Obispo, Calif.

You want someone well-trained and with much experience in this methodical precision work. For example, in 1984 Burgess started what he believes was one of the first U.S. data recovery services in the San Francisco Bay Area. He’s done about 20,000 recoveries since, and now performs forensic data recovery for litigation.

We also spoke with Don Anderson, president of Tri-State Data Recovery in Havertown, Penn., which he opened in 2010 after 15 years as a computer technician and IT specialist. He's traveled to China, Serbia, Poland, and Russia to get training directly from the developers of the data recovery hardware and software he uses. “Russia is the best in the world at data recovery—and the best way to learn about data recovery engineering is to travel to the source,” says Anderson.

Ask specialists to explain how they’ll get the data. Do they have a cleanroom (where filtered air minimizes dust particles and contamination of the drives when they’re opened up)? How long have their techs been doing recovery work? Ask for diagnoses and the probability of recovering what percentage of data. Get cost estimates.

National Specialists

Several national services also do recovery: Drop the drive off if the firm has offices in your city, or pack it up, typically print a pre-paid shipping label, send it out, and they’ll diagnose and price the job. You may or may not be able to talk with the engineer or technician who will do the recovery; some of the companies we contacted say you often can talk with theirs, but with others you can’t.

We asked computer repair pros to recommend national services, based on their own experiences sending them drives. Their picks:

Apple Stores, which rate very highly in our customer surveys for repair service but rarely do recovery work themselves, refer to DriveSavers, Data Savers, LLC, and Lazarus Data Recovery.

No Physical Damage? Try DIY

If the drive is not making cringe-worthy noises, it probably isn’t damaged but may have a “logical error,” a sudden inability of the disc controller software to find and access some of the data on the disc. This is a simpler recovery problem that computer repair shops can usually handle.

But believe it or not, experts say you may be able to recover the data yourself—if you’re comfortable with technology, wish to avoid paying someone else, and are willing to risk failure and maybe further data loss. Try these fixes (and run to a repair pro if they don’t work):

If your computer won’t start, the “boot” files are probably damaged but the data files may be fine. Remove the computer’s internal drive, and buy a “SATA interface case” for $10 to $20. The internal drive plugs inside the SATA case, which turns the whole thing into an external drive with a USB cable.

Plug that cable into a different functioning computer, which should be able to read the data files. Copy the data off the bad drive onto a new one.

Avoid this major screw-up: “A lot of do-it-yourselfers try to save the data they’re recovering to the same drive that has a problem,” says Jon Yaeger, owner of Data Savers. That can overwrite the source files they’re trying to recover and eventually destroys lots of data before it can be recovered.

“It’s like a snake eating its own tail,” says Brian Gill, chairman of Gillware. Once a drive writes over what’s already written on a sector, the original is gone. “We can’t recover that, and we see that once or twice a week,” says Gill.

If that doesn’t work, you may have a file structure problem. Keep the SATA drive plugged into that second computer, and download recovery software. There are plenty of brands, including Stellar and GetDataBack. These will scan your drive and tell if files can be recovered. If they can, you pay $79 (GetDataBack) or $80 (Stellar) to buy. Then, copy the files to a fresh drive—and not to the same problematic drive. If this software can’t get your data, you pay nothing.

This same software can also recover accidentally deleted files and—if you’re a real noob—accidentally reformatted drives.

Shop for the Best Price

Prices range widely. Simple recoveries due to logical problems can cost $100 to $1,000. Recoveries from physically damaged drives can run $600 to $2,500.

Start by getting a ballpark price. But ultimately, you won’t really know the final price until someone actually looks under the hood—for free or for a diagnosis fee of $30 to $70. Generally, if they can’t recover data, there’s no further charge. If they can, you’ll have to decide if those lost files are worth the recovery cost.

Back it up!

To prevent all this from happening again, back up your digital stuff.

  • Focus on your photo files. Recovery experts say pics are what consumers most want to get back. Since storage is cheap, keep multiple backups of your highly prized files on more than one high-capacity drive. One convenient way to do that is with the Western Digital My Book Duo, a case with two drives inside, which store mirror images of the data; if one fails, get your data from the second drive. Cost with four-terabyte capacity: about $230.
  • Also back up to a cloud. Two drives in the same place could still be taken by hurricane, tornado, fire, flood, or thieves. So you should also back up to a cloud, an easily accessible redundant off-site location.
  • If you mostly have photos and home videos to store, Google+ offers users unlimited free cloud storage of them, with the caveat that you’ll need to cap your video resolution at 1080p and your photo resolution at 16 megapixels (not a problem for most of us). Amazon Prime members can back up unlimited pics to its cloud for free.
  • Many companies (Dropbox, Apple, Google, Amazon, IDrive) offer free cloud backup, usually capped at 2 to 5GB, which is plenty for most of us. If you need more, sign up with two or three services, or buy a large-capacity plan. For example, with Amazon you can get 100GB of space for $11.99 a year and 1TB for $59.99 a year. IDrive offers 10GB of backup for free or 100GB for $2.95 per year.
  • Get a hard drive or cloud storage service that offers a syncing feature. When you plug in a backup drive or log on to a cloud service’s website, these devices or sites automatically scan the folders you want backed up, examine them for changes, and save new or altered files. As long as you correctly designate the folders where you’ve saved stuff you want to keep, you don’t have to do anything else.
  • But if you enable syncing features, don’t treat cloud backup as a secondary storage device if your computer runs low on space. If you upload a file onto your cloud account, and then delete the copy from your hard drive, the service will notice the deletion while syncing, assume you deleted it because you no longer wanted it, and delete the uploaded copy.
  • Before signing on for terabytes of backup space to stow your music and movies, check with the vendors who sold them to you. Most digital music and movie sellers allow you to re-download content you own, so backing up these files is unnecessary.
  • Replace old backup drives with new ones. If one or more older external hard drives have piled up around your house, offload their contents to new drives with terabytes of capacity, since photos eat up lots of disc space. Write the purchase date on the new drive with a permanent marker, so you know when to plan for that drive’s ultimate demise several years from now.
  • Archive for your lifetime x10. For the ultimate in archiving longevity, Mike Cobb, DriveSavers’ director of engineering, recommends optical storage, specifically Milleniatta’s M-Disc DVD+R and BD-R discs, which are rated to last 1,000 years. An M-ready DVD burner and 30 4.7GB optical discs costs $108, and that should cover you for the next 30 generations to come. “Of course, we won’t know for sure if this is true for another 995 years, give or take,” says Cobb.