🪧New PostgreSQL 🐘 bonus guide + other related 🔄

A new bonus guide about a great database backend and others!

⚡️2FakTor⚡️

4. Juni 2024June 4, 2024 · 4 Min. Lesezeit4 min read · Aktualisiert am 22. Januar 2025Updated January 22, 2025

What's changed#



🪧 PD: If you want to use the old database backend of the LND or Nostr relay, follow the next extra sections:

⚠️Attention⚠️: The migration process was tested on testnet mode from an existing bbolt database backend to a new PostgreSQL database using lndinit and the results were successful. However, It wasn't tested on mainnet, according to the developer, it is in experimental status which could damage your existing LND database.🚨 Use it behind your responsibility 🧼


🔧 PR related: https://github.com/minibolt-guide/minibolt/pull/93


♻️ Migrate the PostgreSQL database location

Attention!! These instructions are invalid since the latest changes applied to the PostgreSQL bonus guide. See more information on the recent associated post by clicking ~ > HERE < ~

If you installed NBXplorer + BTCPay Server before 05/06/2024, it is probably you have the database of the PostgreSQL cluster on the default path (/var/lib/postgresql/16/main/), follow the next instructions to migrate it to the new dedicated location on /data/postgresdb folder:

sudo mkdir /data/postgresdb
sudo chown postgres:postgres /data/postgresdb
sudo chmod -R 700 /data/postgresdb
sudo systemctl stop nbxplorer && sudo systemctl stop btcpayserver
sudo systemctl stop postgresql
sudo rsync -av /var/lib/postgresql/16/main/ /data/postgresdb/

Expected output:

sending incremental file list
./
PG_VERSION
postgresql.auto.conf
postmaster.opts
postmaster.pid
base/
base/1/
base/1/112
base/1/113
base/1/1247
base/1/1247_fsm
base/1/1247_vm
base/1/1249
base/1/1249_fsm
base/1/1249_vm
[...]
pg_wal/000000010000000000000009
pg_wal/archive_status/
pg_xact/
pg_xact/0000

sent 164,483,875 bytes  received 42,341 bytes  36,561,381.33 bytes/sec
total size is 164,311,368  speedup is 1.00
sudo nano /etc/postgresql/16/main/postgresql.conf --linenumbers
data_directory = '/data/postgresdb'
sudo systemctl start postgresql
journalctl -fu postgresql

Example of the expected output:

Nov 08 11:51:10 minibolt systemd[1]: Stopped PostgreSQL RDBMS.
Nov 08 11:51:10 minibolt systemd[1]: Stopping PostgreSQL RDBMS...
Nov 08 11:51:13 minibolt systemd[1]: Starting PostgreSQL RDBMS...
Nov 08 11:51:13 minibolt systemd[1]: Finished PostgreSQL RDBMS.
journalctl -fu postgresql@16-main

Example of the expected output:

Nov 08 11:51:10 minibolt systemd[1]: Stopping PostgreSQL Cluster 16-main...
Nov 08 11:51:11 minibolt systemd[1]: postgresql@16-main.service: Succeeded.
Nov 08 11:51:11 minibolt systemd[1]: Stopped PostgreSQL Cluster 16-main.
Nov 08 11:51:11 minibolt systemd[1]: postgresql@16-main.service: Consumed 1h 10min 8.677s CPU time.
Nov 08 11:51:11 minibolt systemd[1]: Starting PostgreSQL Cluster 16-main...
Nov 08 11:51:13 minibolt systemd[1]: Started PostgreSQL Cluster 16-main.
sudo systemctl start nbxplorer && sudo systemctl start btcpayserver
journalctl -fu nbxplorer

journalctl -fu btcpayserver

Enjoy it MiniBolter! 💙

#DIY#bitcoin#database#download#generate#guide#install#lightning#migrate#minibolt#noderunner#postgresql#ramix#renovate#selfhost#sovereign#use#zerotrust

Written by

Comments

No comments yet. Start the conversation.