It's usually pretty easy. Most databases can do something like this from the command line of the server:
createdatabase dbname
dump_command -h remote.host -d dbname | sql dbname
On postgresql it's:
createdb dbname
pg_dump -h remote.host dbname | psql dbname