@@ -25,30 +25,32 @@ for type in 0 1 2 3 4 5; do
25
25
for db in smf lm2 ukgpl views; do
26
26
sort =(${=SSH_DATADUMP} " ls -1 /var/backup/mysql/srou-booby/mysql/gizmo71_${db} -${type} _*.sql.gz" ) | while read sql; do
27
27
echo " ** Processing $( basename $sql ) ..."
28
- DB_HOST=" --host ${SROU_DB_HOST} "
29
- ${=SSH_DATADUMP} " zcat $sql " < /dev/null | sed --regexp-extended -e " s/(DEFAULT CHARSET=|CHARACTER SET )latin1([; ])/\1utf8\2/g" \
30
- -e " s/XX(!50001 CREATE ALGORITHM=\S+\s+)/Ignore \1 - stupid bugs in dump and restore of views /g" \
31
- -e " s/XX(!50013 DEFINER=\S+@\S+ SQL SECURITY INVOKER)/Ignore \1 - user isn't local /g" \
32
- -e " s/(ENGINE=)DISABLED_MyISAM /\1InnoDB /g" \
33
- -e " s%https?://(www\.)simracing\.org\.uk%https://${SROU_HOST_WWW} %g" \
34
- -e " s%https?://replays\.simracing\.org\.uk%https://${SROU_HOST_REPLAY} %g" \
35
- -e " s%https?://downloads\.simracing\.org\.uk%https://${SROU_HOST_WWW} /downloads%g" \
36
- -e " s%https?://(www\.)?ukgpl\.com%https://${SROU_HOST_UKGPL} %g" |
37
- mysql ${=SHARED_OPTIONS} ${=MIGRATE_LOGIN} ${=DB_HOST} gizmo71_${db}
28
+ DB_HOST=" --host=${single_db} --port=${MYSQL_PORT} "
38
29
(
39
- if [ $type = 1 ]; then
30
+ echo " SET sql_log_bin = 0;"
31
+ ${=SSH_DATADUMP} " zcat $sql " < /dev/null | sed --regexp-extended -e " s/(DEFAULT CHARSET=|CHARACTER SET )latin1([; ])/\1utf8\2/g" \
32
+ -e " s/XX(!50001 CREATE ALGORITHM=\S+\s+)/Ignore \1 - stupid bugs in dump and restore of views /g" \
33
+ -e " s/XX(!50013 DEFINER=\S+@\S+ SQL SECURITY INVOKER)/Ignore \1 - user isn't local /g" \
34
+ -e " s/(ENGINE=)DISABLED_MyISAM /\1InnoDB /g" \
35
+ -e " s%https?://(www\.)simracing\.org\.uk%https://${SROU_HOST_WWW} %g" \
36
+ -e " s%https?://replays\.simracing\.org\.uk%https://${SROU_HOST_REPLAY} %g" \
37
+ -e " s%https?://downloads\.simracing\.org\.uk%https://${SROU_HOST_WWW} /downloads%g" \
38
+ -e " s%https?://(www\.)?ukgpl\.com%https://${SROU_HOST_UKGPL} %g"
39
+ # if [ $type = 1 ]; then
40
40
# if [ $db = smf ]; then
41
41
# echo "ALTER TABLE gizmo71_smf.smf_messages PARTITION BY KEY (ID_MSG) PARTITIONS 10;"
42
42
# echo "ALTER TABLE gizmo71_smf.smf_personal_messages PARTITION BY KEY (ID_PM) PARTITIONS 4;"
43
43
# elif [ $db = lm2 ]; then
44
44
# echo "ALTER TABLE gizmo71_lm2.lm2_event_entries PARTITION BY KEY (id_event_entry) PARTITIONS 10;"
45
45
# fi
46
- elif [ $type = 2 ]; then
47
- sleep 15 # Give replication a chance to work
48
- echo " FLUSH LOGS;"
49
- echo " PURGE BINARY LOGS BEFORE (NOW() - INTERVAL 30 MINUTE);"
50
- fi
51
- ) | mysql ${=SHARED_OPTIONS} ${=MIGRATE_LOGIN} ${=DB_HOST}
46
+ # elif [ $type = 2 ]; then
47
+ # sleep 15 # Give replication a chance to work
48
+ # echo "FLUSH LOGS;"
49
+ # echo "PURGE BINARY LOGS BEFORE (NOW() - INTERVAL 30 MINUTE);"
50
+ # fi
51
+ ) | tee >( mysql ${=SHARED_OPTIONS} ${=MIGRATE_LOGIN} --host=booby.aquarium.davegymer.org --port=${MYSQL_PORT} gizmo71_${db} ) \
52
+ >( mysql ${=SHARED_OPTIONS} ${=MIGRATE_LOGIN} --host=tern.aquarium.davegymer.org --port=${MYSQL_PORT} gizmo71_${db} ) \
53
+ > /dev/null
52
54
done
53
55
done
54
56
done
0 commit comments