home · contact · privacy
Fix.
[config] / buster / setup_scripts / migrate_peertube.sh
1 #!/bin/sh
2 set -e
3
4 # Heavily inspired by <https://docs.pleroma.social/backup.html>
5
6 if [ "$#" -ne 1 ]; then
7     echo 'Need server IP as argument.'
8     false
9 fi
10 server_ip="$1"
11
12 config_tree_prefix="${HOME}/config/buster"
13 setup_scripts_dir="${config_tree_prefix}/setup_scripts"
14
15 cd "${setup_scripts_dir}"
16 ./prepare_to_meet_server.sh "${server_ip}"
17 read -p'Hit Enter when you are done.' ignore
18 eval $(ssh-agent) && ssh-add
19 echo 'Enter password for root on target server next.'
20 ssh plom@"${server_ip}" 'su -lc "cd config/buster/setup_scripts && git pull && ./backup_peertube.sh"'
21 scp plom@"${server_ip}":~/peertube_backup.tar /home/plom/peertube_backup.tar
22 ./restore_peertube.sh
23