Commit graph

6 commits

Author SHA1 Message Date
/rootzoll
432a0c720e
LNbits update to v0.11.2 (#4271)
* #4180 update to lnbits 0.11.2 & repair db access
2023-12-05 16:46:43 +01:00
openoms
084304531a
btcpay update to v1.9.1, migration to postgres (#3756)
* btcpay update to v1.9.0, migration to postgres
* update CHANGES.md
* always fix postgres files ownership
* add socksendpoint=127.0.0.1:9050 to fix #3729
* btcpay update to v1.9.1
* update changes
* create config directory in BtcPayConfig
2023-04-24 00:14:44 +02:00
openoms
57434aa107
BTCpay and NBXplorer update, use postgres for new installs (#3641)
* use postgres for new btcpay installs
keep sqlite if the database is present
clean and format the script with shellcheck
* reinstall the service on update and check postgres
* run userdel -rf btcpay when off
* btcpay update to v1.7.5
* add systemctl daemon-reload when changing service
* exit on failed builds
* Restart=always
* nbxplorer update to v2.3.58
* prevent the git error 'detected dubious ownership in repository'
2023-02-04 12:37:59 +00:00
ChuckNorrison
1c26120056
LNBits Backup and Restore database (#3412)
* LNBits Backup and Restore database

Add Backup and Restore methods and  menu entries

* LNBits backup target

based on blitz.backupdevice.sh switch backup target to /mnt/backup_manual per default

* Add postgresql script

Script to install or uninstall postgresql

Backup a single database with sql dump file

Restore a single database from sql dump file

* Unpack backup file only for SQLite

For postgresql just use the dedicated script

* Support multiple backup files

After backup file was written, keep only last 3 backups

Restore the recent backup found

* improve backup and restore with config and path

make use of raspiblitz config to retrieve db state for backup and restore

default manual backup path set to /mnt/hdd/app-data/backup

* add info command to postgresql script

retrieve database directory and database names

* update backup path for postgresql script

default path is /mnt/hdd/app-data/backup

this will survive reflash sd card

* improve user feedback

* add dialog for restore and improvements

dialog with confirm restore process

timestamps for backup file names

small improvements for user feedback

only resume if unpack backup succeed

* fix sqlite backup file name

* fix restore path and permissions

* add dialog to choose backup from a list

list all available backups to start restore in a dialog

* fix backup list for sqlite

* fix restore menu

* Update LNBits version with bigint fix for migration

if migrate to postgresql, use lnbits version with latest bigint fixes

* Update bonus.postgresql.sh

* fix postgres backup permissions
2022-12-14 10:40:15 +01:00
/rootzoll
fb9283a06c
Fatpack WebUI Apps (#3514) 2022-12-13 15:28:05 +01:00
/rootzoll
d7d1c40866
#3505 lnbits PostgresSQl migration finalization (#3507)
* fix missing dependencies

* LNBits SQLite to PostgreSQL migration (#3411)

* LNBits SQLite to PostgreSQL migration

New installations with PostgreSQL configuration, existent data with SQLite.

convert script needs a full start of LNBits prior migrating the old sqlite db's.

User can migrate from raspiblitz menu.

* only fix postgres if it needs to

check for symbolik link of postgres default directory or desired postgres folder

btcpayserver and lnbits could use postgresql

new script to install or uninstall postgresql

* fix typos

* silent apt remove

* fix removed function postgresConfig

call bonus.postgresql.sh to setup PostgreSQL

* Support outdated installation

old installations should upgrade to new tag first

create new data directory /mnt/hdd/app-data/LNBits/data

* Improve migration

Make it a bit more user friendly and prepare for a worst case to revert the migration if something fails unexpectedly

make use of sync method for preparation

* Rework migration workflow

Cant wait for lnbits to start when ExecStartPre is used.

We need a full start of lnbits prior migration, so make use of lsof to check for ports and wait.

dont forget to start postgres service after installation. dont forget to stop postgres after uninstall

* Dont overwrite the backup file

if we start migrate again, the sqlite backup should not be overwritten with postgres data. Keep the backup file.

* add migrate message to menu

add the hint to revert migration manually after migrate script executed

* fix install and data directory

lnbits always needs a data directory

* clean up lnbits settings for migration

even if postgresql is already running, we can extract sqlite backup and start migrate

remove migrateMsg duplicate

* preserve database for reflash

drop database only for migrate, not for regular installations

* set blitz config for LNBits

fix drop database only for migrate, not for regular installations

* Add confirmation dialog and automatic revert

User needs to confirm the process, this will eliminate missclicks

add a migrate revert function to automatically revert if something unexpected happens

let the user call the function manually

* check conv.py on success or revert

if the conversion script fails, revert automatically

* Improve revert message

Do not print the revert hint message if current database is SQLite

* fix read config LNBitsDB

* fix unpack backup

Folder LNBits should never block the restore of backup. Happened after multiple migrations and revert.

* Wait for lnbits v0.9.5

Set commit version with fix for postgresql database and BIGINT for amounts for migrate

Can be set to v0.9.5 tag or above later

* improve migrate backup handling

revert to the current backup and not to the previous backup.

No need for the failed folder state

user message with backup file path

* check psql version once

* supress expected errors

if database exists

Co-authored-by: /rootzoll <christian@geektank.de>

* fix error output on status

Co-authored-by: ChuckNorrison <2964146+ChuckNorrison@users.noreply.github.com>
2022-12-10 00:04:15 +01:00