Blog
Bitcoin Core wallet.dat Recovery: How to Restore an Old Wallet File
In short
Recovering a Bitcoin Core wallet.dat starts with preserving the original and identifying what prevents access. Make independent copies before testing; a filename or visible balance does not prove the file contains spendable keys.
- Check the format and software version. Descriptor wallets can be restored; legacy Berkeley DB wallets require migration in current Bitcoin Core releases. Avoid migration with 30.0 or 30.1.
- Encryption protects private keys, not address information. Spending requires the password; a forgotten password needs a separate assessment.
- For a missing balance, check the loaded wallet, synchronization and older backups. Rescanning cannot recreate missing keys.
- If the file was deleted or damaged, stop writing to the source drive and assess recovery from a copy or disk image. Success depends on the data that survives.

You found a wallet.dat file. Maybe it was on an old hard drive, in a backup folder you had forgotten about, on a USB stick with a cryptic label or in a cloud archive from years ago. It might hold bitcoin, but you don’t know how to open it, whether it is encrypted or how much is inside. This guide takes you from the file to a wallet you can use again: how to open it, check it for funds, handle encryption and recover access when the file was deleted or damaged, in an order that protects the file at every step.
Finding wallet.dat is a starting point, not proof that the file can spend bitcoin. A wallet may contain private keys, encrypted keys, or only public information for watching addresses.
What a wallet.dat file actually is
Bitcoin Core keeps each wallet in a database file named wallet.dat. It holds the private keys that control your addresses, along with the addresses themselves, their labels and the transaction history (Bitcoin Core file documentation). The file is the wallet: if it contains the keys and you can unlock it, you control the coins those addresses still hold.
There are two formats, and the filename alone does not distinguish them:
- Legacy wallets use Berkeley DB. Every wallet created before Bitcoin Core 0.21 is a legacy wallet, and so is a wallet created before version 23.0 unless the descriptor option was chosen.
- Descriptor wallets use SQLite. They arrived in Bitcoin Core 0.21 and became the default for new wallets in version 23.0, released in April 2022.
On macOS or Linux, the file command run on a copy tells them apart: it reports a legacy wallet as a Berkeley DB (Btree) file and a descriptor wallet as an SQLite 3.x database. The format matters because it decides which Bitcoin Core versions can still open the file.
Where Bitcoin Core stores wallet.dat
Look in the default data directory first:
- Linux:
~/.bitcoin/ - macOS:
~/Library/Application Support/Bitcoin/ - Windows:
%APPDATA%\Bitcoin\on installations that began before Bitcoin Core 28.0, and%LOCALAPPDATA%\Bitcoin\on newer ones. Version 28.0 moved the default but keeps using the old folder when it exists.
Newer installations keep wallets in a wallets folder inside the data directory: the default wallet as wallets/wallet.dat, and each named wallet in its own subfolder. Older installations keep wallet.dat in the data directory itself. A custom data or wallet directory can sit anywhere, so search the whole drive for files named wallet.dat too.
Bitcoin Core does not generate a recovery phrase. If you have 12 or 24 words, they belong to a different wallet; our guide to the Bitcoin Core seed phrase explains why. Keep file recovery separate from instructions for BIP-39 wallets.
Step 1: Make copies before doing anything else
Before you open, move or test anything, make at least two copies of the file and keep them in separate places. Treat the original as the master copy: don’t run recovery tools on it, don’t open it in wallet software and don’t rename it. Keep the original file and existing backups unchanged, work only on copies from here on, and never copy the file over another wallet’s wallet.dat.
Some operations write to the file they open: migration converts a wallet to a new format, and under rare circumstances a failed migration in Bitcoin Core 30.0 and 30.1 could delete the files in the wallet directory. Damage to the only original cannot be undone. Anyone with a copy of an unencrypted wallet.dat can spend what it controls, so keep copies on offline media you control, not in email or shared cloud folders.
If Bitcoin Core still opens the wallet, its backup function (File > Backup Wallet…) is preferable to copying a database while the application is writing to it. Record which device and version the file came from.
Keep a note of when each copy was made and when you last used the wallet. A newer file date does not prove that a backup is more complete. Retain older copies until you know which addresses and keys each one contains. If the file was deleted or the drive is failing, avoid installing recovery software on that drive: further writes can overwrite data you still need. Our guide to safe handling of old wallets and drives covers hashing and imaging in more detail.
Step 2: Check whether the wallet contains funded addresses
Before you spend days on password recovery or file repair, find out whether there is any bitcoin to recover. You don’t need the password for this: Bitcoin Core encrypts only the private keys, and the addresses and transactions stay readable. That has been the design since wallet encryption arrived in Bitcoin 0.4.0 in 2011, and the current wallet documentation says the same.
- If the wallet loads (see Step 3), Window > Receiving addresses lists its receiving addresses and their labels, and the balance is accurate once the node has synced.
- If it doesn’t load yet, look up an address you know you used, for example from your own records of an old payment, on a block explorer such as mempool.space. If you have no address at all, the addresses can still be read from the file itself because they are not encrypted; that is technical work, so do it offline and on a copy.
If the addresses show a balance, the file is worth working on. If every address shows zero, or only old transactions whose coins were later spent, no password recovery will change that.
Two cautions apply. Change from past payments goes to addresses that the receiving list leaves out, so a few empty receiving addresses do not prove the wallet is empty; the balance after a full sync is the reliable figure. And a balance is not access. A watch-only wallet displays balances without holding any private keys. In that case the displayed balance does not supply the missing keys: locate the wallet or backup that holds them, because repairing this public-information copy does not add them.
Step 3: Load the wallet in Bitcoin Core
Older guides say to place wallet.dat in the data directory and start Bitcoin Core. That can overwrite another wallet, and Bitcoin Core 30.0 removed direct loading of legacy wallets, so “install the latest version and open it” is not a universal procedure. The right route depends on the format:
- Descriptor wallet: in a current release, choose File > Restore Wallet…, select your copy and give the wallet a name. Bitcoin Core copies the file into its wallets folder and loads it.
- Legacy wallet: a current release refuses to load it and asks you to migrate it instead. In version 31.0 or later, choose File > Migrate Wallet > Restore and Migrate Wallet File…, select your copy and name the wallet. Bitcoin Core copies the file into its wallets folder without modifying the original, converts it to a descriptor wallet and keeps a backup whose name ends in
.legacy.bak. Watch-only and other keyless scripts may move to extra wallets ending in_watchonlyor_solvables. The migratewallet console command performs only the migration: it takes the name of a wallet, not a backup file to restore.
Three points matter when you migrate:
- Use version 30.2 or later. Do not use versions 30.0 or 30.1 for migration: Bitcoin Core published a warning about a failure that could delete wallet files, and version 30.2 fixed it in January 2026.
- An encrypted legacy wallet migrates only with its password, which Bitcoin Core asks for before converting. Without the password, a current release cannot open the wallet at all. Releases before 30.0 still load legacy wallets directly; use one only on a copy, for example to see the addresses and balance while the password is still missing.
- After migrating, make a new backup, as Bitcoin Core’s documentation advises. Always preserve independent backups before migration or repair.
Once the wallet is loaded, Bitcoin Core scans the blockchain for its transactions. A new node must first download and verify the whole chain, which Bitcoin Core now puts at more than 850 GB. Pruning cuts the storage to as little as about 10 GB, but a pruned node cannot rescan blocks it has already deleted, so a wallet loaded after pruning may force a full download again. If you only want to check the balance and move the coins, you don’t need a full node; see the section on extracting private keys below.
Step 4: Handle encryption
If Bitcoin Core asks for a password when you try to send coins or export keys, the wallet is encrypted. Bitcoin Core’s dialogs call this password the wallet passphrase; it protects the file and is not a BIP-39 passphrase. With an old wallet, it may have been set years ago and since forgotten.
Once the wallet is loaded, you can still see its addresses and balance without the password, because only the private keys are encrypted. Spending and exporting keys need the password, and there is no reset. If the wallet opens but asks for a password when signing a transaction, treat this as a password question, not evidence of a damaged file.
For the full process, see our guide to Bitcoin Core password recovery. The wallet.dat password guide covers the technical side of a brute-force search: what information makes a password search assessable and why it runs on a copy. Describe the problem without sending the file or password through an inquiry form.
The file opens, but the expected balance is missing
First confirm the name of the loaded wallet and the directory it was loaded from. Bitcoin Core can manage more than one wallet; opening a different wallet or a newly created empty one does not restore the file you found.
Use a receiving address you know you used. Compare it with the loaded wallet, then check whether Bitcoin Core has synchronized and scanned the relevant transaction history. Rescanning can find transactions for keys already present; it cannot recreate missing private keys.
An old non-HD wallet backup may lack keys generated after that backup was made. This is one reason to compare several surviving copies rather than discarding them as soon as one opens.
Recovering a deleted wallet.dat
Check existing backups and the configured wallet directory before assuming the file was deleted. On Windows, look in both the old and the new data folder listed above.
If the file really was deleted, all is not necessarily lost. Deleting a file removes the file system’s record of it, not the data itself. The content stays on the drive until the space it occupied is reused for new files.
On a traditional hard drive (HDD), a deleted wallet.dat can survive as long as nothing overwrites it, so a drive that has barely been used since gives the best chance. Solid-state drives (SSDs) are different. When a file is deleted, the operating system tells the drive which blocks are now free, a notice called TRIM, and the drive can erase those blocks in the background. Windows enables TRIM by default on NTFS volumes (Microsoft documentation), so on an SSD the window for recovery is much shorter.
If you suspect a wallet.dat was deleted:
- Stop using the drive at once. Don’t install software on it, don’t save files to it and, ideally, don’t boot from it.
- Image the drive before anything else, so that all further work runs on the image and the original is never written to.
- File carving tools then search the image for the structure of a wallet file and try to rebuild it from fragments.
- Save anything recovered to a different drive.
This is specialist work, and the chances depend heavily on how much the drive was used after the deletion. Our case study of a deleted Bitcoin Core wallet.dat shows the process on a drive that had been left largely untouched.
Dealing with a corrupted wallet.dat
A wallet file can be damaged by failing storage, such as bad sectors or a USB stick that does not finish its writes, or by an interrupted write. Bitcoin Core then refuses to load it with the error “Wallet corrupted”, or loads it with a warning that transaction data or address metadata may be missing or incorrect.
Before treating the file as damaged, record the exact error and Bitcoin Core version, and check compatibility first. A current release rejects every legacy wallet with an error saying it is a legacy wallet that must be migrated, and an older release may say that the wallet requires a newer version of Bitcoin Core. Neither message means the file is damaged.
If corruption is still suspected, assess a repair on a separate copy. Bitcoin Core’s old -salvagewallet startup option was removed in version 0.21 and replaced by the salvage command of the bitcoin-wallet tool, which tries to recover private keys from a corrupt wallet and is marked experimental. That command is only available in releases before 30.0. It renames the damaged file to a .bak copy and writes the private-key records it can still read into a new wallet file, so run it only on a copy.
If salvage fails, the key records may still be intact even though the database structure is damaged. Extracting private keys directly from the raw data, bypassing the database layer, needs specialized tools and experience with the file format. Do not keep changing software versions or repairing the only original. Our page on corrupted wallet files explains how to tell file damage from a failing drive.
Extracting private keys without a full node
If you don’t want to download the whole blockchain, you can export the private keys and move the coins with a lighter wallet, which looks up balances through its own servers.
- Legacy wallet in a release before 30.0: the
dumpwalletconsole command writes all of the wallet’s keys to a text file in human-readable form. Bitcoin Core 30.0 removed it, along withdumpprivkey. - Descriptor or migrated wallet:
listdescriptors trueshows the wallet’s private descriptors instead of a plain list of keys, so only wallet software that imports descriptors can use them.
Electrum can work with exported private keys in two ways. It can sweep them (Wallet > Private Keys > Sweep), which sends the coins to an address in an Electrum wallet you created, or it can import them into a new wallet without a seed, which you must back up separately because it cannot be restored from a seed. Sweeping into a fresh wallet of your own is the simpler result.
An export file holds every key in plain text, and anyone who reads it can take the coins. Keep it off email and cloud storage, and delete it once the coins have moved.
If the wallet is encrypted, you need the password before you can export anything. There is no shortcut around this: the encryption covers exactly the private keys, and no export command works until they are decrypted.
Help with a wallet.dat file you cannot open
If the file is encrypted with a forgotten password, deleted, damaged or simply won’t open, Crypto Recovers can assess it. We have completed 200+ recoveries since 2019, the first assessment is free, and the rule is no recovery, no fee. Read more about our Bitcoin Core recovery service.
If you ask Crypto Recovers to assess the file, we never hold your bitcoin or take our fee out of it. When access is restored, you open the wallet yourself, send the coins to a new wallet you created, and pay the agreed fee separately, under the contract.
Official documentation
- Bitcoin Core: managing wallets (backup, restore, migration)
- Bitcoin Core 30.0: wallet compatibility
- Bitcoin Core: wallet migration warning
- Bitcoin Core: backupwallet
- Bitcoin Core: rescanblockchain
- Bitcoin Core: newkeypool
- Bitcoin Core: check the loaded wallet with getwalletinfo
- Bitcoin Core: wallet directories and loadwallet
FAQ: Bitcoin Core wallet.dat recovery
Can I open a wallet.dat file without Bitcoin Core?
Partly. Bitcoin Core’s own bitcoin-wallet utility is an offline tool: it reads wallet files without running the node or downloading the blockchain. Older open-source tools such as pywallet can read legacy Berkeley DB files and export their keys, but pywallet still lists Python 2 as a requirement, so it needs command-line comfort and an old, offline setup. For an encrypted wallet you still need the password, whichever tool you use. Never upload the file to a website that offers to open it.
I have a wallet.dat from 2010. Will it work with the latest Bitcoin Core?
Not directly. A wallet from 2010 is a legacy Berkeley DB wallet, and Bitcoin Core 30.0 and later no longer load those. A current release can migrate it: on a copy, use File > Migrate Wallet > Restore and Migrate Wallet File… in version 31.0 or later. Wallet encryption only arrived with version 0.4.0 in September 2011, so a 2010 wallet is encrypted only if a password was set later in a newer version. If it was, the migration asks for that password. Releases before 30.0 can still load the file without migrating it.
How do I know if my wallet.dat is encrypted?
Load it in Bitcoin Core and try to send a small amount or export a private key: if Bitcoin Core asks for the wallet passphrase, the wallet is encrypted. You can also check without trying. For an encrypted wallet, the Settings menu shows Encrypt Wallet… checked and grayed out with Change Passphrase… available, and a lock icon appears in the status bar. In the console, getwalletinfo includes an unlocked_until field only for encrypted wallets. For a legacy file in a current release, the migration asks for the password before it converts an encrypted wallet.
Someone is selling a wallet.dat with Bitcoin inside. Should I buy it?
No. This is a well-known scam. Either the seller keeps a copy of the keys and drains the wallet after you pay, or the advertised balance was never controlled by that file. A balance on a block explorer only proves that an address holds coins, not that the file for sale holds its keys. Legitimate wallets with funds are not sold, because anyone who kept a copy of the keys can spend the coins before the buyer does. Crypto Recovers does not work on bought wallet files; our article on wallet-for-sale scams explains the pattern.
I have an old wallet.dat and no password. What should I do?
Don’t start guessing on the original. Make two copies, check whether the wallet’s addresses hold any funds, and write down everything you remember about the password: words, dates, patterns and the keyboard you used then. If the wallet is funded, the password guides above explain how a search works, and a free assessment tells you whether a search is realistic before you commit to anything.
