Browse Source

internal ip

master
M.Goldshteyn 1 year ago
parent
commit
49fd20f1b3
  1. 20
      migration.sh

20
migration.sh

@ -79,8 +79,11 @@ change_config(){
# sshpass -p "$DESTINATION_PASSWORD" ssh $DESTINATION_USER@$DESTINATION_IP -p $DESTINATION_PORT "sed -i \"s|\(jdbc:postgresql://localhost:5432/\)[^?]*|\1${DESTINATION_DB_NAME}|g\" $DESTINATION_PLATFORM_PATH/conf/db.conf" # sshpass -p "$DESTINATION_PASSWORD" ssh $DESTINATION_USER@$DESTINATION_IP -p $DESTINATION_PORT "sed -i \"s|\(jdbc:postgresql://localhost:5432/\)[^?]*|\1${DESTINATION_DB_NAME}|g\" $DESTINATION_PLATFORM_PATH/conf/db.conf"
#db wo host sshpass -p "$DESTINATION_PASSWORD" ssh $DESTINATION_USER@$DESTINATION_IP -p $DESTINATION_PORT "sed -i \"s|\(jdbc:postgresql://[^:/]*:[0-9]*/\)[^?]*|\1${DESTINATION_DB_NAME}|g\" $DESTINATION_PLATFORM_PATH/conf/db.conf" #db wo host sshpass -p "$DESTINATION_PASSWORD" ssh $DESTINATION_USER@$DESTINATION_IP -p $DESTINATION_PORT "sed -i \"s|\(jdbc:postgresql://[^:/]*:[0-9]*/\)[^?]*|\1${DESTINATION_DB_NAME}|g\" $DESTINATION_PLATFORM_PATH/conf/db.conf"
sshpass -p "$DESTINATION_PASSWORD" ssh $DESTINATION_USER@$DESTINATION_IP -p $DESTINATION_PORT "sed -i \"s|\(jdbc:postgresql://[^:/]*:[0-9]*/\)[^?]*|\1${INTERNAL_DATABASE_IP}:5432/${DESTINATION_DB_NAME}|g\" $DESTINATION_PLATFORM_PATH/conf/db.conf" #sshpass -p "$DESTINATION_PASSWORD" ssh $DESTINATION_USER@$DESTINATION_IP -p $DESTINATION_PORT "sed -i \"s|\(jdbc:postgresql://[^:/]*:[0-9]*/\)[^?]*|\1${INTERNAL_DATABASE_IP}:5432/${DESTINATION_DB_NAME}|g\" $DESTINATION_PLATFORM_PATH/conf/db.conf"
#change host
sshpass -p "$DESTINATION_PASSWORD" ssh $DESTINATION_USER@$DESTINATION_IP -p $DESTINATION_PORT "sed -i \"s|\\(jdbc:postgresql://\\)[^:/]*|\\1${INTERNAL_DATABASE_IP}|g\" $DESTINATION_PLATFORM_PATH/conf/db.conf"
#change database name
sshpass -p "$DESTINATION_PASSWORD" ssh $DESTINATION_USER@$DESTINATION_IP -p $DESTINATION_PORT "sed -i \"s|\\(jdbc:postgresql://[^:/]*:[0-9]*/\\)[^?]*|\\1${DESTINATION_DB_NAME}|g\" $DESTINATION_PLATFORM_PATH/conf/db.conf"
} }
evt_full_rsync(){ evt_full_rsync(){
@ -108,15 +111,14 @@ fonts_rsync(){
sshpass -p "$DESTINATION_PASSWORD" rsync -e "ssh -p $DESTINATION_PORT" -avz --ignore-existing $SOURCE_PLATFORM_PATH/bin/storage/1/fonts/ $DESTINATION_USER@$DESTINATION_IP:$DESTINATION_PLATFORM_PATH/bin/storage/1/fonts/ sshpass -p "$DESTINATION_PASSWORD" rsync -e "ssh -p $DESTINATION_PORT" -avz --ignore-existing $SOURCE_PLATFORM_PATH/bin/storage/1/fonts/ $DESTINATION_USER@$DESTINATION_IP:$DESTINATION_PLATFORM_PATH/bin/storage/1/fonts/
} }
if [[ "$EVT_COMMON" == 0 ]]; then if [[ "$DOWNLOAD_PLATFORM" == 1 ]]; then
echo "Download only files from evt/common" echo "Download platform from source"
evt_common_files_rsync download_platform
elif [[ "$EVT_COMMON" == 1 ]]; then elif [[ "$EVT_COMMON" == 0 ]]; then
echo "Download full evt" echo "No download platform"
evt_full_rsync
fi fi
download_platform
db_backup db_backup
send_backup send_backup

Loading…
Cancel
Save