From 6056185c5c3b7eafdf9e8bd3b9c3689cd249744b Mon Sep 17 00:00:00 2001 From: Christian Heller Date: Sun, 26 Jan 2020 23:59:39 +0100 Subject: [PATCH] Improve Pleroma migration scripts. --- buster/setup_scripts/backup_pleroma.sh | 2 +- buster/setup_scripts/migrate_pleroma.sh | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/buster/setup_scripts/backup_pleroma.sh b/buster/setup_scripts/backup_pleroma.sh index ae95b4d..75a484e 100755 --- a/buster/setup_scripts/backup_pleroma.sh +++ b/buster/setup_scripts/backup_pleroma.sh @@ -6,7 +6,7 @@ set -x service pleroma stop su postgres -lc 'pg_dump -d pleroma --format=custom -f /tmp/pleroma.pgdump' cd /tmp -mkdir pleroma_backup +mkdir -p pleroma_backup mv pleroma.pgdump pleroma_backup cp -a /var/lib/pleroma/uploads pleroma_backup/uploads cp -a /etc/pleroma pleroma_backup/etc_files diff --git a/buster/setup_scripts/migrate_pleroma.sh b/buster/setup_scripts/migrate_pleroma.sh index 5eefc39..80da33d 100755 --- a/buster/setup_scripts/migrate_pleroma.sh +++ b/buster/setup_scripts/migrate_pleroma.sh @@ -12,14 +12,10 @@ server_ip="$1" config_tree_prefix="${HOME}/config/buster" setup_scripts_dir="${config_tree_prefix}/setup_scripts" -# So we're only asked once … -eval $(ssh-agent) -ssh-add - cd "${setup_scripts_dir}" ./prepare_to_meet_server.sh "${server_ip}" +eval $(ssh-agent) && ssh-add read -p'Hit Enter when you are done.' ignore -ssh plom@"${server_ip}" 'su -lc "cd config && git pull"' -ssh plom@"${server_ip}" 'su -lc "cd config/buster/setup_scripts && ./backup_pleroma.sh"' +ssh plom@"${server_ip}" 'su -lc "cd config && git pull && cd config/buster/setup_scripts && ./backup_pleroma.sh"' scp plom@"${server_ip}":~/pleroma_backup.tar /home/plom/pleroma_backup.tar ./restore_pleroma.sh -- 2.30.2