A
A
Ao2019-01-18 10:09:15
PostgreSQL
Ao, 2019-01-18 10:09:15

Is it possible to reinitialize a database in postgres?

Is it possible in postgres to reinitialize a database in an existing directory?
Well, that is, there is a folder with a database, is it possible to transfer this folder to another computer, and for postgres to open this database?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Melkij, 2019-01-18
@melkij

So reinitialize or move to another host?
reinitialize - remove directory, make initdb.
move to another host - turn off the database, copy the entire PGDATA including all the contents of all symlinks, start the database. Or call the regular pg_basebackup and use it to copy the running base (using the replication protocol).
It is possible only on the same hardware architecture.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question