Help transferring domain between my two servers

Hi All

I have two servers with virtualmin running correctly, one is the master and the second one is the salve, both working with keepalived . So i created a cronjob to copy my domains hourly.

Everything is working fine but my problem is that in the command that i use contain the root password . My question is , can i change this command to use private key or different user instead of root password ?

virtualmin transfer-domain --domain --host slavehostip --pass rootpassword --replication --overwrite


You could simply make use of rsync over SSH where public/private keys are supported. If you simply want to replicate files in the home directory this would work well via cron.

Thank you for your answer, but im replicating as well mysql database and option for the domain at the same time, for that reason i need use this command

Please help…