SSH is just a method to connect to your server. Once you ssh to the server, you may use linux commands (if you are on a linux box) to do stuff on your server, such as create a backup of your database. Here is a link on how to create a backup of your database once you ssh to the server -
Backing Up The Database via SSH/Telnet
You'll then have to download that copy to your computer, or use a command like scp to move it to the new server.
And, to then to restore it -
Restoring The Database via SSH/Telnet