home
·
contact
·
privacy
projects
/
config
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add local PeerTube config.
[config]
/
buster
/
setup_scripts
/
migrate_app.sh
diff --git
a/buster/setup_scripts/migrate_app.sh
b/buster/setup_scripts/migrate_app.sh
index 5f1959852305439d4dbc63b0d70a578bd3dc4835..cda12f564a010c764eff894b438b17f1ee8b6834 100755
(executable)
--- a/
buster/setup_scripts/migrate_app.sh
+++ b/
buster/setup_scripts/migrate_app.sh
@@
-2,8
+2,8
@@
set -e
set -x
set -e
set -x
-if [ "$#" -lt
4
]; then
- echo 'Need
at least four arguments: old server IP, service name, DB name, and backup directory names
.'
+if [ "$#" -lt
2
]; then
+ echo 'Need
two arguments: old server IP, and service name
.'
false
fi
if [ ! "$2" = "pleroma" ] && [ ! "$2" = "peertube" ]; then
false
fi
if [ ! "$2" = "pleroma" ] && [ ! "$2" = "peertube" ]; then
@@
-12,8
+12,13
@@
if [ ! "$2" = "pleroma" ] && [ ! "$2" = "peertube" ]; then
fi
server_ip="$1"
app="$2"
fi
server_ip="$1"
app="$2"
-db_name="$3"
-shift 3
+if [ "${app}" = "pleroma" ]; then
+ db_name="pleroma"
+ dirs="/var/lib/pleroma/uploads /etc/pleroma"
+elif [ "${app}" = "peertube" ]; then
+ db_name="peertube_prod"
+ dirs="/var/www/peertube/storage /var/www/peertube/config"
+fi
config_tree_prefix="${HOME}/config/buster"
setup_scripts_dir="${config_tree_prefix}/setup_scripts"
config_tree_prefix="${HOME}/config/buster"
setup_scripts_dir="${config_tree_prefix}/setup_scripts"
@@
-23,6
+28,6
@@
cd "${setup_scripts_dir}"
read -p'Hit Enter when you are done.' ignore
eval $(ssh-agent) && ssh-add
echo 'Enter password for root on target server next.'
read -p'Hit Enter when you are done.' ignore
eval $(ssh-agent) && ssh-add
echo 'Enter password for root on target server next.'
-ssh plom@"${server_ip}" "su -lc \"cd config/buster/setup_scripts && git pull && ./backup_app.sh ${app} ${db_name} $
@
\""
+ssh plom@"${server_ip}" "su -lc \"cd config/buster/setup_scripts && git pull && ./backup_app.sh ${app} ${db_name} $
{dirs}
\""
scp plom@"${server_ip}":~/${app}_backup.tar /home/plom/${app}_backup.tar
scp plom@"${server_ip}":~/${app}_backup.tar /home/plom/${app}_backup.tar
-./restore_
${app}.sh
+./restore_
app.sh "${app}" "${db_name}"