4 # Heavily inspired by <https://docs.pleroma.social/backup.html>
7 mv /home/plom/pleroma_backup.tar /tmp/
9 tar xf pleroma_backup.tar
10 cp -a pleroma_backup/uploads/* /var/lib/pleroma/uploads/
11 cp -a pleroma_backup/etc_files/* /etc/pleroma/
12 su postgres -lc 'pg_restore --clean -d pleroma -v -1 /tmp/pleroma_backup/pleroma.pgdump'
14 # TODO: Horrible hack, improve.
15 db_pw=$(cat /etc/pleroma/config.exs | grep password | sed 's/[ ]*password\: *//g' | sed 's/,//g' | sed 's/"//g')
16 su postgres -lc "psql -c \"ALTER USER pleroma WITH PASSWORD '${db_pw}';\""