From b3801210993e608d4f2a1883fe519a7eb5ce006e Mon Sep 17 00:00:00 2001 From: Alina Derkach Date: Thu, 29 Jan 2026 18:33:01 +0100 Subject: [PATCH] PXB-3661 Add the plugin and update links to open in a new tab. Remove code copy. A-P (8.4) modified: docs/about-xtrabackup.md modified: docs/accelerate-backup-process.md modified: docs/apt-download-deb.md modified: docs/apt-pinning.md modified: docs/apt-repo.md modified: docs/apt-uninstall-xtrabackup.md modified: docs/binaries-overview.md modified: docs/binary-tarball-names.md modified: docs/binary-tarball.md modified: docs/compile-xtrabackup.md modified: docs/copyright-and-licensing-information.md modified: docs/create-compressed-backup.md modified: docs/create-full-backup.md modified: docs/create-gtid-replica.md modified: docs/create-incremental-backup.md modified: docs/create-individual-partition-backup.md modified: docs/create-partial-backup.md modified: docs/docker.md modified: docs/download-instructions.md modified: docs/dump-schema.md modified: docs/encrypt-backups.md modified: docs/encrypted-innodb-tablespace-backups.md modified: docs/faq.md modified: docs/flush-tables-with-read-lock.md modified: docs/generated-files.md modified: docs/get-help.md modified: docs/glossary.md modified: docs/how-xtrabackup-works.md modified: docs/index.md modified: docs/log-enhancements.md modified: docs/lru-dump-backup.md modified: docs/make-backup-in-replication-env.md modified: docs/page-tracking.md modified: docs/permissions.md modified: docs/point-in-time-recovery.md modified: docs/prepare-compressed-backup.md modified: docs/prepare-full-backup.md modified: docs/prepare-incremental-backup.md modified: docs/prepare-individual-partitions-backup.md modified: docs/prepare-partial-backup.md modified: docs/privileges.md modified: mkdocs-base.yml --- docs/about-xtrabackup.md | 6 +- docs/accelerate-backup-process.md | 4 +- docs/apt-download-deb.md | 10 +-- docs/apt-pinning.md | 4 +- docs/apt-repo.md | 47 ++++++------ docs/apt-uninstall-xtrabackup.md | 6 +- docs/binaries-overview.md | 58 +++++++++------ docs/binary-tarball-names.md | 8 +- docs/binary-tarball.md | 13 ++-- docs/compile-xtrabackup.md | 77 ++++++++++---------- docs/copyright-and-licensing-information.md | 2 +- docs/create-compressed-backup.md | 26 ++++--- docs/create-full-backup.md | 14 ++-- docs/create-gtid-replica.md | 28 +++---- docs/create-incremental-backup.md | 15 ++-- docs/create-individual-partition-backup.md | 6 +- docs/create-partial-backup.md | 20 ++--- docs/docker.md | 32 ++++---- docs/download-instructions.md | 4 +- docs/dump-schema.md | 36 ++++----- docs/encrypt-backups.md | 26 ++++--- docs/encrypted-innodb-tablespace-backups.md | 57 +++++++-------- docs/faq.md | 8 +- docs/flush-tables-with-read-lock.md | 11 +-- docs/generated-files.md | 4 +- docs/get-help.md | 4 +- docs/glossary.md | 7 +- docs/how-xtrabackup-works.md | 6 +- docs/index.md | 2 +- docs/log-enhancements.md | 4 +- docs/lru-dump-backup.md | 4 +- docs/make-backup-in-replication-env.md | 5 +- docs/page-tracking.md | 44 +++++------ docs/permissions.md | 8 +- docs/point-in-time-recovery.md | 32 ++++---- docs/prepare-compressed-backup.md | 26 +++---- docs/prepare-full-backup.md | 4 +- docs/prepare-incremental-backup.md | 10 +-- docs/prepare-individual-partitions-backup.md | 4 +- docs/prepare-partial-backup.md | 4 +- docs/privileges.md | 43 +++++------ mkdocs-base.yml | 1 + 42 files changed, 354 insertions(+), 376 deletions(-) diff --git a/docs/about-xtrabackup.md b/docs/about-xtrabackup.md index c9baf7f8e..96bb4bd9a 100644 --- a/docs/about-xtrabackup.md +++ b/docs/about-xtrabackup.md @@ -16,7 +16,7 @@ Percona XtraBackup has the following benefits: Percona XtraBackup makes hot backups for Percona Server for MySQL and MySQL-compatible servers. XtraBackup takes streaming, compressed, and incremental server backups, and supports encryption. -Percona’s enterprise-grade commercial [MySQL Support] contracts include support for Percona XtraBackup. We recommend support for critical production deployments. +Percona’s enterprise-grade commercial [MySQL Support :octicons-link-external-16:](http://www.percona.com/mysql-support/) contracts include support for Percona XtraBackup. We recommend support for critical production deployments. ## Supported storage engines @@ -25,7 +25,3 @@ MyISAM, and MyRocks tables on MySQL {{vers}} servers as well as Percona Server f {{vers}}. Percona XtraBackup supports the MyRocks storage engine. Percona XtraBackup copies all MyRocks files each time it takes a backup. An incremental backup on the MyRocks storage engine does not determine if an earlier full or incremental backup contains the same files. - -[MySQL Support]: http://www.percona.com/mysql-support/ - - diff --git a/docs/accelerate-backup-process.md b/docs/accelerate-backup-process.md index deff8a73f..8a92585d9 100644 --- a/docs/accelerate-backup-process.md +++ b/docs/accelerate-backup-process.md @@ -60,10 +60,8 @@ the `FLUSH TABLES WITH READ LOCK`. Note that Percona XtraBackup will use [Backup locks] where available as a lightweight alternative to `FLUSH TABLES WITH READ LOCK`. -Percona XtraBackup uses these locks automatically to copy non-InnoDB data to avoid blocking Data manipulation language (DML) queries that modify InnoDB tables. +Percona XtraBackup uses these locks automatically to copy non-InnoDB data to avoid blocking Data manipulation language (DML) queries that modify InnoDB tables. Find more information in [Backup locks :octicons-link-external-16:](https://docs.percona.com/percona-server/8.4/backup-locks.html) !!! note This option cannot be used together with the `--stream` option. - -[Backup locks]: https://docs.percona.com/percona-server/innovation-release/backup-locks.html \ No newline at end of file diff --git a/docs/apt-download-deb.md b/docs/apt-download-deb.md index 479378f83..93e09d449 100644 --- a/docs/apt-download-deb.md +++ b/docs/apt-download-deb.md @@ -1,6 +1,6 @@ # Install using downloaded DEB packages -Download `DEB` packages of the desired series for your architecture from the [Percona Software Downloads](https://www.percona.com/downloads). If needed, [Percona Software Download instructions](download-instructions.md) are available. +Download `DEB` packages of the desired series for your architecture from the [Percona Software Downloads :octicons-link-external-16:](https://www.percona.com/downloads). If needed, [Percona Software Download instructions](download-instructions.md) are available. This method requires you to resolve all dependencies and install any missing packages. Always back up your data before making significant system changes. @@ -9,13 +9,13 @@ The following example downloads Percona XtraBackup {{release}} release package f 1. Use `wget` to download the `DEB` package: - ```bash + ```shell wget https://downloads.percona.com/downloads/Percona-XtraBackup-{{vers}}/Percona-XtraBackup-{{release}}/binary/debian/jammy/x86_64/percona-xtrabackup-84_{{release}}-1.jammy_amd64.deb ``` 2. Install Percona XtraBackup by using `dpkg`: - ```bash + ```shell sudo dpkg -i percona-xtrabackup-84_{{release}}-1.jammy_amd64.deb ``` @@ -32,7 +32,7 @@ The following example downloads Percona XtraBackup {{release}} release package f If there are missing dependencies, `dpkg` shows error messages. Install any missing packages with the following command: -```bash +```shell sudo apt-get install -f ``` Retry the Percona XtraBackup installation. @@ -41,7 +41,7 @@ Retry the Percona XtraBackup installation. After installation, verify it by checking the version: -```bash +```shell xtrabackup --version ``` diff --git a/docs/apt-pinning.md b/docs/apt-pinning.md index a4690db1b..6a894ab82 100644 --- a/docs/apt-pinning.md +++ b/docs/apt-pinning.md @@ -12,6 +12,4 @@ Pin: release o=Percona Development Team Pin-Priority: 1001 ``` -For more information about the pinning, check the official [debian wiki]. - -[debian wiki]: http://wiki.debian.org/AptPreferences +For more information about the pinning, check the official [debian wiki :octicons-link-external-16:](http://wiki.debian.org/AptPreferences). diff --git a/docs/apt-repo.md b/docs/apt-repo.md index 98b78651c..6796b0346 100644 --- a/docs/apt-repo.md +++ b/docs/apt-repo.md @@ -1,22 +1,20 @@ # Install with the Percona-release Tool on Debian-based Systems ---8<--- "pro-build-announcement.md" - Ready-to-use packages are available from the Percona XtraBackup software -repositories and the [download page]. +repositories and the [Percona Software Downloads :octicons-link-external-16:](https://www.percona.com/downloads). Specific information on the supported platforms, products, and versions is described in [Percona Release Lifecycle Overview]. ## Install Percona XtraBackup through percona-release -Install Percona XtraBackup, like many other Percona products, with the `percona-release` package configuration tool. +Install Percona XtraBackup, like many other Percona products, with the `percona-release` package configuration tool. Run the following commands as root or use the sudo command. {.power-number} 1. Use the apt package manager to dowload `percona-release`: - ```{.bash data-prompt="$"} - $ sudo apt update + ```shell + sudo apt update ``` ??? example "Expected output" @@ -34,8 +32,8 @@ Install Percona XtraBackup, like many other Percona products, with the `percona- 2. Install the `curl` download utility if it's not installed: - ```{.bash data-prompt="$"} - $ sudo apt install curl + ```shell + sudo apt install curl ``` ??? example "Expected output" @@ -53,8 +51,8 @@ Install Percona XtraBackup, like many other Percona products, with the `percona- 3. Download the `percona-release` the repository package: - ```{.bash data-prompt="$"} - $ curl -O https://repo.percona.com/apt/percona-release_latest.generic_all.deb + ```shell + curl -O https://repo.percona.com/apt/percona-release_latest.generic_all.deb ``` ??? example "Expected output" @@ -67,7 +65,7 @@ Install Percona XtraBackup, like many other Percona products, with the `percona- 4. Install the downloaded package and its dependencies using `apt`: - ```{.bash data-prompt="$"} + ```shell sudo apt install gnupg2 lsb-release ./percona-release_latest.generic_all.deb ``` @@ -92,8 +90,8 @@ Install Percona XtraBackup, like many other Percona products, with the `percona- 5. Refresh the local cache to update the package information: - ```{.bash data-prompt="$"} - $ sudo apt update + ```shell + sudo apt update ``` ??? example "Expected output" @@ -111,8 +109,8 @@ Install Percona XtraBackup, like many other Percona products, with the `percona- 6. Enable the specific percona-release product. - ```{.bash data-prompt="$"} - $ sudo percona-release enable pxb-84-lts + ```shell + sudo percona-release enable pxb-84-lts ``` ??? example "Expected output" @@ -134,8 +132,8 @@ Install Percona XtraBackup, like many other Percona products, with the `percona- 7. Install Percona XtraBackup. - ```{.bash data-prompt="$"} - $ sudo apt install percona-xtrabackup-84 + ```shell + sudo apt install percona-xtrabackup-84 ``` ??? example "Expected output" @@ -156,8 +154,8 @@ Install Percona XtraBackup, like many other Percona products, with the `percona- 8. Verify the installation. - ```{.bash data-prompt="$"} - $ xtrabackup --version + ```shell + xtrabackup --version ``` ??? example "Expected output" @@ -170,14 +168,14 @@ Install Percona XtraBackup, like many other Percona products, with the `percona- === "Install the `lz4` package" - ```{.bash data-prompt="$"} - $ sudo apt install lz4 + ```shell + sudo apt install lz4 ``` === "Install the `zstd` package" - ```{.bash data-prompt="$"} - $ sudo apt install zstd + ```shell + sudo apt install zstd ``` !!! note @@ -190,6 +188,3 @@ Install Percona XtraBackup, like many other Percona products, with the `percona- To install Percona XtraBackup using downloaded deb packages, see [Install Percona XtraBackup {{vers}}](apt-download-deb.md). To uninstall Percona XtraBackup, see [Uninstall Percona XtraBackup {{vers}}](apt-uninstall-xtrabackup.md) - -[download page]: https://www.percona.com/downloads -[Percona Release Lifecycle Overview]: https://www.percona.com/services/policies/percona-software-platform-lifecycle#mysql \ No newline at end of file diff --git a/docs/apt-uninstall-xtrabackup.md b/docs/apt-uninstall-xtrabackup.md index 1a997d149..8d039ceec 100644 --- a/docs/apt-uninstall-xtrabackup.md +++ b/docs/apt-uninstall-xtrabackup.md @@ -1,7 +1,7 @@ # Uninstall Percona XtraBackup {{vers}} on Debian and Ubuntu -To completely uninstall Percona XtraBackup, remove all the installed packages: +To completely uninstall Percona XtraBackup, remove all the installed packages. Run the following command as root or use the sudo command. -```{.bash data-prompt="$"} -$ sudo apt remove percona-xtrabackup-{{pkg}} +```shell +sudo apt remove percona-xtrabackup-{{pkg}} ``` \ No newline at end of file diff --git a/docs/binaries-overview.md b/docs/binaries-overview.md index 4e923e0ef..6beb5e091 100644 --- a/docs/binaries-overview.md +++ b/docs/binaries-overview.md @@ -41,15 +41,17 @@ Common Use Cases: Basic Syntax: -```{.bash data-prompt="$"} +Run the following commands as root or use the sudo command. + +```shell # Create a full backup -$ xtrabackup --backup --target-dir=/backup/full +xtrabackup --backup --target-dir=/backup/full # Create an incremental backup -$ xtrabackup --backup --target-dir=/backup/inc1 --incremental-basedir=/backup/full +xtrabackup --backup --target-dir=/backup/inc1 --incremental-basedir=/backup/full # Prepare a backup for restore -$ xtrabackup --prepare --target-dir=/backup/full +xtrabackup --prepare --target-dir=/backup/full ``` Documentation: [xtrabackup Overview](xtrabackup-binary-overview.md) @@ -82,12 +84,14 @@ Common Use Cases: Basic Syntax: -```{.bash data-prompt="$"} +Run the following commands as root or use the sudo command. + +```shell # Upload backup to S3 -$ xbcloud put s3://my-bucket/backup/ --storage=s3 --s3-bucket=my-bucket +xbcloud put s3://my-bucket/backup/ --storage=s3 --s3-bucket=my-bucket # Download backup from S3 -$ xbcloud get s3://my-bucket/backup/ --storage=s3 --s3-bucket=my-bucket +xbcloud get s3://my-bucket/backup/ --storage=s3 --s3-bucket=my-bucket ``` Documentation: [xbcloud Overview](xbcloud-binary-overview.md) @@ -121,12 +125,14 @@ Common Use Cases: Basic Syntax: -```{.bash data-prompt="$"} +Run the following commands as root or use the sudo command. + +```shell # Encrypt a backup file -$ xbcrypt --encrypt --encrypt-key-file=/path/to/keyfile --input=/backup/backup.xbstream +xbcrypt --encrypt --encrypt-key-file=/path/to/keyfile --input=/backup/backup.xbstream # Decrypt a backup file -$ xbcrypt --decrypt --encrypt-key-file=/path/to/keyfile --input=/backup/backup.xbstream.encrypted +xbcrypt --decrypt --encrypt-key-file=/path/to/keyfile --input=/backup/backup.xbstream.encrypted ``` Documentation: [xbcrypt Overview](xbcrypt-binary-overview.md) @@ -159,15 +165,17 @@ Common Use Cases: Basic Syntax: -```{.bash data-prompt="$"} +Run the following commands as root or use the sudo command. + +```shell # Extract a streamed backup -$ xbstream -x -C /restore/directory < backup.xbstream +xbstream -x -C /restore/directory < backup.xbstream # Create a streamed backup -$ xtrabackup --backup --stream=xbstream | xbstream -c -C /backup/directory +xtrabackup --backup --stream=xbstream | xbstream -c -C /backup/directory ``` -Documentation: [xbstream Overview](https://docs.percona.com/percona-xtrabackup/8.4/xbstream.html) +Documentation: [xbstream Overview :octicons-link-external-16:](https://docs.percona.com/percona-xtrabackup/8.4/xbstream.html) Command Line Options: [xbstream Options](xbstream-options.md) @@ -207,30 +215,34 @@ Command Line Options: [xbstream Options](xbstream-options.md) ### Complete backup and upload workflow -```{.bash data-prompt="$"} +Run the following commands as root or use the sudo command. + +```shell # Create encrypted backup -$ xtrabackup --backup --target-dir=/tmp/backup --encrypt=AES256 --encrypt-key-file=/etc/mysql/backup.key +xtrabackup --backup --target-dir=/tmp/backup --encrypt=AES256 --encrypt-key-file=/etc/mysql/backup.key # Stream and compress backup -$ xtrabackup --backup --stream=xbstream --encrypt=AES256 --encrypt-key-file=/etc/mysql/backup.key | \ +xtrabackup --backup --stream=xbstream --encrypt=AES256 --encrypt-key-file=/etc/mysql/backup.key | \ xbstream -c -C /tmp/backup # Upload to cloud storage -$ xbcloud put s3://my-backup-bucket/$(date +%Y%m%d)/ --storage=s3 --s3-bucket=my-backup-bucket +xbcloud put s3://my-backup-bucket/$(date +%Y%m%d)/ --storage=s3 --s3-bucket=my-backup-bucket ``` ### Restore from cloud storage -```{.bash data-prompt="$"} +Run the following commands as root or use the sudo command. + +```shell # Download backup from cloud -$ xbcloud get s3://my-backup-bucket/20241201/ --storage=s3 --s3-bucket=my-backup-bucket +xbcloud get s3://my-backup-bucket/20241201/ --storage=s3 --s3-bucket=my-backup-bucket # Decrypt backup -$ xbcrypt --decrypt --encrypt-key-file=/etc/mysql/backup.key --input=/tmp/backup/backup.xbstream.encrypted +xbcrypt --decrypt --encrypt-key-file=/etc/mysql/backup.key --input=/tmp/backup/backup.xbstream.encrypted # Prepare and restore -$ xtrabackup --prepare --target-dir=/tmp/backup -$ xtrabackup --copy-back --target-dir=/tmp/backup +xtrabackup --prepare --target-dir=/tmp/backup +xtrabackup --copy-back --target-dir=/tmp/backup ``` ## Next steps diff --git a/docs/binary-tarball-names.md b/docs/binary-tarball-names.md index 97a831fe2..602ff9d49 100644 --- a/docs/binary-tarball-names.md +++ b/docs/binary-tarball-names.md @@ -2,8 +2,8 @@ For recent versions of Percona XtraBackup, the tar files are organized by the `glibc2` version. You can find this version on your operating system with the following command: -```{.bash data-prompt="$"} -$ ldd --version +```shell +ldd --version ``` ??? example "Expected output" @@ -32,7 +32,7 @@ The following lists the platform and the associated full binary file name used b | Red Hat Enterprise 8 | Percona-XtraBackup-{{release}}-Linux.x86_64.glibc2.28.tar.gz | glibc2.28 | -Download the binary tarballs from [Percona Software Downloads]. +Download the binary tarballs from [Percona Software Downloads :octicons-link-external-16:](https://www.percona.com/downloads). The following table lists the tarball types in `Linux - Generic`. Select the *Percona XtraBackup* {{vers}} version, the software or the operating system, and the tarball type for your installation. Binary tarballs support all distributions. @@ -58,5 +58,3 @@ After you have downloaded the binary tarballs, extract the tarball in the file l Select a different software, such as Ubuntu 20.04 (Focal Fossa), for a tarball for that operating system. You can download the packages together or separately. -[Percona Software Downloads]: https://www.percona.com/downloads - diff --git a/docs/binary-tarball.md b/docs/binary-tarball.md index 4b71ab4a3..c59c56e7e 100644 --- a/docs/binary-tarball.md +++ b/docs/binary-tarball.md @@ -1,15 +1,14 @@ # Install from a binary tarball ---8<--- "pro-build-announcement.md" - Binary tarballs are compressed `tar` archives that contain precompiled executable files, libraries, and other dependencies. You can extract the binary tarballs to any path. -Download the binary tarballs from the `Linux - Generic` section on [Percona Product Downloads]. +Download the binary tarballs from the `Linux - Generic` section on [Percona Software Downloads :octicons-link-external-16:](https://www.percona.com/downloads). + +The following example downloads the tarball. Run the following command as root or use the sudo command. -The following example downloads the tarball: -```{.bash data-prompt="$"} -$ wget https://downloads.percona.com/downloads/Percona-XtraBackup-8.4/Percona-XtraBackup-8.4.0-1/binary/tarball/percona-xtrabackup-8.4.0-1-Linux-x86_64.glibc2.28.tar.gz +```shell +wget https://downloads.percona.com/downloads/Percona-XtraBackup-8.4/Percona-XtraBackup-8.4.0-1/binary/tarball/percona-xtrabackup-8.4.0-1-Linux-x86_64.glibc2.28.tar.gz ``` The output displays the following information: @@ -30,5 +29,3 @@ The output displays the following information: 2024-10-09 04:46:10 (4.48 MB/s) - ‘percona-xtrabackup-8.4.0-1-Linux-x86_64.glibc2.28.tar.gz’ saved [439358509/439358509] ``` - -[Percona Product Downloads]: https://www.percona.com/downloads/ diff --git a/docs/compile-xtrabackup.md b/docs/compile-xtrabackup.md index bde6acc14..439438599 100644 --- a/docs/compile-xtrabackup.md +++ b/docs/compile-xtrabackup.md @@ -1,18 +1,18 @@ # Compile and install from source -The following instructions install Percona XtraBackup {{vers}}. +The following instructions install Percona XtraBackup {{vers}}. Run the following command as root or use the sudo command. ## 1. Install Percona XtraBackup from the Git Source Tree -Percona uses the [Github](https://github.com/) revision control system for development. To build the latest Percona Server for MySQL from the source tree, you will need `git` installed on your system. +Percona uses the [Github :octicons-link-external-16:](https://github.com/) revision control system for development. To build the latest Percona Server for MySQL from the source tree, you will need `git` installed on your system. You can now fetch the latest Percona XtraBackup {{vers}} sources: -```{.bash data-prompt="$"} -$ git clone https://github.com/percona/percona-xtrabackup.git -$ cd percona-xtrabackup -$ git checkout trunk -$ git submodule update --init --recursive +```shell +git clone https://github.com/percona/percona-xtrabackup.git +cd percona-xtrabackup +git checkout trunk +git submodule update --init --recursive ``` ## 2. Installation prerequisites @@ -29,7 +29,7 @@ These might vary from system to system. This `cmake` version may be available -in your distribution as a separate package `cmake3`. For more information, see [cmake.org]. +in your distribution as a separate package `cmake3`. For more information, see [cmake.org :octicons-link-external-16:](https://cmake.org/). === "Debian or Ubuntu using `apt`" @@ -45,8 +45,8 @@ in your distribution as a separate package `cmake3`. For more information, see [ To install the man pages, install the python3-sphinx package first: - ```{.bash data-prompt="$"} - $ sudo apt install python3-sphinx + ```shell + sudo apt install python3-sphinx ``` === "CentOS or Red Hat using `yum`" @@ -58,16 +58,16 @@ in your distribution as a separate package `cmake3`. For more information, see [ compiler and development tools. Then, install `cmake` and other dependencies: - ```{.bash data-prompt="$"} - $ sudo yum install cmake openssl-devel libaio libaio-devel automake autoconf \ + ```shell + sudo yum install cmake openssl-devel libaio libaio-devel automake autoconf \ bison libtool ncurses-devel libgcrypt-devel libev-devel libcurl-devel zlib-devel \ zstd vim-common procps-ng-devel ``` To install the man pages, install the python3-sphinx package first: - ```{.bash data-prompt="$"} - $ sudo yum install python3-sphinx + ```shell + sudo yum install python3-sphinx ``` ## 3. Generate the build pipeline @@ -79,16 +79,16 @@ be used to compile the source code). 1. Change to the directory where you cloned the Percona XtraBackup repository - ```{.bash data-prompt="$"} - $ cd percona-xtrabackup + ```shell + cd percona-xtrabackup ``` 2. Create a directory to store the compiled files and then change to that directory: - ```{.bash data-prompt="$"} - $ mkdir build - $ cd build + ```shell + mkdir build + cd build ``` 3. If you use a regular build, run cmake or cmake3. In either case, the options you need to use are the @@ -101,15 +101,15 @@ same. for every distribution. If you installed the `python-sphinx` package you need to remove the `-DWITH_MAN_PAGES=OFF` from the following command. -```{.bash data-prompt="$"} -$ cmake -DBUILD_CONFIG=xtrabackup_release -DWITH_MAN_PAGES=OFF .. +```shell +cmake -DBUILD_CONFIG=xtrabackup_release -DWITH_MAN_PAGES=OFF .. ``` @@ -136,14 +136,14 @@ To compile the source code in your `build` directory, use the `make` command. 2. Run the `make` command. This command may take a long time to complete. - ```{.bash data-prompt="$"} - $ make + ```shell + make ``` To use all CPU threads and make compilation faster please use: - ```{.bash data-prompt="$"} - $ make -j$(nproc --all) + ```shell + make -j$(nproc --all) ``` ## 5. Install on the target system @@ -153,8 +153,8 @@ and tests to default location on the target system: `/usr/local/xtrabackup`. Run `make install` to install *Percona XtraBackup* to the default location. -```{.bash data-prompt="$"} -$ sudo make install +```shell +sudo make install ``` ### Install to a non-default location @@ -163,8 +163,8 @@ You may use the `DESTDIR` parameter with `make install` to install *Percona XtraBackup* to another location. Make sure that the effective user is able to write to the destination you choose. -```{.bash data-prompt="$"} -$ sudo make DESTDIR= install +```shell +sudo make DESTDIR= install ``` In fact, the destination directory is determined by the installation layout @@ -178,26 +178,26 @@ installation directory to be `/usr/local/xtrabackup`. !!! admonition "See also" - [MySQL Documentation: -DINSTALL_LAYOUT] + [MySQL Documentation: -DINSTALL_LAYOUT :octicons-link-external-16:](https://dev.mysql.com/doc/refman/{{vers}}/en/source-configuration-options.html#option_cmake_install_layout) ## 6. Run Percona XtraBackup After *Percona XtraBackup* is installed on your system, you may run it by using the full path to the `xtrabackup` command: -```{.bash data-prompt="$"} -$ /usr/local/xtrabackup/bin/xtrabackup +```shell +/usr/local/xtrabackup/bin/xtrabackup ``` Update your PATH environment variable if you would like to use the command on the command line directly. -```{.bash data-prompt="$"} +```shell $# Setting $PATH on the command line -$ PATH=$PATH:/usr/local/xtrabackup/bin/xtrabackup +PATH=$PATH:/usr/local/xtrabackup/bin/xtrabackup $# Run xtrabackup directly -$ xtrabackup +xtrabackup ``` Alternatively, you may consider placing a soft link (using `ln -s`) to one of @@ -205,6 +205,3 @@ the locations listed in your `PATH` environment variable. To view the documentation with `man`, update the `MANPATH` variable. -[cmake.org]: https://cmake.org/ -[the Developer Toolset]: https://developers.redhat.com/products/developertoolset/overview -[MySQL Documentation: -DINSTALL_LAYOUT]: https://dev.mysql.com/doc/refman/{{vers}}/en/source-configuration-options.html#option_cmake_install_layout \ No newline at end of file diff --git a/docs/copyright-and-licensing-information.md b/docs/copyright-and-licensing-information.md index 9b73829d4..ac1e46085 100644 --- a/docs/copyright-and-licensing-information.md +++ b/docs/copyright-and-licensing-information.md @@ -2,4 +2,4 @@ ## Documentation licensing -Percona XtraBackup documentation is (C)2009-2026 Percona LLC and/or its affiliates and is distributed under the [Creative Commons Attribution 4.0 International License](https://creativecommons.org/licenses/by/4.0/). +Percona XtraBackup documentation is (C)2009-2026 Percona LLC and/or its affiliates and is distributed under the [Creative Commons Attribution 4.0 International License :octicons-link-external-16:](https://creativecommons.org/licenses/by/4.0/). diff --git a/docs/create-compressed-backup.md b/docs/create-compressed-backup.md index 60950152f..9e1a2ac6e 100644 --- a/docs/create-compressed-backup.md +++ b/docs/create-compressed-backup.md @@ -3,13 +3,15 @@ Percona XtraBackup supports compressed backups. To make a compressed backup, use the `--compress` option along with the `--backup` and `--target-dir` options. A local or streaming backup can be compressed or decompressed with [xbstream](xbstream-binary-overview.md). +Run the following commands as root or use the sudo command. + By default, the `--compress` option uses the `zstandard` tool that you can install with the `percona-release` package configuration tool as follows: -```{.bash data-prompt="$"} -$ sudo percona-release enable tools -$ sudo apt update -$ sudo apt install zstandard +```shell +sudo percona-release enable tools +sudo apt update +sudo apt install zstandard ``` !!! note @@ -28,24 +30,24 @@ The Zstandard (ZSTD) is a fast lossless compression algorithm that targets real- To compress files using the `ZSTD` compression algorithm, use the `--compress` option: -```{.bash data-prompt="$"} -$ xtrabackup --backup --compress --target-dir=/data/backup +```shell +xtrabackup --backup --compress --target-dir=/data/backup ``` The resulting files have the `\*.zst` format. You can specify `ZSTD` compression level with the [`--compress-zstd-level(=#)`](xtrabackup-option-reference.md#compress-zstd-level) option. The default value is `1`. -```{.bash data-prompt="$"} -$ xtrabackup –backup –compress –compress-zstd-level=1 –target-dir=/data/backup +```shell +xtrabackup –backup –compress –compress-zstd-level=1 –target-dir=/data/backup ``` ## lz4 To compress files using the `lz4` compression algorithm, set the `--compress` option to `lz4`: -```{.bash data-prompt="$"} -$ xtrabackup --backup --compress=lz4 --target-dir=/data/backup +```shell +xtrabackup --backup --compress=lz4 --target-dir=/data/backup ``` The resulting files have the `\*.lz4` format. @@ -54,8 +56,8 @@ If you want to speed up the compression you can use the parallel compression, which can be enabled with `--compress-threads` option. Following example will use four threads for compression: -```{.bash data-prompt="$"} -$ xtrabackup --backup --compress --compress-threads=4 \ +```shell +xtrabackup --backup --compress --compress-threads=4 \ --target-dir=/data/compressed/ ``` diff --git a/docs/create-full-backup.md b/docs/create-full-backup.md index 6b1970253..290d6588a 100644 --- a/docs/create-full-backup.md +++ b/docs/create-full-backup.md @@ -13,10 +13,10 @@ exist and is empty, xtrabackup succeeds. xtrabackup does not overwrite existing files. It will fail with operating system error 17, `file exists`. -The following command starts the process: +The following command starts the process. Run all the commands as root or use the sudo command. -```{.bash data-prompt="$"} -$ xtrabackup --backup --target-dir=/data/backups/ +```bash +xtrabackup --backup --target-dir=/data/backups/ ``` This operation stores the backup at `/data/backups/`. If you specify a @@ -50,8 +50,8 @@ The following is an example of the output: The process ends with the following statement; the value of the `` depends on your system: -```{.bash data-prompt="$"} -$ xtrabackup: Transaction log of lsn () to () was copied. +```shell +xtrabackup: Transaction log of lsn () to () was copied. ``` !!! note @@ -60,8 +60,8 @@ $ xtrabackup: Transaction log of lsn () to () was copied. After the backup is finished, the target directory will contain files such as the following, assuming you have a single InnoDB table `test.tbl1` and you are using MySQL’s innodb_file_per_table option: -```{.bash data-prompt="$"} -$ ls -lh /data/backups/ +```shell +ls -lh /data/backups/ ``` The result should look like this: diff --git a/docs/create-gtid-replica.md b/docs/create-gtid-replica.md index db4d6d920..0bf2b8996 100644 --- a/docs/create-gtid-replica.md +++ b/docs/create-gtid-replica.md @@ -9,19 +9,21 @@ replica. ## 1. Take a backup from any server on the replication environment, source or replica +Run all the commands as root or use the sudo command. + The following command takes a backup and saves it in the `/data/backups/$TIMESTAMP` folder: -```{.bash data-prompt="$"} -$ xtrabackup --backup --target-dir=/data/backups/ +```shell +xtrabackup --backup --target-dir=/data/backups/ ``` In the destination folder, there will be a file with the name `xtrabackup_binlog_info`. This file contains both binary log coordinates and the `GTID` information. -```{.bash data-prompt="$"} -$ cat xtrabackup_binlog_info +```shell +cat xtrabackup_binlog_info ``` The result could look like this: @@ -43,8 +45,8 @@ That information is also printed by xtrabackup after taking the backup: The backup will be prepared with the following command on the Source: -```{.bash data-prompt="$"} -$ xtrabackup --prepare --target-dir=/data/backup +```shell +xtrabackup --prepare --target-dir=/data/backup ``` You need to select the path where your snapshot has been taken, for example @@ -59,15 +61,15 @@ server. If you are synchronizing the data directly to the already running replica’s data directory it is advised to stop the MySQL server there. -```{.bash data-prompt="$"} -$ rsync -avprP -e ssh /path/to/backupdir/$TIMESTAMP NewReplica:/path/to/mysql/ +```shell +rsync -avprP -e ssh /path/to/backupdir/$TIMESTAMP NewReplica:/path/to/mysql/ ``` After you copy the data over, make sure MySQL has proper permissions to access them. -```{.bash data-prompt="$"} -$ chown mysql:mysql /path/to/mysql/datadir +```shell +chown mysql:mysql /path/to/mysql/datadir ``` ## 4. Configure and start replication @@ -81,7 +83,7 @@ source node and, finally, start the replica. The example above is applicable to Percona XtraDB Cluster. The `wsrep_on` variable is set to 0 before resetting the source (`RESET BINARY LOGS AND GTIDS`). The reason is that Percona XtraDB Cluster will not allow resetting the source if `wsrep_on=1`. -```{.bash data-prompt="#"} +```sql # Using the mysql shell > SET SESSION wsrep_on = 0; > RESET BINARY LOGS AND GTIDS; @@ -99,8 +101,8 @@ source node and, finally, start the replica. The following command returns the replica status: -```{.bash data-prompt="mysql>"} -mysql> SHOW REPLICA STATUS\G +```sql +SHOW REPLICA STATUS\G ``` The results should be similar to the following: diff --git a/docs/create-incremental-backup.md b/docs/create-incremental-backup.md index 8bdd87f61..ba3f3a917 100644 --- a/docs/create-incremental-backup.md +++ b/docs/create-incremental-backup.md @@ -21,10 +21,13 @@ To make an incremental backup, begin with a full backup as usual. The xtrabackup binary writes a file called `xtrabackup_checkpoints` into the backup’s target directory. This file contains a line showing the `to_lsn`, which is the database’s LSN at the end of the backup. + +Run the following commands as root or use the sudo command. + Create the full backup with a following command: -```{.bash data-prompt="$"} -$ xtrabackup --backup --target-dir=/data/backups/base +```shell +xtrabackup --backup --target-dir=/data/backups/base ``` If you look at the `xtrabackup_checkpoints` file, you should see similar @@ -43,8 +46,8 @@ content depending on your LSN nuber: Now that you have a full backup, you can make an incremental backup based on it. Use the following command: -```{.bash data-prompt="$"} -$ xtrabackup --backup --target-dir=/data/backups/inc1 \ +```shell +xtrabackup --backup --target-dir=/data/backups/inc1 \ --incremental-basedir=/data/backups/base ``` @@ -69,8 +72,8 @@ content to the following: It’s now possible to use this directory as the base for yet another incremental backup: -```{.bash data-prompt="$"} -$ xtrabackup --backup --target-dir=/data/backups/inc2 \ +```shell +xtrabackup --backup --target-dir=/data/backups/inc2 \ --incremental-basedir=/data/backups/inc1 ``` diff --git a/docs/create-individual-partition-backup.md b/docs/create-individual-partition-backup.md index 5ff63af56..03b7db17f 100644 --- a/docs/create-individual-partition-backup.md +++ b/docs/create-individual-partition-backup.md @@ -20,10 +20,10 @@ qualified database name and table name, in the form of If the partition 0 is not backed up, Percona XtraBackup cannot generate a .cfg file. MySQL 8.0 stores the table metadata in partition 0. For example, this operation takes a back-up of the partition `p4` from -the table `name` located in the database `imdb`: +the table `name` located in the database `imdb`. Run the following command as a root user. -```{.bash data-prompt="$"} -$ xtrabackup --tables=^imdb[.]name#p#p4 --backup +```shell +xtrabackup --tables=^imdb[.]name#p#p4 --backup ``` If partition 0 is not backed up, the following errors may occur: diff --git a/docs/create-partial-backup.md b/docs/create-partial-backup.md index 194a73fc0..880b247e8 100644 --- a/docs/create-partial-backup.md +++ b/docs/create-partial-backup.md @@ -19,7 +19,7 @@ There are multiple ways of specifying which part of data is backed up: * Use the `--databases-file` option to list the databases -The following examples assume a database named `test` that contains tables named `t1` and `t2`. +The following examples assume a database named `test` that contains tables named `t1` and `t2`. Run all the commands as root or use the sudo command. === "`–-tables` option" @@ -29,15 +29,15 @@ The following examples assume a database named `test` that contains tables named To back up only tables in the `test` database, use the following command: - ```{.bash data-prompt="$"} - $ xtrabackup --backup --datadir=/var/lib/mysql --target-dir=/data/backups/ \ + ```shell + xtrabackup --backup --datadir=/var/lib/mysql --target-dir=/data/backups/ \ --tables="^test[.].*" ``` To back up only the `test.t1` table, use the following command: - ```{.bash data-prompt="$"} - $ xtrabackup --backup --datadir=/var/lib/mysql --target-dir=/data/backups/ \ + ```shell + xtrabackup --backup --datadir=/var/lib/mysql --target-dir=/data/backups/ \ --tables="^test[.]t1" ``` @@ -49,9 +49,9 @@ The following examples assume a database named `test` that contains tables named regular expression matching. The table names must be fully-qualified in `databasename.tablename` format. - ```{.bash data-prompt="$"} - $ echo "mydatabase.mytable" > /tmp/tables.txt - $ xtrabackup --backup --tables-file=/tmp/tables.txt + ```shell + echo "mydatabase.mytable" > /tmp/tables.txt + xtrabackup --backup --tables-file=/tmp/tables.txt ``` === "`--databases` option" @@ -69,8 +69,8 @@ The following examples assume a database named `test` that contains tables named even if they are not explicitly listed by the parameter if they were created after the backup started. - ```{.bash data-prompt="$"} - $ xtrabackup --databases='mysql sys performance_schema test ...' + ```shell + xtrabackup --databases='mysql sys performance_schema test ...' ``` === "`--databases-file` option" diff --git a/docs/docker.md b/docs/docker.md index ed0c01d00..9c45ad5a4 100644 --- a/docs/docker.md +++ b/docs/docker.md @@ -11,10 +11,12 @@ Percona Server for MySQL in one container and Percona XtraBackup in another. Docker images offer a range of options. Create a Docker container based on a Docker image. Docker images for -Percona XtraBackup are hosted publicly on [Docker Hub]. +Percona XtraBackup are hosted publicly on [Docker Hub :octicons-link-external-16:](https://hub.docker.com/r/percona/percona-xtrabackup). -```{.bash data-prompt="$"} -$ sudo docker create ... percona/percona-xtrabackup --name xtrabackup ... +Run all the commands as root or use the sudo command. + +```shell +sudo docker create ... percona/percona-xtrabackup --name xtrabackup ... ``` ### Scope of this section @@ -44,12 +46,12 @@ intend to use with Percona XtraBackup. !!! admontion "See also" - [Docker volumes as container persistent data storage] + [Docker volumes as container persistent data storage :octicons-link-external-16:](https://docs.docker.com/storage/volumes/) - [More information about containers] + [More information about containers :octicons-link-external-16:](https://docs.docker.com/config/containers/start-containers-automatically) -```{.bash data-prompt="$"} -$ sudo docker run -d --name percona-server-mysql \ +```shell +sudo docker run -d --name percona-server-mysql \ -e MYSQL_ROOT_PASSWORD=root percona/percona-server:{{vers}} ``` @@ -72,8 +74,8 @@ Docker downloads the Percona XtraBackup image from the Docker Hub. If it is not the first time you use the selected image, Docker uses the image available locally. -```{.bash data-prompt="$"} -$ sudo docker create --name percona-xtrabackup --volumes-from percona-server-mysql \ +```shell +sudo docker create --name percona-xtrabackup --volumes-from percona-server-mysql \ percona/percona-xtrabackup \ xtrabackup --backup --datadir=/var/lib/mysql/ --target-dir=/backup \ --user=root --password=mysql @@ -88,8 +90,8 @@ that you intend to use the same data as the Percona Server for MySQL container. Run the container with exactly the same parameters that were used when the container was created: -```{.bash data-prompt="$"} -$ sudo docker start -ai percona-xtrabackup +```shell +sudo docker start -ai percona-xtrabackup ``` This command starts the percona-xtrabackup container, attaches to its @@ -98,12 +100,8 @@ input/output streams, and opens an interactive shell. The `docker run` is a shortcut command that creates a Docker container and then immediately runs it. -```{.bash data-prompt="$"} -$ sudo docker run --name percona-xtrabackup --volumes-from percona-server-mysql \ +```shell +sudo docker run --name percona-xtrabackup --volumes-from percona-server-mysql \ percona/percona-xtrabackup xtrabackup --backup --data-dir=/var/lib/mysql --target-dir=/backup --user=root --password=mysql ``` - -[Docker Hub]: https://hub.docker.com/r/percona/percona-xtrabackup -[Docker volumes as container persistent data storage]: https://docs.docker.com/storage/volumes/ -[More information about containers]: https://docs.docker.com/config/containers/start-containers-automatically \ No newline at end of file diff --git a/docs/download-instructions.md b/docs/download-instructions.md index ab01ed4bd..7520283c3 100644 --- a/docs/download-instructions.md +++ b/docs/download-instructions.md @@ -4,7 +4,7 @@ Do the following steps to select the software: -1. Open [Software Downloads](https://www.percona.com/downloads) +1. Open [Software Downloads :octicons-link-external-16:](https://www.percona.com/downloads) 2. Locate the Percona Software, for example, Percona XtraBackup 3. In `Select Product`, select which product, for example, Percona XtraBackup 8.4 4. In `Select Product Version`, select the version, for example, PERCONA-XTRABACKUP-8.4.0-5 @@ -24,4 +24,4 @@ In `Package Download Options`, you can do either of the following: * Select `DOWNLOAD ALL PACKAGES` and right-click on the arrow, and in the drop-down menu, choose `Copy Link Address` -Paste the link in your terminal prompt to download the selected package. \ No newline at end of file +Paste the link in your terminal prompt to download the selected package. diff --git a/docs/dump-schema.md b/docs/dump-schema.md index a9768e8db..bc46b0abc 100644 --- a/docs/dump-schema.md +++ b/docs/dump-schema.md @@ -4,7 +4,7 @@ This script is designed to dump the schemas of all tables from each database in The script should be modified for your specific use case before you run it. For example, you may want to exclude certain tables or databases, or specify a different output directory. -```{.bash data-prompt="$"} +```shell print_usage() { echo "Usage: $0 [--defaults-file=] [--destination-dir=]" echo " --defaults-file= (Optional) Path to MySQL defaults file (e.g., /etc/my.cnf)" @@ -87,7 +87,7 @@ echo "Schema dumps are saved in the '$DEST_DIR' directory." ## Usage -To use this script, follow these steps: +To use this script, follow these steps. Run all the commands as root or use the sudo command. 1. Save the script @@ -99,48 +99,48 @@ To use this script, follow these steps: * Run the following command to make the script executable: - ```{.bash data-prompt="$"} - $ chmod +x dump_schemas.sh + ```shell + chmod +x dump_schemas.sh ``` 3. Verify dependencies * Check if `mysqldump` is installed by running: - ```{.bash data-prompt="$"} - $ which mysqldump + ```shell + which mysqldump ``` * If `mysqldump` is not installed or not available in your PATH, install it using: - ```{.bash data-prompt="$"} - $ sudo apt install mysql-client + ```shell + sudo apt install mysql-client ``` 4. Use one of the following commands to execute the script: * See the usage instructions, run: - ```{.bash data-prompt="$"} - $ ./dump_schemas.sh --help + ```shell + ./dump_schemas.sh --help ``` * Specify a MySQL defaults file (for example, `~/.my.cnf`) and destination directory for the schema dumps, run: - ```{.bash data-prompt="$"} - $ ./dump_schemas.sh --defaults-file=/path/to/my.cnf --destination-dir=/path/to/output + ```shell + ./dump_schemas.sh --defaults-file=/path/to/my.cnf --destination-dir=/path/to/output ``` * If you do not have a `defaults-file`, use the script defaults of a hardcoded password or an environment variable, if set. Specify only the destination directory: - ```{.bash data-prompt="$"} - $ ./dump_schemas.sh --destination-dir=/path/to/output + ```shell + ./dump_schemas.sh --destination-dir=/path/to/output ``` * To use the hardcoded password and default destination directory, `schema_dumps`, use: - ```{.bash data-prompt="$"} - $ ./dump_schemas.sh + ```shell + ./dump_schemas.sh ``` @@ -151,8 +151,8 @@ To use this script, follow these steps: * The dumped schemas are organized as follows: - ```{.bash data-prompt="$"} - $ find . + ```shell + find . ``` ??? example "Expected output" diff --git a/docs/encrypt-backups.md b/docs/encrypt-backups.md index 22958ae6f..074c23fac 100644 --- a/docs/encrypt-backups.md +++ b/docs/encrypt-backups.md @@ -3,6 +3,8 @@ Percona XtraBackup supports encrypting and decrypting local and streaming backups with the upstream option, adding another protection layer. The encryption is implemented using the `libgcrypt` library from GnuPG. +Run all the commands as root or use the sudo command. + ## Create encrypted backups The following options create encrypted backups. The @@ -20,8 +22,8 @@ For an encryption key, use a command, such as `openssl rand -base64 24`, to gene An example of the *xtrabackup* command using the `--encrypt-key`: -```{.bash data-prompt="$"} -$ xtrabackup --backup --encrypt=AES256 --encrypt-key="{randomly-generated-alphanumeric-string}" --target-dir=/data/backup +```shell +xtrabackup --backup --encrypt=AES256 --encrypt-key="{randomly-generated-alphanumeric-string}" --target-dir=/data/backup ``` ### encrypt-key-file option @@ -31,8 +33,8 @@ Remember that using the-- encrypt-key-file option, your text editor can automati An example of using the `--encrypt-key-file` option: -```{.bash data-prompt="$"} -$ xtrabackup --backup --encrypt=AES256 --encrypt-key-file=/data/backups/keyfile --target-dir=/data/backup +```shell +xtrabackup --backup --encrypt=AES256 --encrypt-key-file=/data/backups/keyfile --target-dir=/data/backup ``` ## Optimize the encryption process @@ -50,14 +52,14 @@ You can decrypt backups with the `xbcrypt` binary. The following example encrypt You can use the `--parallel` option and the `--decrypt` option to decrypt multiple files simultaneously. -```{.bash data-prompt="$"} -$ for i in `find . -iname "*\.xbcrypt"`; do xbcrypt -d --encrypt-key-file=/root/secret_key --encrypt-algo=AES256 < $i > $(dirname $i)/$(basename $i .xbcrypt) && rm $i; done +```shell +for i in `find . -iname "*\.xbcrypt"`; do xbcrypt -d --encrypt-key-file=/root/secret_key --encrypt-algo=AES256 < $i > $(dirname $i)/$(basename $i .xbcrypt) && rm $i; done ``` The following example shows a decryption process. -```{.bash data-prompt="$"} -$ xtrabackup --decrypt=AES256 --encrypt-key="{randomly-generated-alphanumeric-string}" --target-dir=/data/backup/ +```shell +xtrabackup --decrypt=AES256 --encrypt-key="{randomly-generated-alphanumeric-string}" --target-dir=/data/backup/ ``` Percona XtraBackup doesn’t automatically remove the encrypted files. You must remove the `\*.xbcrypt` files manually. @@ -66,16 +68,16 @@ Percona XtraBackup doesn’t automatically remove the encrypted files. You must After decrypting the backups, prepare the backups with the `--prepare` option: -```{.bash data-prompt="$"} -$ xtrabackup --prepare --target-dir=/data/backup/ +```shell +xtrabackup --prepare --target-dir=/data/backup/ ``` ## Restore encrypted backups *xtrabackup* offers the `--copy-back` option to restore a backup to the server’s datadir: -```{.bash data-prompt="$"} -$ xtrabackup --copy-back --target-dir=/data/backup/ +```shell +xtrabackup --copy-back --target-dir=/data/backup/ ``` The option copies all the data-related files to the server’s datadir. The server’s `my.cnf` configuration file determines the location. diff --git a/docs/encrypted-innodb-tablespace-backups.md b/docs/encrypted-innodb-tablespace-backups.md index 395053995..7a1848c0f 100644 --- a/docs/encrypted-innodb-tablespace-backups.md +++ b/docs/encrypted-innodb-tablespace-backups.md @@ -10,14 +10,14 @@ These encryption types are independent. You can use them separately or together ## InnoDB tablespace encryption -InnoDB supports [data encryption for InnoDB tables] in file-per-table tablespaces. When accessing an encrypted tablespace, InnoDB uses the master encryption key to decrypt the tablespace key. InnoDB stores the master encryption key in a keyring. +InnoDB supports [data encryption for InnoDB tables :octicons-link-external-16:](https://dev.mysql.com/doc/refman/{{vers}}/en/innodb-data-encryption.html) in file-per-table tablespaces. When accessing an encrypted tablespace, InnoDB uses the master encryption key to decrypt the tablespace key. InnoDB stores the master encryption key in a keyring. Percona XtraBackup supports the following keyring components: * [keyring_vault](#keyring_vault-configuration) * [keyring_file](#keyring_file-configuration) -* [Key Management Interoperability Protocol (KMIP)] -* [Amazon Key Management Service (AWS KMS)] +* [Key Management Interoperability Protocol (KMIP) :octicons-link-external-16:](https://docs.percona.com/percona-server/8.4/using-kmip.html?h=kmip) +* [Amazon Key Management Service (AWS KMS) :octicons-link-external-16:](https://docs.percona.com/percona-server/8.4/using-amz-kms.html) Percona XtraBackup {{vers}} and later versions support only component versions of the security features. @@ -65,7 +65,7 @@ The `component_keyring_vault.cnf` file uses JSON format: } ``` -For information on configuring the keyring vault component on the MySQL server, see [Use the keyring vault component]. +For information on configuring the keyring vault component on the MySQL server, see [Use the keyring vault component :octicons-link-external-16:](https://docs.percona.com/percona-server/8.4/use-keyring-vault-component.html). #### keyring_file configuration @@ -119,7 +119,7 @@ XtraBackup uses the component's configuration file during prepare and restore op No keyring configuration is needed: -```bash +```shell xtrabackup --backup --target-dir=/data/backup --user=root ``` @@ -131,7 +131,7 @@ To prepare the backup, you must provide access to the keyring. The xtrabackup bi The configuration file name must match exactly the expected name for your keyring component. See [Configuration file name requirements](#configuration-file-name-requirements) for the exact file names required. If the file name does not match exactly, XtraBackup ignores the configuration file. -```bash +```shell xtrabackup --prepare --target-dir=/data/backup ``` @@ -141,13 +141,13 @@ Specify the path to your component's configuration file (for example, `/etc/comp After you prepare the backup, restore the backup using [`--copy-back`](xtrabackup-option-reference.md#copy-back) or [`--move-back`](xtrabackup-option-reference.md#move-back). If you use [`--move-back`](xtrabackup-option-reference.md#move-back), run `--prepare` again after moving the files. In both cases, provide the same keyring configuration file. -```bash +```shell xtrabackup --copy-back --target-dir=/data/backup --datadir=/data/mysql ``` Or using `--move-back`: -```bash +```shell xtrabackup --move-back --target-dir=/data/backup --datadir=/data/mysql xtrabackup --prepare --target-dir=/data/mysql ``` @@ -162,13 +162,13 @@ Begin with a full backup. The xtrabackup binary writes `xtrabackup_checkpoints` Create a full backup (no keyring config needed): -```bash +```shell xtrabackup --backup --target-dir=/data/backups/base ``` Make an incremental backup based on the full backup: -```bash +```shell xtrabackup --backup --target-dir=/data/backups/inc1 \ --incremental-basedir=/data/backups/base ``` @@ -177,7 +177,7 @@ The [`--incremental-basedir`](xtrabackup-option-reference.md#incremental-basedir Use this directory as the base for yet another incremental backup: -```bash +```shell xtrabackup --backup --target-dir=/data/backups/inc2 \ --incremental-basedir=/data/backups/inc1 ``` @@ -188,13 +188,13 @@ The `--prepare` step for incremental backups requires the keyring configuration. Beginning with the full backup, prepare the full backup and then apply the incremental differences. Prepare the base backup with [`--apply-log-only`](xtrabackup-option-reference.md#apply-log-only). Use the appropriate configuration file name for your keyring component (see [Configuration file name requirements](#configuration-file-name-requirements)): -```bash +```shell xtrabackup --prepare --apply-log-only --target-dir=/data/backups/base ``` Apply the first incremental backup to the full backup using [`--incremental-dir`](xtrabackup-option-reference.md#incremental-dir): -```bash +```shell xtrabackup --prepare --apply-log-only --target-dir=/data/backups/base \ --incremental-dir=/data/backups/inc1 ``` @@ -236,13 +236,13 @@ xtrabackup --prepare --target-dir=/data/backups/base \ After you prepare the incremental backups, restore them using [`--copy-back`](xtrabackup-option-reference.md#copy-back) or [`--move-back`](xtrabackup-option-reference.md#move-back). If you use [`--move-back`](xtrabackup-option-reference.md#move-back), run `--prepare` again after moving the files. In both cases, provide the same keyring configuration file: -```bash +```shell xtrabackup --copy-back --target-dir=/data/backups/base --datadir=/data/mysql ``` Or using `--move-back`: -```bash +```shell xtrabackup --move-back --target-dir=/data/backups/base --datadir=/data/mysql xtrabackup --prepare --target-dir=/data/mysql ``` @@ -255,7 +255,7 @@ Use the [`--transition-key=`](xtrabackup-option-reference.md#transit #### Create a backup with a passphrase -```bash +```shell xtrabackup --backup --user=root -p --target-dir=/data/backup \ --transition-key=MySecretKey ``` @@ -266,7 +266,7 @@ If you specify [`--transition-key`](xtrabackup-option-reference.md#transition-ke Specify the same passphrase for the prepare command: -```bash +```shell xtrabackup --prepare --target-dir=/data/backup \ --transition-key=MySecretKey ``` @@ -277,7 +277,7 @@ You do not need keyring options here, because xtrabackup does not access the key When you restore a backup, generate a new master key using [`--generate-new-master-key`](xtrabackup-option-reference.md#generate-new-master-key). The configuration file name must match one of the exact configuration file names listed in [Configuration file name requirements](#configuration-file-name-requirements): -```bash +```shell xtrabackup --copy-back --target-dir=/data/backup --datadir=/data/mysql \ --transition-key=MySecretKey --generate-new-master-key ``` @@ -290,20 +290,20 @@ You can store a transition key in the keyring. In this case, xtrabackup must acc * Back up using [`--generate-transition-key`](xtrabackup-option-reference.md#generate-transition-key): - ```bash + ```shell xtrabackup --backup --user=root -p --target-dir=/data/backup \ --generate-transition-key ``` * Prepare: - ```bash + ```shell xtrabackup --prepare --target-dir=/data/backup ``` * Copy-back: - ```bash + ```shell xtrabackup --copy-back --target-dir=/data/backup --datadir=/data/mysql \ --generate-new-master-key ``` @@ -322,7 +322,7 @@ The `--encrypt` option specifies the encryption algorithm: `AES128`, `AES192`, o #### Using --encrypt-key -```bash +```shell xtrabackup --backup --encrypt=AES256 --encrypt-key="{randomly-generated-alphanumeric-string}" --target-dir=/data/backup ``` @@ -334,7 +334,7 @@ xtrabackup --backup --encrypt=AES256 --encrypt-key="{randomly-generated-alphanum The recommended method uses `--encrypt-key-file` to read the key from a file: -```bash +```shell echo -n "{randomly-generated-alphanumeric-string}" > /data/backups/keyfile xtrabackup --backup --encrypt=AES256 --encrypt-key-file=/data/backups/keyfile --target-dir=/data/backup ``` @@ -351,13 +351,13 @@ Additional encrypted backup options can speed up the encryption process: [`--enc To decrypt an encrypted backup, use the [`--decrypt`](xtrabackup-option-reference.md#decrypt) option. The decryption algorithm must match the algorithm that you used during encryption. You can use the [`--parallel`](xtrabackup-option-reference.md#parallel) option with `--decrypt` to decrypt multiple files simultaneously. -```bash +```shell xtrabackup --decrypt=AES256 --encrypt-key-file=/data/backups/keyfile --target-dir=/data/backup ``` Alternatively, you can use the `xbcrypt` binary directly: -```bash +```shell for i in `find . -iname "*\.xbcrypt"`; do xbcrypt -d --encrypt-key-file=/root/secret_key --encrypt-algo=AES256 < $i > $(dirname $i)/$(basename $i .xbcrypt) && rm $i; done ``` @@ -369,11 +369,6 @@ for i in `find . -iname "*\.xbcrypt"`; do xbcrypt -d --encrypt-key-file=/root/se After decrypting the backup, prepare the backup with the `--prepare` option: -```bash +```shell xtrabackup --prepare --target-dir=/data/backup ``` - -[data encryption for InnoDB tables]: https://dev.mysql.com/doc/refman/{{vers}}/en/innodb-data-encryption.html -[Amazon Key Management Service (AWS KMS)]: https://docs.percona.com/percona-server/8.4/using-amz-kms.html -[Key Management Interoperability Protocol (KMIP)]: https://docs.percona.com/percona-server/8.4/using-kmip.html?h=kmip -[Use the keyring vault component]: https://docs.percona.com/percona-server/8.4/use-keyring-vault-component.html diff --git a/docs/faq.md b/docs/faq.md index 9329aaac8..6ef92ab2f 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -12,7 +12,7 @@ Percona XtraDB Cluster. ## Are you aware of any web-based backup management tools (commercial or not) built around Percona XtraBackup*? -[ZRM Community] is a community tool that uses Percona XtraBackup for Non-Blocking Backups: +[ZRM Community :octicons-link-external-16:](https://www.zmanda.com/zrm-community/) is a community tool that uses Percona XtraBackup for Non-Blocking Backups: “ZRM provides support for non-blocking backups of MySQL using Percona XtraBackup. ZRM with \Percona XtraBackup provides resource utilization @@ -63,11 +63,7 @@ Percona XtraBackup will not be able to take a consistent backup. Retry the backu ---> !!! note - * Redo logging is disabled during a [sorted index build]. To avoid this error, Percona XtraBackup can use metadata locks on tables while they are copied: + * Redo logging is disabled during a [sorted index build :octicons-link-external-16:](https://dev.mysql.com/doc/refman/{{vers}}/en/sorted-index-builds.html). To avoid this error, Percona XtraBackup can use metadata locks on tables while they are copied: * To block all DDL operations, use the `--lock-ddl` option that issues `LOCK TABLES FOR BACKUP`. - -[sorted index build]: https://dev.mysql.com/doc/refman/{{vers}}/en/sorted-index-builds.html - -[ZRM Community]: https://www.zmanda.com/zrm-community/ diff --git a/docs/flush-tables-with-read-lock.md b/docs/flush-tables-with-read-lock.md index 4d135cfb4..c2abcab97 100644 --- a/docs/flush-tables-with-read-lock.md +++ b/docs/flush-tables-with-read-lock.md @@ -24,9 +24,9 @@ To prevent the server staying in a read-only mode until the queries finish, xtra !!! note - All operations described in this section have no effect when [Backup locks] are used. + All operations described in this section have no effect when [Backup locks :octicons-link-external-16:](https://docs.percona.com/percona-server/8.4/backup-locks.html) are used. - Percona XtraBackup uses [Backup locks] where available as a lightweight alternative to `FLUSH TABLES WITH READ + Percona XtraBackup uses backup locks where available as a lightweight alternative to `FLUSH TABLES WITH READ LOCK`. This operation automatically copies non-InnoDB data and avoids blocking DML queries that modify InnoDB tables. ## Wait for queries to finish @@ -91,8 +91,8 @@ Running the xtrabackup with the following options will cause xtrabackup to spend no longer than 3 minutes waiting for all queries older than 40 seconds to complete. -```{.bash data-prompt="$"} -$ xtrabackup --backup --ftwrl-wait-threshold=40 \ +```shell +xtrabackup --backup --ftwrl-wait-threshold=40 \ --ftwrl-wait-query-type=all --ftwrl-wait-timeout=180 \ --kill-long-queries-timeout=20 --kill-long-query-type=all \ --target-dir=/data/backups/ @@ -101,6 +101,3 @@ $ xtrabackup --backup --ftwrl-wait-threshold=40 \ After `FLUSH TABLES WITH READ LOCK` is issued, xtrabackup will wait for 20 seconds for lock to be acquired. If lock is still not acquired after 20 seconds, it will kill all queries which are running longer that the `FLUSH TABLES WITH READ LOCK`. - -[backup locks]: https://docs.percona.com/percona-server/innovation-release/backup-locks.html -[Backup locks]: https://docs.percona.com/percona-server/innovation-release/backup-locks.html diff --git a/docs/generated-files.md b/docs/generated-files.md index a80cc7a7a..d89d99fe7 100644 --- a/docs/generated-files.md +++ b/docs/generated-files.md @@ -40,8 +40,8 @@ After processing the `.delta` files, xtrabackup applies the redo log. After a backup operation, you can quickly list the contents of your backup directory using the `ls` command with the following options: -```{.bash data-prompt="$"} -$ ls -lhR /backups/ +```shell +ls -lhR /backups/ ``` This command provides a detailed, human-friendly, and recursive listing of the entire directory tree. diff --git a/docs/get-help.md b/docs/get-help.md index 48f8fa895..02146483d 100644 --- a/docs/get-help.md +++ b/docs/get-help.md @@ -6,9 +6,9 @@ Our documentation guides are packed with information, but they can’t cover eve Be a part of a space where you can tap into a wealth of knowledge from other database enthusiasts and experts who work with Percona’s software every day. While our service is entirely free, keep in mind that response times can vary depending on the complexity of the question. You are engaging with people who genuinely love solving database challenges. -We recommend visiting our [Community Forum](https://forums.percona.com/t/welcome-to-perconas-community-forum/7){:target="_blank"}. It’s an excellent place for discussions, technical insights, and support around Percona database software. If you’re new and feeling a bit unsure, our [FAQ](https://forums.percona.com/faq){:target="_blank"} and [Guide for New Users](https://forums.percona.com/t/faq-guide-for-new-users/8562){:target="_blank"} ease you in. +We recommend visiting our [Community Forum :octicons-link-external-16:](https://forums.percona.com/t/welcome-to-perconas-community-forum/7){:target="_blank"}. It’s an excellent place for discussions, technical insights, and support around Percona database software. If you’re new and feeling a bit unsure, our [FAQ :octicons-link-external-16:](https://forums.percona.com/faq){:target="_blank"} and [Guide for New Users :octicons-link-external-16:](https://forums.percona.com/t/faq-guide-for-new-users/8562){:target="_blank"} ease you in. -If you have thoughts, feedback, or ideas, the community team would like to hear from you at [Any ideas on how to make the forum better?](https://forums.percona.com/t/any-ideas-on-how-to-make-the-forum-better/11522){:target="blank"}. We’re always excited to connect and improve everyone's experience. +If you have thoughts, feedback, or ideas, the community team would like to hear from you at [Any ideas on how to make the forum better? :octicons-link-external-16:](https://forums.percona.com/t/any-ideas-on-how-to-make-the-forum-better/11522){:target="blank"}. We’re always excited to connect and improve everyone's experience. ## Percona experts diff --git a/docs/glossary.md b/docs/glossary.md index 510841a56..b75e81942 100644 --- a/docs/glossary.md +++ b/docs/glossary.md @@ -124,7 +124,7 @@ Specifies the names, sizes and location of shared tablespace files: ## innodb\_file\_per\_table -By default, InnoDB creates tables and indexes in a [file-per-tablespace]. If the `innodb_file_per_table` variable is disabled, you can enable the variable in your configuration file: +By default, InnoDB creates tables and indexes in a [file-per-tablespace :octicons-link-external-16:](https://dev.mysql.com/doc/refman/{{vers}}/en/innodb-file-per-table-tablespaces.html). If the `innodb_file_per_table` variable is disabled, you can enable the variable in your configuration file: > \[mysqld\]
> innodb\_file\_per\_table
@@ -186,12 +186,9 @@ To support simultaneous compression and streaming, Percona XtraBackup uses the x ## XtraDB -Percona XtraDB is an enhanced version of the InnoDB storage engine, designed to better scale on modern hardware. Percona XtraDB includes features which are useful in a high performance environment. It is fully backward-compatible, and is a drop-in replacement for the standard InnoDB storage engine. For more information, see [The Percona XtraDB Storage Engine]. +Percona XtraDB is an enhanced version of the InnoDB storage engine, designed to better scale on modern hardware. Percona XtraDB includes features which are useful in a high performance environment. It is fully backward-compatible, and is a drop-in replacement for the standard InnoDB storage engine. For more information, see [The Percona XtraDB Storage Engine :octicons-link-external-16:](https://www.percona.com/doc/percona-server/innovation-release/percona-xtradb.html). ## Zstandard (ZSTD) `ZSTD` is a fast lossless compression algorithm that targets real-time compression scenarios and better compression ratios. - -[file-per-tablespace]: https://dev.mysql.com/doc/refman/{{vers}}/en/innodb-file-per-table-tablespaces.html -[The Percona XtraDB Storage Engine]: https://www.percona.com/doc/percona-server/innovation-release/percona-xtradb.html \ No newline at end of file diff --git a/docs/how-xtrabackup-works.md b/docs/how-xtrabackup-works.md index 2c7c7a89e..aa2250fd5 100644 --- a/docs/how-xtrabackup-works.md +++ b/docs/how-xtrabackup-works.md @@ -16,7 +16,7 @@ The `--register-redo-log-consumer` parameter is disabled by default. When enable Percona XtraBackup remembers the LSN when it starts, and then copies the data files. The operation takes time, and the files may change, then LSN reflects the state of the database at different points in time. Percona XtraBackup also runs a background process that watches the transaction log files, and copies any changes. Percona XtraBackup does this continually. The transaction logs are written in a round-robin fashion, and can be reused. -Percona XtraBackup uses [Backup locks] where available as a lightweight alternative to `FLUSH TABLES WITH READ LOCK`. MySQL {{vers}} allows acquiring an instance level backup lock via the `LOCK INSTANCE FOR BACKUP` statement. +Percona XtraBackup uses [Backup locks :octicons-link-external-16:](https://docs.percona.com/percona-server/innovation-release/backup-locks.html) where available as a lightweight alternative to `FLUSH TABLES WITH READ LOCK`. MySQL {{vers}} allows acquiring an instance level backup lock via the `LOCK INSTANCE FOR BACKUP` statement. Locking is only done for MyISAM and other non-InnoDB tables after Percona XtraBackup finishes backing up all InnoDB/XtraDB data and @@ -39,7 +39,7 @@ needed even with the `--slave-info` option. !!! admonition "See also" - [MySQL Documentation: LOCK INSTANCE FOR BACKUP] + [MySQL Documentation: LOCK INSTANCE FOR BACKUP :octicons-link-external-16:](https://dev.mysql.com/doc/refman/{{vers}}/en/lock-instance-for-backup.html) When backup locks are supported by the server, xtrabackup first copies InnoDB data, runs the `LOCK TABLES FOR BACKUP` and then copies the MyISAM @@ -112,5 +112,3 @@ target locations. As this option removes backup files, it must be used with caution. It is useful in cases when there is not enough free disk space to hold both data files and their backup copies. -[MySQL Documentation: LOCK INSTANCE FOR BACKUP]: https://dev.mysql.com/doc/refman/{{vers}}/en/lock-instance-for-backup.html -[Backup locks]: https://docs.percona.com/percona-server/innovation-release/backup-locks.html \ No newline at end of file diff --git a/docs/index.md b/docs/index.md index d1debd500..d282958f1 100644 --- a/docs/index.md +++ b/docs/index.md @@ -8,7 +8,7 @@ Percona XtraBackup is an open source hot backup utility for MySQL-based servers that keep your database fully available during planned maintenance windows. Whether it is a 24x7 highly loaded server or a low-transaction-volume -Percona XtraBackup is designed to make backups seamless without disrupting the performance of the server in a production environment. Percona XtraBackup (PXB) is a 100% open source backup solution with [commercial support](https://www.percona.com/mysql-support/) available for organizations who want to benefit from comprehensive, responsive, and cost-flexible database support for MySQL. +Percona XtraBackup is designed to make backups seamless without disrupting the performance of the server in a production environment. Percona XtraBackup (PXB) is a 100% open source backup solution with [commercial support :octicons-link-external-16:](https://www.percona.com/mysql-support/) available for organizations who want to benefit from comprehensive, responsive, and cost-flexible database support for MySQL. ## Percona XtraBackup features diff --git a/docs/log-enhancements.md b/docs/log-enhancements.md index e13c74028..516852d9c 100644 --- a/docs/log-enhancements.md +++ b/docs/log-enhancements.md @@ -8,8 +8,8 @@ The error logs did not have a standard structure and the log statements varied i * The backup log statement header has the name of the module, `xtrabackup`, which generated the statement but no timestamp: -```{.bash data-prompt="$"} - $ xtrabackup: recognized client arguments: --parallel=4 --target-dir=/data/backups/ --backup=1 +```shell +xtrabackup: recognized client arguments: --parallel=4 --target-dir=/data/backups/ --backup=1 ``` The output should be similar to the following: diff --git a/docs/lru-dump-backup.md b/docs/lru-dump-backup.md index a05164692..e0214fda0 100644 --- a/docs/lru-dump-backup.md +++ b/docs/lru-dump-backup.md @@ -12,6 +12,4 @@ reducing the warm up time. It restores the buffer pool state from If the buffer restore option is enabled in `my.cnf`, buffer pool will be in the warm state after backup is restored. -Find the information on how to save and restore the buffer pool dump in [Saving and Restoring the Buffer Pool State]. - -[Saving and Restoring the Buffer Pool State]: https://dev.mysql.com/doc/refman/{{vers}}/en/innodb-preload-buffer-pool.html \ No newline at end of file +Find the information on how to save and restore the buffer pool dump in [Saving and Restoring the Buffer Pool State :octicons-link-external-16:](https://dev.mysql.com/doc/refman/{{vers}}/en/innodb-preload-buffer-pool.html). diff --git a/docs/make-backup-in-replication-env.md b/docs/make-backup-in-replication-env.md index 5bf6718fb..9d2443253 100644 --- a/docs/make-backup-in-replication-env.md +++ b/docs/make-backup-in-replication-env.md @@ -34,7 +34,4 @@ Using this option is always recommended when taking backups from a replica serve !!! warning Make sure your replica is a true replica of the source before using it as a - source for backup. A good tool to validate a replica is [pt-table-checksum]. - -[pt-table-checksum]: https://docs.percona.com/percona-toolkit/pt-table-checksum.html - + source for backup. A good tool to validate a replica is [pt-table-checksum :octicons-link-external-16:](https://docs.percona.com/percona-toolkit/pt-table-checksum.html). diff --git a/docs/page-tracking.md b/docs/page-tracking.md index 66f9afb84..f02b722b1 100644 --- a/docs/page-tracking.md +++ b/docs/page-tracking.md @@ -7,6 +7,8 @@ pages. This operation removes the need to scan the pages in the database. If the majority of pages have not been modified, the page tracking feature can improve the speed of incremental backups. +Run the following commands as root or use the sudo command. + ## Install the component To start using the page tracking functionality, do the following: @@ -14,14 +16,14 @@ To start using the page tracking functionality, do the following: 1. Install the `mysqlbackup` component and enable it on the server: - ```{.bash data-prompt="$"} - $ INSTALL COMPONENT "file://component_mysqlbackup"; + ```shell + INSTALL COMPONENT "file://component_mysqlbackup"; ``` 2. Check whether the `mysqlbackup` component is installed successfully: - ```{.bash data-prompt="$"} - $ SELECT COUNT(1) FROM mysql.component WHERE component_urn='file://component_mysqlbackup'; + ```shell + SELECT COUNT(1) FROM mysql.component WHERE component_urn='file://component_mysqlbackup'; ``` ## Use page tracking @@ -41,14 +43,14 @@ The examples of creating full and incremental backups using the `--page-tracking === "Full backup" - ```{.bash data-prompt="$"} - $ xtrabackup --backup --target-dir=$FULL_BACK --page-tracking + ```shell + xtrabackup --backup --target-dir=$FULL_BACK --page-tracking ``` === "Incremental backup" - ```{.bash data-prompt="$"} - $ xtrabackup --backup --target-dir=$INC_BACKUP + ```shell + xtrabackup --backup --target-dir=$INC_BACKUP --incremental-basedir=$FULL_BACKUP --page-tracking ``` @@ -71,8 +73,8 @@ Enable page tracking before creating the first backup to avoid this delay. This After the mysqlbackup component is loaded and active on the server, you can start page tracking manually with the following option: -```{.bash data-prompt="$"} -$ SELECT mysqlbackup_page_track_set(true); +```shell +SELECT mysqlbackup_page_track_set(true); ``` ## Check the LSN value @@ -80,16 +82,16 @@ $ SELECT mysqlbackup_page_track_set(true); Check the LSN value starting from which changed pages are tracked with the following option: -```{.bash data-prompt="$"} -$ SELECT mysqlbackup_page_track_get_start_lsn(); +```shell +SELECT mysqlbackup_page_track_get_start_lsn(); ``` ## Stop page tracking To stop page tracking, use the following command: -```{.bash data-prompt="$"} -$ SELECT mysqlbackup_page_track_set(false); +```shell +SELECT mysqlbackup_page_track_set(false); ``` ## Purge page tracking data @@ -103,12 +105,12 @@ grow until you stop the page tracking explicitly. If you purge the page tracking data, you should create a full backup afterward. To purge the page tracking data, do the following steps: -```{.bash data-prompt="$"} -$ SELECT mysqlbackup_page_track_set(false); -$ SELECT mysqlbackup_page_track_purge_up_to(9223372036854775807); +```shell +SELECT mysqlbackup_page_track_set(false); +SELECT mysqlbackup_page_track_purge_up_to(9223372036854775807); /* Specify the LSN up to which you want to purge page tracking data. / 9223372036854775807 is the highest possible LSN which purges all page tracking files.*/ -$ SELECT mysqlbackup_page_track_set(true); +SELECT mysqlbackup_page_track_set(true); ``` ## Known issue @@ -116,12 +118,12 @@ $ SELECT mysqlbackup_page_track_set(true); If the index is built in place using an exclusive algorithm and then is added to a table after the last LSN checkpoint, you may generate a bad incremental backup using page tracking. For more details -see [PS-8032](https://jira.percona.com/browse/PS-8032). +see [PS-8032 :octicons-link-external-16:](https://jira.percona.com/browse/PS-8032). ## Uninstall the mysqlbackup component To uninstall the mysqlbackup component, use the following statement: -```{.bash data-prompt="$"} -$ UNINSTALL COMPONENT "file://component_mysqlbackup" +```shell +UNINSTALL COMPONENT "file://component_mysqlbackup" ``` diff --git a/docs/permissions.md b/docs/permissions.md index 768dbfedf..e1b6ce6ed 100644 --- a/docs/permissions.md +++ b/docs/permissions.md @@ -11,8 +11,8 @@ There are many ways for checking the permission on a file or directory. For example, `ls -ls /path/to/file` or `stat /path/to/file | grep Access` will do the job: -```{.bash data-prompt="$"} -$ stat /etc/mysql | grep Access +```shell +stat /etc/mysql | grep Access ``` The result could look like this: @@ -29,8 +29,8 @@ As in this example, `my.cnf` is owned by `root` and not writable for anyone else. Assuming that you do not have `root`‘s password, you can check what permissions you have on these types of files with `sudo -l`: -```{.bash data-prompt="$"} -$ sudo -l +```shell +sudo -l ``` The results could look like this: diff --git a/docs/point-in-time-recovery.md b/docs/point-in-time-recovery.md index e069bf098..56b029eaa 100644 --- a/docs/point-in-time-recovery.md +++ b/docs/point-in-time-recovery.md @@ -8,9 +8,11 @@ a point in the past. You need a full datadir as a base, and then you can apply a series of operations from the binary log to make the data match what it was at the point in time you want. -```{.bash data-prompt="$"} -$ xtrabackup --backup --target-dir=/path/to/backup -$ xtrabackup --prepare --target-dir=/path/to/backup +Run the following commands as root or use the sudo command. + +```shell +xtrabackup --backup --target-dir=/path/to/backup +xtrabackup --prepare --target-dir=/path/to/backup ``` For more details on these procedures, see Creating a backup and Preparing a backup. @@ -22,8 +24,8 @@ point where the snapshot was taken. To find out what is the situation of binary logging in the server, execute the following queries: -```{.bash data-prompt="mysql>"} -mysql> SHOW BINARY LOGS; +```sql +SHOW BINARY LOGS; ``` ??? example "Expected output" @@ -41,8 +43,8 @@ mysql> SHOW BINARY LOGS; and -```{.bash data-prompt="mysql>"} -mysql> SHOW MASTER STATUS; +```sql +SHOW MASTER STATUS; ``` ??? example "Expected output" @@ -64,8 +66,8 @@ position within it. Those files are stored usually in the datadir To find out the position of the snapshot taken, see the `xtrabackup_binlog_info` at the backup’s directory: -```{.bash data-prompt="$"} -$ cat /path/to/backup/xtrabackup_binlog_info +```shell +cat /path/to/backup/xtrabackup_binlog_info ``` ??? example "Expected output" @@ -78,8 +80,8 @@ This will tell you which file was used at moment of the backup for the binary log and its position. That position will be the effective one when you restore the backup: -```{.bash data-prompt="$"} -$ xtrabackup --copy-back --target-dir=/path/to/backup +```shell +xtrabackup --copy-back --target-dir=/path/to/backup ``` As the restoration will not affect the binary log files (you may need to adjust @@ -87,8 +89,8 @@ file permissions, see Restoring a Backup), the next step is extracting the queries from the binary log with mysqlbinlog starting from the position of the snapshot and redirecting it to a file -```{.bash data-prompt="$"} -$ mysqlbinlog /path/to/datadir/mysql-bin.000003 /path/to/datadir/mysql-bin.000004 \ +```shell +mysqlbinlog /path/to/datadir/mysql-bin.000003 /path/to/datadir/mysql-bin.000004 \ --start-position=57 > mybinlog.sql ``` @@ -99,8 +101,8 @@ Inspect the file with the queries to determine which position or date corresponds to the point-in-time wanted. Once determined, pipe it to the server. Assuming the point is `11-12-25 01:00:00`: -```{.bash data-prompt="$"} -$ mysqlbinlog /path/to/datadir/mysql-bin.000003 /path/to/datadir/mysql-bin.000004 \ +```shell +mysqlbinlog /path/to/datadir/mysql-bin.000003 /path/to/datadir/mysql-bin.000004 \ --start-position=57 --stop-datetime="11-12-25 01:00:00" | mysql -u root -p ``` diff --git a/docs/prepare-compressed-backup.md b/docs/prepare-compressed-backup.md index d96d0648c..dae0e07af 100644 --- a/docs/prepare-compressed-backup.md +++ b/docs/prepare-compressed-backup.md @@ -1,6 +1,6 @@ # Decompress and prepare a backup -Before you can prepare the backup you need to decompress all the files. +Before you can prepare the backup you need to decompress all the files. Run the following commands as root or use the sudo command. ## Decompress a backup @@ -10,34 +10,34 @@ Before you can prepare the backup you need to decompress all the files. === "Install the `lz4` package" - ```{.bash data-prompt="$"} - $ sudo apt install lz4 + ```shell + sudo apt install lz4 ``` === "Install the `zstd` package" - ```{.bash data-prompt="$"} - $ sudo apt install zstd + ```shell + sudo apt install zstd ``` `Install on YUM systems` === "Install the `lz4` package" - ```{.bash data-prompt="$"} - $ sudo yum install lz4 + ```shell + sudo yum install lz4 ``` === "Install the `zstd` package" - ```{.bash data-prompt="$"} - $ sudo yum install zstd + ```shell + sudo yum install zstd ``` * Use the `--decompress` option to decompress the backup. - ```{.bash data-prompt="$"} - $ xtrabackup --decompress --target-dir=/data/compressed/ + ```shell + xtrabackup --decompress --target-dir=/data/compressed/ ``` !!! note @@ -50,8 +50,8 @@ Before you can prepare the backup you need to decompress all the files. When the files are decompressed you can prepare the backup with the `--prepare` option. -```{.bash data-prompt="$"} -$ xtrabackup --prepare --target-dir=/data/compressed/ +```shell +xtrabackup --prepare --target-dir=/data/compressed/ ``` ??? example "Confirmation message" diff --git a/docs/prepare-full-backup.md b/docs/prepare-full-backup.md index d622fee0b..cb6d6a322 100644 --- a/docs/prepare-full-backup.md +++ b/docs/prepare-full-backup.md @@ -14,8 +14,8 @@ During the prepare operation, xtrabackup boots up a kind of modified embedded In The prepare step uses this “embedded InnoDB” to perform crash recovery on the copied data files, using the copied log file. The `prepare` step is very simple to use: you simply run xtrabackup with the `--prepare` option and tell it which directory to prepare, for example, to prepare the previously taken backup run: -```{.bash data-prompt="$"} -$ xtrabackup --prepare --target-dir=/data/backups/ +```shell +xtrabackup --prepare --target-dir=/data/backups/ ``` When this finishes, you should see an `InnoDB shutdown` with a message such as the following, where again the value of LSN will depend on your system: diff --git a/docs/prepare-incremental-backup.md b/docs/prepare-incremental-backup.md index e2f8fa29b..4c013d901 100644 --- a/docs/prepare-incremental-backup.md +++ b/docs/prepare-incremental-backup.md @@ -20,7 +20,7 @@ To prepare the base backup, you need to run `--prepare` as usual, but prevent the rollback phase: ```shell -$ xtrabackup --prepare --apply-log-only --target-dir=/data/backups/base +xtrabackup --prepare --apply-log-only --target-dir=/data/backups/base ``` The log sequence number should match the `to_lsn` of the base backup The output should end with text similar to the following: @@ -39,7 +39,7 @@ The log sequence number should match the `to_lsn` of the base backup The output To apply the first incremental backup to the full backup, run the following command: ```shell -$ xtrabackup --prepare --apply-log-only --target-dir=/data/backups/base \ +xtrabackup --prepare --apply-log-only --target-dir=/data/backups/base \ --incremental-dir=/data/backups/inc1 ``` @@ -82,7 +82,7 @@ For incremental backups with many InnoDB Data (IBD) files, you can significantly An example command with the `--parallel` option: ```shell -$ xtrabackup --prepare --parallel=4 --apply-log-only --target-dir=/data/backups/base \ +xtrabackup --prepare --parallel=4 --apply-log-only --target-dir=/data/backups/base \ --incremental-dir=/data/backups/inc1 ``` @@ -94,14 +94,14 @@ Preparing the second incremental backup is a similar process: apply the deltas to the (modified) base backup, and you will roll the base backup's data forward in time to the point of the second incremental backup: ```shell -$ xtrabackup --prepare --target-dir=/data/backups/base \ +xtrabackup --prepare --target-dir=/data/backups/base \ --incremental-dir=/data/backups/inc2 ``` You can also use the `--parallel` option here to speed up the process: ```shell -$ xtrabackup --prepare --parallel=4 --target-dir=/data/backups/base \ +xtrabackup --prepare --parallel=4 --target-dir=/data/backups/base \ --incremental-dir=/data/backups/inc2 ``` diff --git a/docs/prepare-individual-partitions-backup.md b/docs/prepare-individual-partitions-backup.md index 135dc85d3..250c58edf 100644 --- a/docs/prepare-individual-partitions-backup.md +++ b/docs/prepare-individual-partitions-backup.md @@ -3,8 +3,8 @@ For preparing partial backups, the procedure is analogous to restoring individual tables. Apply the logs and use xtrabackup `--export`: -```{.bash data-prompt="$"} -$ xtrabackup --apply-log --export /mnt/backup/2012-08-28_10-29-09 +```shell +xtrabackup --apply-log --export /mnt/backup/2012-08-28_10-29-09 ``` You may see warnings in the output about tables that do not exist. This happens diff --git a/docs/prepare-partial-backup.md b/docs/prepare-partial-backup.md index c65f8d43b..bbc66f7b9 100644 --- a/docs/prepare-partial-backup.md +++ b/docs/prepare-partial-backup.md @@ -7,8 +7,8 @@ The procedure is analogous to restoring individual tables: apply the logs and use the `--export` option: -```{.bash data-prompt="$"} -$ xtrabackup --prepare --export --target-dir=/path/to/partial/backup +```shell +xtrabackup --prepare --export --target-dir=/path/to/partial/backup ``` When you use the `--prepare` option on a partial backup, you diff --git a/docs/privileges.md b/docs/privileges.md index d0a5fcc50..27236ecfc 100644 --- a/docs/privileges.md +++ b/docs/privileges.md @@ -27,11 +27,13 @@ performed - and the database user has adequate privileges. ## Connect to the server +Run the following commands as root or use the sudo command. + The database user used to connect to the server and its password are specified by the `--user` and `--password` option: -```{.bash data-prompt="$"} -$ xtrabackup --user=DVADER --password=14MY0URF4TH3R --backup \ +```bash +xtrabackup --user=DVADER --password=14MY0URF4TH3R --backup \ --target-dir=/data/bkps/ ``` @@ -99,52 +101,47 @@ PERCONA_SCHEMA.xtrabackup_history table, to look up the `innodb_to_lsn` values in the PERCONA_SCHEMA.xtrabackup_history table. -* `SELECT` privilege on the [keyring_component_status table] to view the attributes and status of the installed keyring component when in use. +* `SELECT` privilege on the [keyring_component_status table :octicons-link-external-16:](https://dev.mysql.com/doc/refman/{{vers}}/en/performance-schema-keyring-component-status-table.html) to view the attributes and status of the installed keyring component when in use. -* `SELECT` privilege on the [replication_group_members table] to validate if the instance is part of group replication cluster. +* `SELECT` privilege on the [replication_group_members table :octicons-link-external-16:](https://dev.mysql.com/doc/refman/{{vers}}/en/performance-schema-replication-group-members-table.html) to validate if the instance is part of group replication cluster. A SQL example of creating a database user with the minimum privileges required to take full backups would be: -```{.bash data-prompt="mysql>"} -mysql> CREATE USER 'bkpuser'@'localhost' IDENTIFIED BY 's3cr%T'; -mysql> GRANT BACKUP_ADMIN, PROCESS, RELOAD, LOCK TABLES, REPLICATION CLIENT ON *.* TO 'bkpuser'@'localhost'; -mysql> GRANT SELECT ON performance_schema.log_status TO 'bkpuser'@'localhost'; -mysql> GRANT SELECT ON performance_schema.keyring_component_status TO bkpuser@'localhost'; -mysql> GRANT SELECT ON performance_schema.replication_group_members TO bkpuser@'localhost'; -mysql> FLUSH PRIVILEGES; +```sql +CREATE USER 'bkpuser'@'localhost' IDENTIFIED BY 's3cr%T'; +GRANT BACKUP_ADMIN, PROCESS, RELOAD, LOCK TABLES, REPLICATION CLIENT ON *.* TO 'bkpuser'@'localhost'; +GRANT SELECT ON performance_schema.log_status TO 'bkpuser'@'localhost'; +GRANT SELECT ON performance_schema.keyring_component_status TO bkpuser@'localhost'; +GRANT SELECT ON performance_schema.replication_group_members TO bkpuser@'localhost'; +FLUSH PRIVILEGES; ``` ### Query the privileges To query the privileges that your database user has been granted at the console of the server execute: -```{.bash data-prompt="mysql>"} -mysql> SHOW GRANTS; +```sql +SHOW GRANTS; ``` or for a particular user with: -```{.bash data-prompt="mysql>"} -mysql> SHOW GRANTS FOR 'db-user'@'host'; +```sql +SHOW GRANTS FOR 'db-user'@'host'; ``` It will display the privileges using the same format as for -the [GRANT statement]. +the [GRANT statement :octicons-link-external-16:](https://dev.mysql.com/doc/refman/{{vers}}/en/show-grants.html). Note that privileges may vary across versions of the server. To list the exact list of privileges that your server support (and a brief description of them) execute: -```{.bash data-prompt="mysql>"} -mysql> SHOW PRIVILEGES; +```sql +SHOW PRIVILEGES; ``` !!! admonition "See also" [Permissions needed](permissions.md) -[keyring_component_status table]: https://dev.mysql.com/doc/refman/{{vers}}/en/performance-schema-keyring-component-status-table.html - -[replication_group_members table]: https://dev.mysql.com/doc/refman/{{vers}}/en/performance-schema-replication-group-members-table.html - -[GRANT statement]: https://dev.mysql.com/doc/refman/{{vers}}/en/show-grants.html \ No newline at end of file diff --git a/mkdocs-base.yml b/mkdocs-base.yml index cd68bc1d9..67df67c0d 100644 --- a/mkdocs-base.yml +++ b/mkdocs-base.yml @@ -117,6 +117,7 @@ markdown_extensions: plugins: search: separator: '[\s\-,:!=\[\]()"`/]+|\.(?!\d)|&[lg]t;|(?!\b)(?=[A-Z][a-z])' + open-in-new-tab: {} git-revision-date-localized: enable_creation_date: true enabled: !ENV [ENABLED_GIT_REVISION_DATE, True]