Go to source server and use below command for mysql-
mysqldump -R -uroot -proot_pass source_db | mysql -h remote_server_ip -uroot -proot_pass target_db
If you are executing the command from any third server then-
mysqldump -R -h source_server_ip -uroot -proot_pass source_db | mysql -h remote_server_ip -uroot -proot_pass target_db
If want to migrate only some tables-
mysqldump -uroot -proot_pass source_db table1 table2 table3 | mysql -h remote_server_ip -uroot -proot_pass target_db
Note: from which server you are execuring command should have permission to execute command on other servers also.
update
Finally you can use below command to copy stored routines also-
mysqldump -R -uroot -proot_pass source_db | mysql -h remote_server_ip -uroot -proot_pass target_db
Note: target db should exist on target server.