Обсуждение: File System based PostgreSQL Database server restore to a different mount point.

Поиск
Список
Период
Сортировка

File System based PostgreSQL Database server restore to a different mount point.

От
girish R G peetle
Дата:
Hi,
We have requirement to perform File system based restore of entire PostgreSQL database server to a different mount point. 

-> I know that if no user created tablespaces are involved, we have just need to restore the entire DATA directory to new mount point, modify configuration parameters if required and then start the server. 
-> If user created table-space directories are involved, then we will have to manually adjust the symbolic links (under pg_tblspc) to the new tablespace directory path and bring up the server.

Adjusting symbolic links is a workaround ( hook! ), is there a any official documentation on how 'PostgreSQL server restore to a different mount point' can be achieved ?

Thanks
Girish 


Re: File System based PostgreSQL Database server restore to a different mount point.

От
Albe Laurenz
Дата:
girish R G peetle wrote:
> We have requirement to perform File system based restore of entire PostgreSQL database server to a
> different mount point.
> 
> -> I know that if no user created tablespaces are involved, we have just need to restore the entire
> DATA directory to new mount point, modify configuration parameters if required and then start the
> server.
> -> If user created table-space directories are involved, then we will have to manually adjust the
> symbolic links (under pg_tblspc) to the new tablespace directory path and bring up the server.
> 
> Adjusting symbolic links is a workaround ( hook! ), is there a any official documentation on how
> 'PostgreSQL server restore to a different mount point' can be achieved ?

That should work.
The only documentation is at
http://www.postgresql.org/docs/9.3/static/continuous-archiving.html#BACKUP-PITR-RECOVERY
which mentions tablespaces, but does not discuss your case directly.

Yours,
Laurenz Albe

Re: File System based PostgreSQL Database server restore to a different mount point.

От
girish R G peetle
Дата:
Thanks Laurenz Albe. After adjusting symbolic links should we update table space directory in  'pg_tablespace' system catalog ?

Thanks
Girish

On Tue, Nov 4, 2014 at 2:16 PM, Albe Laurenz <laurenz.albe@wien.gv.at> wrote:
girish R G peetle wrote:
> We have requirement to perform File system based restore of entire PostgreSQL database server to a
> different mount point.
>
> -> I know that if no user created tablespaces are involved, we have just need to restore the entire
> DATA directory to new mount point, modify configuration parameters if required and then start the
> server.
> -> If user created table-space directories are involved, then we will have to manually adjust the
> symbolic links (under pg_tblspc) to the new tablespace directory path and bring up the server.
>
> Adjusting symbolic links is a workaround ( hook! ), is there a any official documentation on how
> 'PostgreSQL server restore to a different mount point' can be achieved ?

That should work.
The only documentation is at
http://www.postgresql.org/docs/9.3/static/continuous-archiving.html#BACKUP-PITR-RECOVERY
which mentions tablespaces, but does not discuss your case directly.

Yours,
Laurenz Albe

Re: File System based PostgreSQL Database server restore to a different mount point.

От
Albe Laurenz
Дата:
girish R G peetle wrote:
> Thanks Laurenz Albe. After adjusting symbolic links should we update table space directory in
> 'pg_tablespace' system catalog ?

That column exists only on PostgreSQL 9.1 and below.

Even though I don't think that it is used, you are right that for consistency
it is best to update that as well.

Yours,
Laurenz Albe