Reputation: 55
I have a postgre database DATA1 in table space location D:\tbl_DATA1. We use OS backup restore tool copy the the D:\tbl_DATA1 to a target machine C:\tbl_DATA1. Is it possible for recreate the database from this folder in the second mahcine?
Upvotes: 1
Views: 2025
Reputation: 51639
https://www.postgresql.org/docs/current/static/backup-file.html
An alternative backup strategy is to directly copy the files that PostgreSQL uses to store the data in the database
and later two restrictions mentionned
So yes - it is a common practice to shutdown the PostgreSQL, copy PGDATA directory to other machine and start Postgres in order to get the cluser copy. But it is done cluster level - not tablespace as you mention or database - the whole data_directory should be copied.
So no - copying the tablespace directory and trying to hack the db to add a tablespace will fail.
Upvotes: 3