From: Christian Heller Date: Sun, 26 Jan 2020 22:59:39 +0000 (+0100) Subject: Improve Pleroma migration scripts. X-Git-Url: https://plomlompom.com/repos/%7B%7Bdb.prefix%7D%7D/condition?a=commitdiff_plain;h=6056185c5c3b7eafdf9e8bd3b9c3689cd249744b;p=config Improve Pleroma migration scripts. --- 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