<p>in c-lightning all the state information is stored in the <code>lightningd.sqlite3</code> database. so if you shutdown your daemon and you copy <code>hsm_secret</code> as well as <code>lightningd.sqlite3</code> you should be able to fire up the node again and have your channels operating (I did this already) </p>

<p>You have to be carefull though. If you start the node with an old backup of <code>lightningd.sqlite3</code> your channel partner might think you try to publish old state and will close the channels and redeem also your balance. </p>

<p>with only the <code>hsm_secret</code> it will be hard to close channels. you can derieve the keys you used but you are missing the signatures of your channel partners to reconstruct the commitment transactions. Technically (not 100% certain how the implementation handles this case) you can try a collaborative close with the third party just with your <code>hsm_secret</code> since you know the keys to the funidng txs and with the other party together you are able to spend them. However you would have to trust the partners to provide the correct channel balance that you previously had agreed upon.</p>

CC BY-SA 4.0
2018-09-17T08:58:18.187Z
2018-09-17T08:58:18.187Z
Rene Pickhardt
<p>If one wanted to restore a lightning network node, what files have to be saved? </p>

<p>I read that saving hsm_secret is enough to restore private key(s), but I also read about a problem with channels. How channels are restored after a re-installation of lightningd and the "pasting" of hsm_secret file?</p>

<p>And, if it is impossible to restore channels, how to force the closure of them so that one can retrieve all locked funds? </p>

<wallet-recovery><lightning-network><backup>
Restore lightning network node/channels
Bruce Wayne
# Restore lightning network node/channels

(Asked by: username_0 on 2018-08-31)

If one wanted to restore a lightning network node, what files have to be saved?

I read that saving hsm\_secret is enough to restore private key(s), but I also read about a problem with channels. How channels are restored after a re-installation of lightningd and the "pasting" of hsm\_secret file?

And, if it is impossible to restore channels, how to force the closure of them so that one can retrieve all locked funds?

**Tags:** wallet-recovery, lightning-network, backup


---

## 1 answers

### Answer by username_1 on 2018-09-17. Score: 1 | Accepted answer

in c-lightning all the state information is stored in the `lightningd.sqlite3` database. so if you shutdown your daemon and you copy `hsm_secret` as well as `lightningd.sqlite3` you should be able to fire up the node again and have your channels operating (I did this already)

You have to be carefull though. If you start the node with an old backup of `lightningd.sqlite3` your channel partner might think you try to publish old state and will close the channels and redeem also your balance.

with only the `hsm_secret` it will be hard to close channels. you can derieve the keys you used but you are missing the signatures of your channel partners to reconstruct the commitment transactions. Technically (not 100% certain how the implementation handles this case) you can try a collaborative close with the third party just with your `hsm_secret` since you know the keys to the funidng txs and with the other party together you are able to spend them. However you would have to trust the partners to provide the correct channel balance that you previously had agreed upon.


---

