From 435ee20a40529204ddfb1ea1ae31614d5f6be8d6 Mon Sep 17 00:00:00 2001 From: BrunoSpy Date: Mon, 17 Apr 2023 12:21:25 +0200 Subject: [PATCH 1/2] Backup all databases and use portable format Portable format is recommended by influxdata for version > 1.4 --- scripts/backup | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/backup b/scripts/backup index f3b6604..8fe3357 100644 --- a/scripts/backup +++ b/scripts/backup @@ -64,7 +64,7 @@ if [ -d "/var/lib/influxdb/data/opentsdb" ]; then ynh_print_warn --message="The InfluxDB database will not be saved, because 'do_not_backup_data' is set." fi else - influxd backup -database opentsdb influxdb_data + influxd backup -portable influxdb_data fi fi From 1157a237d691273eebc30b668cba8c80df504031 Mon Sep 17 00:00:00 2001 From: BrunoSpy Date: Mon, 17 Apr 2023 12:24:26 +0200 Subject: [PATCH 2/2] Use portable format and restore all databases --- scripts/restore | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/scripts/restore b/scripts/restore index fdc5091..01a6258 100644 --- a/scripts/restore +++ b/scripts/restore @@ -93,10 +93,7 @@ ynh_script_progression --message="Restoring the InfluxDB database..." --weight=1 # That happens when passing automated tests (NetData not present) ynh_systemd_action --service_name=influxdb --action="stop" if [ "$(ls -A ./influxdb_data)" ] ; then - influxd restore -metadir /var/lib/influxdb/meta ./influxdb_data - if [ "$(ls -A ./influxdb_data/opentsdb*)" ] ; then - influxd restore -database opentsdb -datadir /var/lib/influxdb/data ./influxdb_data - fi + influxd restore -portable ./influxdb_data fi #=================================================