<p>The <code>accounts.sqlite3</code> file is managed by the built-in plugin <code>bkpr</code> (the bookkeeper plugin). It tracks each individual coin movement that was performed while the plugin was running, and will give detailed information as to where your funds are at any point in time.</p>
<p>The <code>emergency.recover</code> file was introduced in version <a href="https://github.com/ElementsProject/lightning/blob/master/CHANGELOG.md#0120---2022-08-23-web-8-init" rel="noreferrer">v0.12.0</a> and is equivalent to LND's Static Channel Backups (which is more of a emergency recovery rather than a backup, hence the name change). It contains the minimal set of information to know with whom you had a channel, what the funding parameters where, and how to contact them to ask them to shut down the channel. It requires cooperation from the peer, but in absence of a better backup it can be used to recover some funds. It is by no means a replacement for backups, rather a last ditch attempt at clawing back some funds. This file has to be backed up after each funding of a new channel, so ideally set up a cron job to do that for you.</p>

CC BY-SA 4.0
2023-05-31T13:21:36.000Z
`emergency.recover` was not generated back in 2021 when my friend funded their channel. They noticed the file some time in late 2022. Is `emergency.recover`'s creation based on the content of `lightningd.sqlite3`? Is `emergency.recover` created for each open channel (even for those channels funded before version 0.12.00)?
John Smith
CC BY-SA 4.0
2023-06-01T14:04:04.873Z
It is indeed recreated each time a new channel gets funded from the `lightningd.sqlite3`, so a single channel opening after the upgrade will create that file.
cdecker
CC BY-SA 4.0
2023-05-31T12:59:01.883Z
2023-05-31T12:59:01.883Z
cdecker
<p><a href="https://lightning.readthedocs.io/lightningd-config.5.html?highlight=accounts.sqlite3" rel="noreferrer"><code>accounts.sqlite3</code></a> and <a href="https://lightning.readthedocs.io/lightning-emergencyrecover.7.html" rel="noreferrer"><code>emergency.recover</code></a> are created in my <code>~/.lightning/bitcoin</code> when I launch <code>lightningd</code> - they weren't created there some years ago.  What are <code>accounts.sqlite3</code> and <code>emergency.recover</code> and why might I want to <a href="https://lightning.readthedocs.io/BACKUP.html" rel="noreferrer">back them up</a>?</p>

<backup><core-lightning><channels><static-channel-backups>
What are 'accounts.sqlite3' and 'emergency.recover' and why might I want to back them up?
John Smith
# What are 'accounts.sqlite3' and 'emergency.recover' and why might I want to back them up?

(Asked by: username_0 on 2023-05-31)

[`accounts.sqlite3`](https://lightning.readthedocs.io/lightningd-config.5.html?highlight=accounts.sqlite3) and [`emergency.recover`](https://lightning.readthedocs.io/lightning-emergencyrecover.7.html) are created in my `~/.lightning/bitcoin` when I launch `lightningd` - they weren't created there some years ago. What are `accounts.sqlite3` and `emergency.recover` and why might I want to [back them up](https://lightning.readthedocs.io/BACKUP.html)?

**Tags:** backup, core-lightning, channels, static-channel-backups


---

## 1 answers

### Answer by username_1 on 2023-05-31. Score: 7 | Accepted answer

The `accounts.sqlite3` file is managed by the built-in plugin `bkpr` (the bookkeeper plugin). It tracks each individual coin movement that was performed while the plugin was running, and will give detailed information as to where your funds are at any point in time.

The `emergency.recover` file was introduced in version [v0.12.0](https://github.com/ElementsProject/lightning/blob/master/CHANGELOG.md#0120---2022-08-23-web-8-init) and is equivalent to LND's Static Channel Backups (which is more of a emergency recovery rather than a backup, hence the name change). It contains the minimal set of information to know with whom you had a channel, what the funding parameters where, and how to contact them to ask them to shut down the channel. It requires cooperation from the peer, but in absence of a better backup it can be used to recover some funds. It is by no means a replacement for backups, rather a last ditch attempt at clawing back some funds. This file has to be backed up after each funding of a new channel, so ideally set up a cron job to do that for you.

> **Comments:**
> **username_0**: `emergency.recover` was not generated back in 2021 when my friend funded their channel. They noticed the file some time in late 2022. Is `emergency.recover`'s creation based on the content of `lightningd.sqlite3`? Is `emergency.recover` created for each open channel (even for those channels funded before version 0.12.00)?  
> **username_1**: It is indeed recreated each time a new channel gets funded from the `lightningd.sqlite3`, so a single channel opening after the upgrade will create that file.  

---

