First thing you need to do is to ssh into server from which you want to duplicate or copy the database to another server.
The command which worked for me was:
mysqldump -u <database-user> -p<database-password> <database-name> | xz | ssh <target-ssh-username>@<target-hostname> \ "tee remote-dump.sql.xz | unxz | mysql -u <target-database-user> -p<target-database-password> <target-database-name>"
Note:- you can use .cnf file to store username and password of the database. Because my execution was small, I didn't used it.
Link for doing that: https://www.techiecorner.com/1619/how-to-setup-mysqldump-without-password-in-cronjob/
After entering your command. It will prompt you for
**The authenticity of host 'w01b3a99.kasserver.com (85.13.164.141)' can't be established.**
Are you sure you want to continue connecting (yes/no)?
type yes
Then it will prompt you to enter
*target-user@target-hostname* ssh password
Enter the password of target-user password
It will be silent execution running. After some time your command execution will be completed.
I haven't used pv -W because I was using the Cloudways Server. pv wasn't installed already. They don't allow root access to install any package.
mysql duplicate databasegives me everything necessary, e.g. rubyrobot.org/article/duplicate-a-mysql-database