This is just a small useful command:

ssh $1 "mysqldump --single-transaction --quick -u root -p$MYSQL_PASS1 $MYSQL_DB1 | gzip" | gzip -d | mysql -u upcload -p$MYSQL_PASS2 $MYSQL_DB2