home · contact · privacy
Plemora migration scripts.
authorChristian Heller <c.heller@plomlompom.de>
Thu, 23 Jan 2020 22:03:36 +0000 (23:03 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Thu, 23 Jan 2020 22:03:36 +0000 (23:03 +0100)
buster/setup_scripts/backup_pleroma.sh [new file with mode: 0755]
buster/setup_scripts/restore_pleroma.sh [new file with mode: 0755]

diff --git a/buster/setup_scripts/backup_pleroma.sh b/buster/setup_scripts/backup_pleroma.sh
new file mode 100755 (executable)
index 0000000..ae1e6bd
--- /dev/null
@@ -0,0 +1,15 @@
+#!/bin/sh
+set -e
+# Heavily inspired by <https://docs.pleroma.social/backup.html>
+
+service pleroma stop
+su postgres -lc 'pg_dump -d pleroma --format=custom -f /tmp/pleroma.pgdump'
+cd /tmp
+mkdir pleroma_backup
+mv pleroma.pgdump pleroma_backup
+cp -a /var/lib/pleroma/uploads pleroma_backup/uploads
+cp -a /etc/pleroma pleroma_backup/etc_files
+tar cf pleroma_backup.tar pleroma_backup
+chown plom:plom pleroma_backup.tar
+mv pleroma_backup.tar /home/plom/
+service pleroma start
diff --git a/buster/setup_scripts/restore_pleroma.sh b/buster/setup_scripts/restore_pleroma.sh
new file mode 100755 (executable)
index 0000000..4f4d05b
--- /dev/null
@@ -0,0 +1,12 @@
+#!/bin/sh
+set -e
+# Heavily inspired by <https://docs.pleroma.social/backup.html>
+
+service pleroma stop
+mv /home/plom/pleroma_backup.tar /tmp/
+cd /tmp
+tar xf pleroma_backup.tar
+cp -a pleroma_backup/uploads/* /var/lib/pleroma/uploads/
+cp -a pleroma_backup/etc_files/* /etc/pleroma/
+su postgres -lc 'pg_restore --clean -d pleroma -v -1 /tmp/pleroma_backup/pleroma.pgdump'
+service pleroma start