Coins Lightning
Menu

Bitcoin Core keeps the original wallet database in place during migration to SQLite

On November 25, 2026, Bitcoin Core merged a change to how it migrates legacy wallets to SQLite. As U.Today reported on November 26, 2026, at 18:20 (UTC+08:00), the revised process keeps the original database in place until Bitcoin Core has successfully written the wallet records to the new one.

Previously, Bitcoin Core deleted the original database before writing its replacement. If it could not create the SQLite database or write the records, the user might have to restore the wallet from a backup by hand. The revised process builds the SQLite database alongside the original, then moves it into place once the write succeeds. The pull request also tests migration with a wallet stored on a separate filesystem.

The change follows earlier fixes for unnamed legacy wallets and for crashes when Bitcoin Core could not write to the wallet directory. It addresses three other ways migration can fail:

  • Wallet creation mismatch: Bitcoin Core now catches and reports mismatches that could previously crash the graphical application or produce a generic error. This lets the migration process restore the original wallet from its backup.
  • Read-only directory: An attempt to migrate a wallet in a read-only directory could previously skip cleanup. It now stops with a clear error, and a test checks that the wallet remains in its legacy format.
  • Leftover SQLite journal: Reusing a journal file left in the wallet directory could corrupt the new database. Bitcoin Core now stops migration if it finds one. The test checks that the journal remains untouched and the wallet stays in its legacy format.

Automatic recovery still has a limit. As Ryan Ofsky noted in his review, if Bitcoin Core fails while copying the backup back into place, the user must still restore it manually.