.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` . ds C' 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "PG_RESTORECLUSTER 1" .TH PG_RESTORECLUSTER 1 2024-04-15 Debian "Debian PostgreSQL infrastructure" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME pg_restorecluster \- Restore from a pg_backupcluster backup .SH SYNOPSIS .IX Header "SYNOPSIS" \&\fBpg_restorecluster\fR [\fIoptions\fR] \fIversion\fR \fIcluster\fR \fIbackup\fR .SH DESCRIPTION .IX Header "DESCRIPTION" \&\fBpg_restorecluster\fR restores a PostgreSQL cluster from a backup created by \&\fBpg_backupcluster\fR. The cluster will be newly created in the system using the name provided on the command line; this allows renaming a cluster on restore. The restored cluster configuration will be updated to reflect the new name and location. .PP The \fIbackup\fR name passed must end in either \fB.basebackup\fR or \fB.dump\fR; usually this will be the full path to a backup directory in \&\f(CW\*(C`/var/backups/postgresql/version\-cluster/\*(C'\fR as reported by \&\fBpg_backupcluster ... list\fR. .PP Basebackups are restored as-is. For dumps, \fBpg_createcluster\fR is used to create a new cluster, and schema and data are restored via \fBpg_restore\fR. .SH OPTIONS .IX Header "OPTIONS" .IP "\fB\-d \-\-datadir\fR \fIDIR\fR" 4 .IX Item "-d --datadir DIR" Use \fIDIR\fR as data directory for the restored cluster (default per createcluster.conf, by default /var/lib/postgresql/\fIversion\fR/\fIcluster\fR). .IP "\fB\-p \-\-port\fR \fIN\fR" 4 .IX Item "-p --port N" Use port \fIN\fR for restored cluster (default is next free port). .IP "\fB\-s \-\-start\fR" 4 .IX Item "-s --start" Start cluster after restoring (default for restore from dump; off for basebackup restores). .Sp After the cluster has been started, \fBANALYZE\fR is run on all databases. .IP \fB\-\-archive\fR 4 .IX Item "--archive" Configure cluster for recovery from WAL archive. This sets \fBrestore_command\fR to retrieve WAL files from \fIbackup\fR\fB/../wal\fR. .IP "\fB\-\-pitr\fR \fITIMESTAMP\fR" 4 .IX Item "--pitr TIMESTAMP" .PD 0 .IP "\fB\-\-recovery\-target\-time\fR \fITIMESTAMP\fR" 4 .IX Item "--recovery-target-time TIMESTAMP" .PD Additionally to setting \fBrestore_command\fR, set \fBrecovery_target_time\fR to \&\fITIMESTAMP\fR for point-in-time recovery. Also sets \&\fBrecovery_target_action='promote'\fR. .IP "\fB\-\-wal\-archive\fR \fIDIR\fR" 4 .IX Item "--wal-archive DIR" For archive recovery, read WAL from archive \fIDIR\fR (default is \&\fIbackup\fR\fB/../wal\fR). .SH FILES .IX Header "FILES" .IP /var/backups 4 .IX Item "/var/backups" Default root directory for cluster backup directories. .PP See \fBpg_backupcluster\fR\|(1) for a description of files. .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fBpg_backupcluster\fR\|(1), \fBpg_restore\fR\|(1), \fBvacuumdb\fR\|(1). .SH AUTHOR .IX Header "AUTHOR" Christoph Berg