I'm trying to move my data ( database + contents ) from the old server to a new one, what is the best way to transfer everything ? because my method is old, move site by site, and after move databases files to the new server and restore them on the new server to get them work fine. I don't know if there is a way to do that by SSH, like move everything between 2 servers ( old and new ) by some SSH commands ...maybe ?
Do you have CPanel? If you do, it has a button you click to do a full site backup. Then you can transfer the backup file to the new server via SSH and restore the site in a few clicks—database and all.
I've had to migrate hundreds of sites, and the way that we did them was to SSH to the old server, which had the database AND the web files on it. We would take a mysql dump of the database, rsync the files across to the new server (web and DB), reimport the MySQL dump data to the new database and you're done. The beauty of rsync is that it's incremental too, so you can copy it all over, make sure it's working OK, then perform another rsync in case anything new was added to the site and you're done. Only down side is that you can't do an incremental update of the database itself so you do need to do a full import of that.
The actual process that I used was something like this:
Disable old site if possible
SSH in to old server
Take a MySQL dump
RSync all web and DB files to new server
Import MySQL data
Edit site config file to point to new database
If all is well edit the old site config to point to new database