Table of Contents Previous Next


2 Overview : 2.2 Block-Level Incremental Backup

As previously described, the full base backup uses the pg_basebackup utility program to accomplish the task. An incremental backup is a unique, utility for BART.
Note: Incremental backups cannot be taken from standby database servers. Only full base backups can be taken from standby database servers.
Create or select an operating system account to be used as the BART user account. See Section 4.1 for information on choosing and setting up the BART user account.
In the BART configuration file, the cluster_owner parameter must be set to the Linux operating system user account that owns the directory of the database cluster from which incremental backups are to be taken. The allow_incremental_backups parameter must be enabled. See Section 4.2.5 for information.
A password-less SSH/SCP connection must be established between the BART user account on the BART host and the cluster_owner user account on the database server. Note: This password-less SSH/SCP connection must be established even if BART and the database server are running on the same host and the BART user account and the cluster_owner user account are the same account. See Section 4.2.1 for information.
In addition to the BART host where the BART backup catalog resides, the BART package must also be installed on every remote database server on which incremental backups are to be restored. In order to restore an incremental backup, the bart program must be executable on the remote host by the remote user specified by the remote_host parameter in the BART configuration file or by the -r option when using the RESTORE subcommand to restore the incremental backup. See Section 2.2.5.2 for information on restoring incremental backups on remote hosts.
For restoring incremental backups on a remote database server, a password-less SSH/SCP connection must be established between the BART user account on the BART host and the remote user on the remote host that is specified by the remote_host parameter in the BART configuration file or by the -r option when using the RESTORE subcommand to restore the incremental backup. See Section 2.2.5.2 for information on restoring incremental backups on remote hosts.
Compression of archived WAL files in the BART backup catalog is not permitted for database servers on which incremental backups are to be taken. The wal_compression setting in the BART configuration file must not be enabled for those database servers. Disabled is the default setting unless the parameter is altered in the global section or the server section. See sections 4.1 and 4.2.5 for information on the wal_compression parameter.
3.
An initial full base backup must be taken with the BACKUP subcommand. This full base backup establishes the parent of the first incremental backup.
5.
Incremental backups are taken using the BACKUP subcommand with the --parent option to specify the backup identifier or name of a previous, full base backup or an incremental backup. Any previous backup may be chosen as the parent as long as all backups belong to the same timeline.
7.
The restore process for an incremental backup is invoked using the RESTORE subcommand in the same manner as restoring a full base backup. The -i option specifies the backup identifier or name of the incremental backup to restore. The restore process begins by going back through the chain of past, parent incremental backups until the initial full base backup starting the chain is identified. This full base backup provides the initial set of directories and files to be restored to the location specified with the -p option.
The MBM file is stored in the archive path directory backup_path/server_name/archived_wals where backup_path is the BART backup catalog parent directory specified in the global section of the BART configuration file and server_name is the lowercase conversion of the database server name specified for this database server in the server section of the BART configuration file. This is the same directory where the archived WAL files are stored in the BART backup catalog.
See Section 5.5 for information on using the WAL scanner.
In contrast, the following is the content of the archived base subdirectory of the same database from a subsequent incremental backup:
The information from the MBM files are consolidated into one file called a consolidated block map (CBM) file. During the restore operation for the incremental backup, the CBM file is used to identify the modified blocks to be restored for that backup.
See Section 5.4.3 for information on using the BACKUP subcommand to take an incremental backup.
BART Host. If an incremental backup is to be restored onto the same host where BART has been installed, the restore process is outlined in Section .
Remote Host. If an incremental backup is to be restored onto a remote host where BART has not been installed, the restore process still follows the information outlined in Section 2.2.5.1, but in addition the requirements in Section 2.2.5.2 must be established.
The bart program must be available on the remote host because the RESTORE subcommand invocation for an incremental backup results in the execution of the bart program on the remote host to copy the modified blocks from the BART backup catalog on the BART host to the restore directory on the remote host.
The RESTORE subcommand is used to restore an incremental backup by specifying its backup identifier or name with the -i option. All RESTORE options are used in the same manner as when restoring a full base backup.
See Section 5.4.8 for information on using the RESTORE subcommand for restoring an incremental backup.
Step 1: Install BART on the remote host to which an incremental backup is to be restored. Use the instructions in Section 3.2 to install BART on this remote host.
Note: No editing is needed in the BART configuration file bart.cfg installed on the remote host.
Step 2: Determine the Linux operating system user account on the remote host to be used as the remote user specified by the remote_host parameter in the BART configuration file or by the -r option when using the RESTORE subcommand to restore the incremental backup. This remote user must also be the owner of the directory where the incremental backup is to be restored on the remote host. For example, the user account is typically enterprisedb for Advanced Server or postgres for PostgreSQL
Step 3: Make sure a password-less SSH/SCP connection has been established from the BART user on the BART host to the remote user on the remote host. See Section 4.2.1 for information on setting up a password-less SSH/SCP connection.
Step 4: When the remote user connects to the remote host, the remote user’s PATH environment variable must include the BART bin directory. For example, modify the user’s ~/.bashrc or ~/.bash_profile file to set the PATH environment variable such as in the following example:
A backup chain is the set of backups consisting of a full base backup and all of its successive incremental backups. Tracing back on the parent backups of all incremental backups in the chain eventually leads back to that single, full base backup.
The allow_incremental_backups parameter is set to enabled in the BART configuration file to permit incremental backups on the listed database server:
The following output of the SHOW-BACKUPS subcommand lists the backup chain, which are backups full_1, incr_1-a, incr_1-b, and incr_1-c.
Note that for the full base backup full_1, the BACKUP PARENT field contains none. For each incremental backup, the BACKUP PARENT field contains the backup identifier or name of its parent backup.
A second backup chain is created in the same manner with the BACKUP subcommand. The following shows the addition of the resulting, second backup chain consisting of full base backup full_2 and incremental backups incr_2-a and incr_2-b.
The following additional incremental backups starting with incr_1-b-1, which designates incr_1-b as the parent, results in the forking from that backup into a second line of backups in the chain consisting of full_1, incr_1-a, incr_1-b, incr_1-b-1, incr_1-b-2, and incr_1-b-3 as shown in the following list:
Restoring an incremental backup is done with the RESTORE subcommand and its options in the same manner as for restoring a full base backup. Specify the backup identifier or backup name of the incremental backup to be restored as shown by the following:
Restoring incremental backup incr_1-b as shown by the preceding example results in the restoration of full base backup full_1, then incremental backups incr_1-a and finally, incr_1-b.
See Section 5.4.8 for information on the RESTORE subcommand.

2 Overview : 2.2 Block-Level Incremental Backup

Table of Contents Previous Next