Many webs (as StackOverFlow: Copying PostgreSQL database to another server ) talk about that, but maybe something is wrong in my command.
pg_dump -C -h localhost -U postgres BD.to.move | psql -h server.destiny -U postgres BD.to.move
I have password root + password postgres on S1
I have password root + password postgres on S2
however after of run my command over server1
, in server2 NO'T exist the BD.to.move
.
My command is wrong?
How I can copy/transfer {BD.to.move + ROLES + SCHEMAS + users, + password, etc...} ?
(in others words, the BD complet to use directly in production over server.destiny)