Builder's Guide
  • Welcome to the Builder's Guide to the LND Galaxy!
  • The Lightning Network
    • Overview
    • Payment Channels
      • Lifecycle of a Payment Channel
      • Watchtowers
      • Understanding Sweeping
      • Etymology
    • The Gossip Network
      • Identifying Good Peers on the Lightning Network
    • Pathfinding
      • Finding routes in the Lightning Network
      • Channel Fees
      • Multipath Payments (MPP)
    • Lightning Network Invoices
      • Understanding Lightning Invoices
    • Making Payments
      • The Payment Cycle
      • Timelocks
      • ⭐Hashed Timelock Contract (HTLC)
      • Payment Etymology
      • ⭐What Makes a Good Routing Node
      • Understanding Submarine Swaps
      • Instant Submarine Swaps
    • Liquidity
      • ⭐Understanding Liquidity
      • Managing Liquidity on the Lightning Network
      • Liquidity Management for Lightning Merchants
      • How to Get Inbound Capacity on the Lightning Network
      • Lightning Service Provider
    • L402: Lightning HTTP 402 Protocol
      • Macaroons
      • L402
      • 📋Protocol Specification
      • Implementations and Links
    • Taproot Assets
      • Taproot Assets Protocol
      • Taproot Assets on Lightning
      • Edge Nodes
      • Taproot Assets Trustless Swap
      • FAQ
      • Glossary
  • Lightning Network Tools
    • LND
      • 🛠️Get Started
      • lnd.conf
      • First Steps With LND
      • Wallet Management
      • Sending Payments
      • Atomic Multi-path Payments (AMP)
      • Receiving Payments
      • Unconfirmed Bitcoin Transactions
      • Channel Fees
      • Inbound Channel Fees
      • Macaroons
      • Configuring Watchtowers
      • Pathfinding
      • Blinded Paths
      • Key Import
      • Secure Your Lightning Network Node
      • Configuration of a Routing Node
      • Quick Tor Setup
      • Configuring Tor
      • Enable ‘Neutrino mode’ in Bitcoin Core
      • Send Messages With Keysend
      • Partially Signed Bitcoin Transactions
      • Bulk onchain actions with PSBTs
      • Sweeper
      • Debugging LND
      • Fuzzing LND
      • LND API documentation
      • Channel Acceptor
      • RPC Middleware Interceptor
      • HTLC Interceptor
      • NAT Traversal
      • Recovery: Planning for Failure
      • Migrating LND
      • Disaster recovery
      • Contribute to LND
    • Lightning Terminal
      • What is Lightning Terminal?
      • 🛠️Get litd
      • Run litd
      • Integrating litd
      • Demo: Litd Speed Run
      • Connect to Terminal
      • Recommended Channels
      • Rankings
      • Health Checks
      • Liquidity Report
      • Opening Lightning Network Channels
      • Managing Channel Liquidity
      • Autofees
      • AutoOpen
      • LND Accounts
      • Loop and Lightning Terminal
      • Loop Fees
      • Pool and Lightning Terminal
      • Command Line Interface
      • Troubleshooting
      • Lightning Node Connect: Under the hood
      • LNC Node Package
      • LITD API Documentation
      • Privacy and Security
      • Privacy Policy
      • Terms of Use
    • Loop
      • 🛠️Get Started
      • The Loop CLI
      • Autoloop
      • Static Loop In Addresses
      • Instant Loop Outs
      • Peer with Loop
      • Loop API Documentation
    • Pool
      • Overview
      • Quickstart
      • 🛠️Installation
      • First Steps
      • Accounts
      • Orders and Asks
      • Sidecar Channels
      • Zero-confirmation Channels
      • Channel Leases
      • Batch Execution
      • Account Recovery
      • Pool API Documentation
      • FAQs
    • Taproot Assets
      • Get Started
      • First Steps
      • Taproot Assets Channels
      • Asset Decimal Display
      • Become an Edge Node
      • RFQ
      • Collectibles
      • Universes
      • Asset Loop
      • Debugging Tapd
      • Multisignature
      • Minting Assets With an External Signer
      • Lightning Polar
      • Operational Safety Guidelines
      • Taproot Assets API Documentation
    • Aperture
      • ⚒️Get Aperture
      • LNC Backend
      • LNC Mailbox
      • Pricing
    • Faraday
      • 🛠️Get Started
      • The Faraday CLI
      • Faraday API Documentation
  • LAPPs
    • Guides
      • Use Polar to Build Your First LAPP
        • Setup: Local Cluster with Polar
        • Setup: Run the Completed App
        • Setup: Run the App Without LND
      • Add Features
        • Feature 1: Connect to LND
        • Feature 2: Display Node Alias and Balance
        • Feature 3: Sign and Verify Posts
        • Feature 4: Modify Upvote Action
      • Make Your own LNC-powered Application
    • Next Steps
  • Community Resources
    • Resource List
    • Lightning Bulb 💡
    • Glossary
    • FAQ
Powered by GitBook
On this page
  • When NOT to migrate LND
  • When to migrate LND
  • Prepare your new machine
  • Migrating LND
  • Migrating Litd
  • Checking your configuration file
  • Delete your TLS certificates
  • Start LND

Was this helpful?

  1. Lightning Network Tools
  2. LND

Migrating LND

Learn how to move your Lightning node to a new machine.

PreviousRecovery: Planning for FailureNextDisaster recovery

Last updated 9 days ago

Was this helpful?

Use this guide if you want to move your node to a different machine or location.

When NOT to migrate LND

Do NOT use this guide if you have experienced a fatal error.

Do NOT run two LND instances with the same seed or public key.

Do NOT restart an old instance after migration.

When to migrate LND

There are lots of reasons why you might want to migrate your Lightning Node. You might be changing your host, move from a VPS to a personal physical server or just prefer to run LND in a different way. Migrating LND is a relatively straightforward and easy process that should not take long.

If you have experienced a fatal error and would like to recover your Lightning node, do not use this guide. Regardless, it is good to read the article “” to learn how to best prepare for any recovery scenarios.

Read through this entire document before you begin your migration.

Prepare your new machine

It is not advised to migrate between different operating systems, as the file structures might differ in small, but important ways. This is especially true when migrating from or to a Windows machine. This is also true between different chip architectures. Before we begin the actual migration process, we must prepare our new machine. This will include:

  • Updating and your device

  • Installing and syncing your choice of Bitcoin node, unless you use Neutrino

  • Install and set up Tor, if desired

  • Install auxiliary services, such as , , or

Migrating LND

To begin our migration, we first shut down our old LND node gracefully (never turn it on again!). Use the command lncli stop and wait for the process to shut down completely, for example by observing the logs.

Unless otherwise specified in your lnd.conf file (check if unsure), all the data necessary for your migration is in your ~/.lnd directory.

To continue the migration, you should move all data from this directory to the new machine in the same location. Alternatively, the directory can be specified at startup with the flag --lnddir=

Logs and the data directory can also be split up, either by defining them in the configuration file, or at startup with --datdir= and --logdir=

Migrating Litd

Migrating these directories is not as sensitive as the LND base directory, and it may be done separately from LND, regardless of whether LND and Litd run as the same process or not.

Checking your configuration file

Now that you are running LND on a different machine, some variables might have changed and need to be amended for LND to smoothly connect. Some areas of concern/for review are:

  • Bitcoin RPC. You might connect to a different Bitcoin node with a new host, username or password

  • Bitcoin ZMQ. Easy to overlook!

  • If you are using Tor, the Socks proxy or control port and password might have changed

  • Your Lightning node might have a new IP, domain or onion that will require a new TLS certificate

Delete your TLS certificates

Unless your node’s IP address, domain or onion address will not change, you will need to delete your TLS certificates and key found in the ~/.lnd directory. This will regenerate them when you first start up your migrated node. You may also delete your macaroon files together with the macaroon.db in ~/.lnd/data/chain/bitcoin/mainnet to make sure any old copies are invalidated. Deleting the macaroon files alone does not invalidate them.

Start LND

To complete our migration, we will start up LND and unlock our wallet with the usual password. You may observe your logs and verify that all channels and funds are present with lncli getinfo, lncli walletbalance and lncli channelbalance.

Once you successfully start LND on your new machine, delete the lnd directory on the old platform and never start the old instance up ever again. Under no circumstances should two nodes with the same public key be run at the same time, as this will cause your channels to close and its funds possibly forfeited.

If you have funds in a or Pool Account, you will also have to migrate the ~/.loop and ~/.pool directories. To preserve sessions and other data, you are advised to migrate the ~/.lit directory as well.

Read: LND disaster recovery
Planning for failure
hardening
Install LND
Litd
Loop
Pool
Faraday
Loop Address
LNC