Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions .github/asan.supp

This file was deleted.

19 changes: 0 additions & 19 deletions .github/tsan.supp

This file was deleted.

59 changes: 59 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Deploy Documentation

on:
push:
branches:
- master
paths:
- 'doc/**'
- '.github/workflows/docs.yml'
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y xsltproc docbook-xsl

- name: Generate HTML documentation
run: |
cd doc
xsltproc stylesheet.xsl probackup.xml > index.html

- name: Prepare pages directory
run: |
mkdir -p _site
cp doc/index.html _site/
cp doc/stylesheet.css _site/
cp doc/404.html _site/ 2>/dev/null || true

- name: Upload artifact
uses: actions/upload-pages-artifact@v3

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
42 changes: 8 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[![GitHub release](https://img.shields.io/github/v/release/postgrespro/pg_probackup?include_prereleases)](https://github.com/postgrespro/pg_probackup/releases/latest)
[![Build Status](https://travis-ci.com/postgrespro/pg_probackup.svg?branch=master)](https://travis-ci.com/postgrespro/pg_probackup)
[![GitHub release](https://img.shields.io/github/v/release/vbp1/pg_probackup?include_prereleases)](https://github.com/vbp1/pg_probackup/releases/latest)
[![Build Status](https://github.com/vbp1/pg_probackup/actions/workflows/build-and-test.yml/badge.svg?branch=master)](https://github.com/vbp1/pg_probackup/actions/workflows/build-and-test.yml)

# pg_probackup

Expand All @@ -25,56 +25,43 @@ As compared to other backup solutions, `pg_probackup` offers the following benef
* Archive catalog: getting the list of all WAL timelines and the corresponding meta information in plain text or JSON formats
* Partial Restore: restore only the specified databases or exclude the specified databases from restore.

To manage backup data, `pg_probackup` creates a backup catalog. This directory stores all backup files with additional meta information, as well as WAL archives required for [point-in-time recovery](https://postgrespro.com/docs/postgresql/current/continuous-archiving.html). You can store backups for different instances in separate subdirectories of a single backup catalog.
To manage backup data, `pg_probackup` creates a backup catalog. This directory stores all backup files with additional meta information, as well as WAL archives required for [point-in-time recovery](https://www.postgresql.org/docs/current/continuous-archiving.html). You can store backups for different instances in separate subdirectories of a single backup catalog.

Using `pg_probackup`, you can take full or incremental backups:
* `Full` backups contain all the data files required to restore the database cluster from scratch.
* `Incremental` backups only store the data that has changed since the previous backup. It allows to decrease the backup size and speed up backup operations. `pg_probackup` supports the following modes of incremental backups:
* `PAGE` backup. In this mode, `pg_probackup` scans all WAL files in the archive from the moment the previous full or incremental backup was taken. Newly created backups contain only the pages that were mentioned in WAL records. This requires all the WAL files since the previous backup to be present in the WAL archive. If the size of these files is comparable to the total size of the database cluster files, speedup is smaller, but the backup still takes less space.
* `DELTA` backup. In this mode, `pg_probackup` read all data files in PGDATA directory and only those pages, that where changed since previous backup, are copied. Continuous archiving is not necessary for it to operate. Also this mode could impose read-only I/O pressure equal to `Full` backup.
* `PTRACK` backup. In this mode, PostgreSQL tracks page changes on the fly. Continuous archiving is not necessary for it to operate. Each time a relation page is updated, this page is marked in a special `PTRACK` bitmap for this relation. As one page requires just one bit in the `PTRACK` fork, such bitmaps are quite small. Tracking implies some minor overhead on the database server operation, but speeds up incremental backups significantly.
* `PTRACK` backup with [ptrack extension](https://github.com/postgrespro/ptrack). In this mode, PostgreSQL tracks page changes on the fly. Continuous archiving is not necessary for it to operate. Each time a relation page is updated, this page is marked in a special `PTRACK` bitmap for this relation. As one page requires just one bit in the `PTRACK` fork, such bitmaps are quite small. Tracking implies some minor overhead on the database server operation, but speeds up incremental backups significantly.

Regardless of the chosen backup type, all backups taken with `pg_probackup` support the following strategies of WAL delivery:
* `Autonomous backups` streams via replication protocol all the WAL files required to restore the cluster to a consistent state at the time the backup was taken. Even if continuous archiving is not set up, the required WAL segments are included into the backup.
* `Archive backups` rely on continuous archiving.

## ptrack support

`PTRACK` backup support provided via following options:
* vanilla PostgreSQL 13, 14, 15, 16, 17 with [ptrack extension](https://github.com/postgrespro/ptrack)
* Postgres Pro Standard 13, 14, 15, 16, 17
* Postgres Pro Enterprise 13, 14, 15, 16, 17

## Limitations

`pg_probackup` currently has the following limitations:
* The server from which the backup was taken and the restored server must be compatible by the [block_size](https://postgrespro.com/docs/postgresql/current/runtime-config-preset#GUC-BLOCK-SIZE) and [wal_block_size](https://postgrespro.com/docs/postgresql/current/runtime-config-preset#GUC-WAL-BLOCK-SIZE) parameters and have the same major release number.
* The server from which the backup was taken and the restored server must be compatible by the [block_size](https://www.postgresql.org/docs/current/runtime-config-preset.html#GUC-BLOCK-SIZE) and [wal_block_size](https://www.postgresql.org/docs/current/runtime-config-preset.html#GUC-WAL-BLOCK-SIZE) parameters and have the same major release number.
* Remote backup via ssh on Windows currently is not supported.
* When running remote operations via ssh, remote and local pg_probackup versions must be the same.

## Documentation

Documentation can be found at [github](https://postgrespro.github.io/pg_probackup) and [Postgres Professional documentation](https://postgrespro.com/docs/postgrespro/current/app-pgprobackup)
Documentation can be found at [github](https://postgrespro.github.io/pg_probackup)

## Development

* Stable version state can be found under the respective [release tag](https://github.com/postgrespro/pg_probackup/releases).
* `master` branch contains minor fixes that are planned to the nearest minor release.
* Upcoming major release is developed in a release branch i.e. `release_2_6`.

For detailed release plans check [Milestones](https://github.com/postgrespro/pg_probackup/milestones)

## Installation and Setup
### Windows Installation
Installers are available in release **assets**. [Latests](https://github.com/postgrespro/pg_probackup/releases/latest).

### Linux Installation

See the [Installation](https://postgrespro.github.io/pg_probackup/#pbk-install) section in the documentation.

Once you have `pg_probackup` installed, complete [the setup](https://postgrespro.github.io/pg_probackup/#pbk-setup).

For users of Postgres Pro products, commercial editions of pg_probackup are available for installation from the corresponding Postgres Pro product repository.

## Building from source
### Linux
Expand All @@ -93,26 +80,13 @@ cd <path_to_PostgreSQL_source_tree> && git clone https://github.com/postgrespro/

For version 18 you have to apply PostgreSQL core patch (patches/REL_18_STABLE_pg_probackup.patch) first and recompile and reinstall PostgreSQL

### Windows

Currently pg_probackup can be build using only MSVC 2013.
Build PostgreSQL using [pgwininstall](https://github.com/postgrespro/pgwininstall) or [PostgreSQL instruction](https://www.postgresql.org/docs/current/install-windows-full.html) with MSVC 2013.
If zlib support is needed, src/tools/msvc/config.pl must contain path to directory with compiled zlib. [Example](https://gist.githubusercontent.com/gsmol/80989f976ce9584824ae3b1bfb00bd87/raw/240032950d4ac4801a79625dd00c8f5d4ed1180c/gistfile1.txt)

```shell
CALL "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall" amd64
SET PATH=%PATH%;C:\Perl64\bin
SET PATH=%PATH%;C:\msys64\usr\bin
gen_probackup_project.pl C:\path_to_postgresql_source_tree
```

## License

This module available under the [license](LICENSE) similar to [PostgreSQL](https://www.postgresql.org/about/license/).

## Feedback

Do not hesitate to post your issues, questions and new ideas at the [issues](https://github.com/postgrespro/pg_probackup/issues) page.
Do not hesitate to post your issues, questions and new ideas at the [issues](https://github.com/vbp1/pg_probackup/issues) page.

## Authors

Expand All @@ -134,4 +108,4 @@ Description of how to add new translation languages.
6. Adding to nls.mk in folder pg_probackup required language in AVAIL_LANGUAGES.

For more information, follow the link below:
https://postgrespro.ru/docs/postgresql/12/nls-translator
https://www.postgresql.org/docs/current/nls-translator.html
72 changes: 72 additions & 0 deletions doc/404.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Page Not Found - pg_probackup Documentation</title>
<link rel="stylesheet" type="text/css" href="stylesheet.css">
<style>
.error-container {
max-width: 600px;
margin: 100px auto;
padding: 40px 20px;
text-align: center;
font-family: 'Roboto', Arial, sans-serif;
}
.error-code {
font-size: 120px;
font-weight: 700;
color: #EC5800;
margin: 0;
line-height: 1;
}
.error-title {
font-size: 24px;
font-weight: 500;
color: #333;
margin: 20px 0;
}
.error-message {
font-size: 16px;
color: #666;
line-height: 1.6;
margin-bottom: 30px;
}
.home-link {
display: inline-block;
padding: 12px 24px;
background-color: #EC5800;
color: #fff;
text-decoration: none;
border-radius: 4px;
font-weight: 500;
transition: background-color 0.2s;
}
.home-link:hover {
background-color: #d44f00;
}
@media screen and (max-width: 480px) {
.error-code {
font-size: 80px;
}
.error-title {
font-size: 20px;
}
.error-container {
margin: 50px auto;
}
}
</style>
</head>
<body>
<div class="error-container">
<p class="error-code">404</p>
<h1 class="error-title">Page Not Found</h1>
<p class="error-message">
The page you are looking for might have been removed,
had its name changed, or is temporarily unavailable.
</p>
<a href="./" class="home-link">Go to Documentation</a>
</div>
</body>
</html>
45 changes: 40 additions & 5 deletions doc/Readme.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,43 @@
# Generating documentation
```
# pg_probackup Documentation

This directory contains the source files for pg_probackup documentation in DocBook XML format.

## Online Documentation

The documentation is automatically published to GitHub Pages:
https://vbp1.github.io/pg_probackup

## Generating Documentation Locally

```bash
# Validate XML (optional)
xmllint --noout --valid probackup.xml
xsltproc stylesheet.xsl probackup.xml >pg-probackup.html

# Generate HTML
xsltproc stylesheet.xsl probackup.xml > index.html
```

> [!NOTE]
>Install ```docbook-xsl``` if you got
>``` "xsl:import : unable to load http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl"```
> Install `docbook-xsl` if you get:
> ```
> "xsl:import : unable to load http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl"
> ```
>
> On Debian/Ubuntu: `sudo apt-get install docbook-xsl`
> On RHEL/CentOS: `sudo yum install docbook-style-xsl`

## Files

- `probackup.xml` - Main DocBook document
- `pgprobackup.xml` - Detailed documentation content
- `stylesheet.xsl` - XSLT stylesheet for HTML generation
- `stylesheet.css` - CSS styles for HTML output
- `404.html` - Custom 404 error page for GitHub Pages

## Automatic Deployment

Documentation is automatically deployed to GitHub Pages when changes are pushed to the `master` branch. The deployment is handled by the `.github/workflows/docs.yml` workflow.

The workflow:
1. Generates HTML from DocBook XML using `xsltproc`
2. Deploys to GitHub Pages using the modern `actions/deploy-pages` action
Loading