Databases 5 min read

Installing Percona XtraBackup and Performing Full and Incremental Backups on CentOS

This guide walks through downloading and installing Percona XtraBackup on a CentOS server, then demonstrates how to create full backups, remove timestamps, inspect backup contents, and execute incremental backups with detailed command examples and explanations.

Practical DevOps Architecture
Practical DevOps Architecture
Practical DevOps Architecture
Installing Percona XtraBackup and Performing Full and Incremental Backups on CentOS

First, upload the XtraBackup RPM package to the server: rz percona-xtrabackup-24-2.4.4-1.el7.x86_64.rpm Download the EPEL repository configuration:

wget -O /etc/yum.repos.d/epel.repo https://mirrors.aliyun.com/repo/epel-7.repo

Install required dependencies:

yum -y install perl perl-devel libaio libaio-devel perl-Time-HiRes perl-DBD-MySQL

Download the Percona XtraBackup binary RPM:

wget https://www.percona.com/downloads/XtraBackup/Percona-XtraBackup-2.4.4/binary/redhat/7/x86_64/percona-xtrabackup-24-2.4.4-1.el7.x86_64.rpm

Install the package locally:

yum localinstall -y percona-xtrabackup-24-2.4.4-1.el7.x86_64.rpm

After installation, you can run the tools to verify they are available:

xtrabackup
innobackupex

Full backup

Create a backup directory and run a full backup without timestamps:

mkdir /backup
innobackupex --user=root --password=123 --no-timestamp /backup/full

List the backup files to confirm the result: ll /backup/full/ Inspect the checkpoint file for backup metadata: cat xtrabackup_checkpoints Sample output shows backup_type = full-backuped, from_lsn = 0, and to_lsn = 8417759.

Incremental backup

1. Perform another full backup (used as the base for incremental):

innobackupex --user=root --password=123 --no-timestamp /backup/full_$(date +%F)

2. Insert new data into MySQL to create changes: mysql -uroot -p123 Then inside MySQL:

use haha;
insert into haha values(1),(2),(3);

3. Run the incremental backup based on the previous full backup directory:

innobackupex --user=root --password=123 --no-timestamp --incremental --incremental-basedir=/backup/full_2020-12-23 /backup/inc1

Parameters: --incremental: enables incremental mode. --incremental-basedir: path to the previous backup used as the base.

4. Verify the backup checkpoints for both the full and incremental backups: cat /backup/full/xtrabackup_checkpoints Shows backup_type = full-prepared, from_lsn = 0, to_lsn = 8417759. cat /backup/inc1/xtrabackup_checkpoints Shows backup_type = incremental, from_lsn = 8417759, to_lsn = 8419281.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

databaseCentOSPercona XtraBackupIncremental Backupmysql backup
Practical DevOps Architecture
Written by

Practical DevOps Architecture

Hands‑on DevOps operations using Docker, K8s, Jenkins, and Ansible—empowering ops professionals to grow together through sharing, discussion, knowledge consolidation, and continuous improvement.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.