Skip to content
This repository was archived by the owner on Dec 17, 2024. It is now read-only.

Commit 24ac151

Browse files
committed
Instructions to restore InfluxDB backups updated
To cover recent (1.5+) version "online" path. Issue #229
1 parent 1b986fd commit 24ac151

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

take_backup.sh

+18-6
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ BACKUP_FOLDER=pgwatch2_backup_$NAME
1010

1111
# change these as needed!
1212
PGHOST=127.0.0.1
13-
PGPORT=5434
13+
PGPORT=5432
1414
PGUSER=pgwatch2
1515
PGPASSWORD=pgwatch2admin
1616
PGWATCHDATABASE=pgwatch2
@@ -67,12 +67,24 @@ echo "done!"
6767
# 5. restore both Postgres DB dumps
6868
# psql -f ~/pgwatch2_backups/pgwatch2_backup_20170123/pgwatch2_config.sql pgwatch2
6969
# psql -f ~/pgwatch2_backups/pgwatch2_backup_20170123/grafana_config.sql pgwatch2_grafana
70-
# 6. log into the running Docker image and kill the InfluxDB process (as restoring requires it)
70+
# 6. Restore InfluxDB metrics data. Depending on InfluxDB version there are 2 paths: offline for 1.5 and lesser or oline
71+
# for 1.5+
72+
#
73+
# Offline steps for pre v1.5:
74+
#
75+
# * log into the running Docker image and kill the InfluxDB process (as restoring requires it)
7176
# pkill influxd
72-
# 7. restore InfluxDB meta files
77+
# * restore InfluxDB meta files
7378
# influxd restore -metadir /var/lib/influxdb/meta /pgwatch2_backups/influxdb_backup
74-
# 8. restore InfluxDB data files (real metric infos)
79+
# * restore InfluxDB data files (real metric infos)
7580
# influxd restore -database pgwatch2 -datadir /var/lib/influxdb/data /pgwatch2_backups/influxdb_backup
76-
# 9. restart the Docker image
81+
#
82+
# Online steps for v1.5+:
83+
#
84+
# * drop the exising empty pgwatch2 DB if any
85+
# * do the online restore
86+
# influxd restore -db pgwatch2 -online $BACKUP_FOLDER/influxdb_backup/
87+
#
88+
# 7. restart the Docker image and check that old config and metrics are there
7789
# docker stop pw2 && docker start pw2
78-
# 10. done!
90+
# 8. done!

0 commit comments

Comments
 (0)