Bitcoin wallet.dat recovery guide

Work from a copy of your Bitcoin Core backup. Keep the original untouched while you check the file and try to recover keys.

1. Find the wallet file

If you still have the old computer or a copy of its files, look in the Bitcoin Core data directory. Check the wallets folder and any subfolders named after a wallet. Older installations can have a wallet.dat directly in the data directory. The location can change if you used a custom data directory or wallet folder.

  • Windows. Check %LOCALAPPDATA%\Bitcoin\ and %APPDATA%\Bitcoin\. Bitcoin Core can still use the older location after an upgrade.
  • macOS. Check ~/Library/Application Support/Bitcoin/.
  • Linux. Check ~/.bitcoin/.

Also check old backup drives for copies saved under other names. A Bitcoin Core backup can have a different extension. Keep each candidate and note which device or backup it came from, especially if several files have the same name. For custom directories and named wallets, see the Bitcoin Core file location reference.

2. Make a working copy

Use Bitcoin Core’s backup function when the wallet still opens. If you need to copy the database from a running installation, shut Bitcoin Core down fully first. Keep the original backup untouched and give the working copy a distinct name such as wallet-copy.dat. See the Bitcoin Core backup reference.

Put the working copy and any output in a private local folder outside file-sync services. If the only copy is on a drive with read errors, stop repeated attempts on that drive. A disk image or a separate readable backup gives you a safer file to work from.

Complete PyWallet-GSC setup before you disconnect from the network. Keep your wallet file, passphrase, and seed phrase out of websites and support requests.

3. Check the database format

On Ubuntu or WSL, the system file utility can identify some wallet formats without opening them in a wallet application. For a working copy named wallet-copy.dat, run file wallet-copy.dat.

  • Berkeley DB. If it came from Bitcoin Core, it is likely a legacy wallet. For an intact file, check Bitcoin Core’s migration options in the compatibility guide. PyWallet-GSC can attempt recovery when that route fails.
  • SQLite. This is the format Bitcoin Core uses for descriptor wallets. Try Bitcoin Core’s restore workflow for an intact backup. PyWallet-GSC’s SQLite scan produces possible keys that need independent verification.
  • Unrecognized data. Check for an empty or truncated file. The backup may be damaged, compressed, or from a different app. Look for a better copy or confirm which wallet created it before proceeding.

A recognizable database header can survive even when part of the file is damaged. Use the result to choose the next step and keep the file’s source in mind.

4. Run PyWallet-GSC on the copy

Open a terminal in the PyWallet-GSC project folder and follow the instructions for the version you installed. Use your working copy as input and choose a separate output filename for each attempt so you can tell which backup produced each result. See the PyWallet-GSC usage instructions.

A fallback message means the tool has switched from direct extraction to a scan for surviving data. If you see a file or permission error, check the input path and confirm that the output folder is writable. If an encrypted wallet asks for a passphrase you no longer have, see the comparison of password recovery tools.

5. Check what came back

An export may show the same key in hexadecimal and in Wallet Import Format (WIF). Both representations are sensitive. Read the export itself because a recovery summary can report candidate records even when it has written no usable keys.

To check the result, compare public addresses derived in a trusted offline wallet with receiving addresses from your own records. A key can correspond to different address types, so check the type your original wallet used.

If some addresses are missing, look for a newer backup. Early Bitcoin Core wallets generated unrelated keys, so a backup can be missing keys created after it was made. See the Bitcoin Core guide to wallet backups.

Why a key export can be empty

A watch-only wallet can show transactions and balances using public information. A wallet set up with a hardware signer can also show activity while the device holds the spending keys. If the wallet still opens in Bitcoin Core, check private_keys_enabled and external_signer in getwalletinfo. If you used a hardware signer, consult its maker’s backup and restore instructions.

For a wallet that held its own keys, check whether you copied the right file and look for another backup. Keep any intact backup even if you recover some keys. It may hold transaction history, address labels, or settings absent from the export.

6. Keep output and logs private

Recovery files can contain unencrypted private keys. Terminal output and logs such as pywallet_report_*.log can also reveal a passphrase. Keep them offline and out of cloud folders, screenshots, and support tickets.

For help with an error, share the operating system, PyWallet-GSC version, database type, and a short error message with sensitive details removed. Keep the wallet file, keys, and passphrase in your own workspace.