• Home
  • Archive
  • Tools
  • Contact Us

The Customize Windows

Technology Journal

  • Cloud Computing
  • Computer
  • Digital Photography
  • Windows 7
  • Archive
  • Cloud Computing
  • Virtualization
  • Computer and Internet
  • Digital Photography
  • Android
  • Sysadmin
  • Electronics
  • Big Data
  • Virtualization
  • Downloads
  • Web Development
  • Apple
  • Android
Advertisement
You are here: Home » How to Install Percona XtraBackup on Ubuntu Server

By Abhishek Ghosh October 6, 2019 3:36 pm Updated on October 6, 2019

How to Install Percona XtraBackup on Ubuntu Server

Advertisement

To follow this guide, ideally you should have Percona MySQL installed and configured in the way we described in our linked guide. But Percona XtraBackup supports all MySQL flavours like Percona Server, MariaDB, and the original MySQL from Oracle. You must apply the fixes to resolve problems such as Debian distro-specific automatic restart issues. If the server you are going to work is of live website, then first you should take a manual backup and test whether it is working.

 

Why We Need Percona XtraBackup?

 

mysqldump is the commonly used trusted backup tool which comes with the MySQL package. It is a multi-threaded process for backup and single-threaded for restore. It is the best tool if databases are less than 20GB and you are manually working. In this way, the restore process will take higher time. Percona XtraBackup is like super-charged mysqldump which supports incremental backup. It is a good tool to backup >20GB databases. It is fast, supports compression, encryption, a suitable tool for master/slave setup.

How to Install Percona XtraBackup on Ubuntu Server

 

Steps to Install Percona XtraBackup

 

First, you need to create a backup-user of MySQL. Run these commands :

Advertisement

---

Vim
1
2
3
4
5
6
7
#
mysql -u root -p
CREATE USER 'backupuser'@'localhost' IDENTIFIED BY 'use-own-password';
GRANT RELOAD, LOCK TABLES, PROCESS, REPLICATION CLIENT ON *.* TO 'backupuser'@'localhost';
FLUSH PRIVILEGES;
exit
#

Create a new directory to store the MySQL backup files:

Vim
1
2
3
4
5
6
7
#
mkdir -p /data/backups/mysql/
## optional steps
touch /data/backups/mysql/README.md
echo "I have manually created this directory for Percona XtraBackup" > /data/backups/mysql/README.md
cat
#

Now, fetch the repository packages from Percona’s website:

Vim
1
2
3
4
5
#
wget https://repo.percona.com/apt/percona-release_latest.$(lsb_release -sc)_all.deb
sudo dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb
 
#

Once you install the package, the Percona repositories should be added in the /etc/apt/sources.list.d/percona-release.list file. Now, install it :

Vim
1
2
3
4
5
#
sudo apt-get update
sudo apt-get install percona-xtrabackup-24
 
#

For Percona’s software, we mentioned in our previous guides the need to pin the selected packages to avoid the upgrades from the distribution repositories. Essentially, you need to create a new file named /etc/apt/preferences.d/00percona.pref :

Vim
1
2
3
#
nano /etc/apt/preferences.d/00percona.pref
#

… and add the following lines in it:

Vim
1
2
3
Package: *
Pin: release o=Percona Development Team
Pin-Priority: 1001

You can take backup using this format of command :

Vim
1
2
3
#
innobackupex --user=backupuser  --password=use-own-password--no-timestamp /data/backups/first_backup
#

After creating the backup, the data is not ready to be restored. We need the prepare for restoration :

Vim
1
2
3
#
innobackupex --apply-log /data/backups/first_backup
#

Wait still the process is completed. The backup is now ready to be restored on the same server or on the another server. Below is how you’ll restore backup in case of MariaDB :

Vim
1
2
3
4
5
6
7
8
9
#
systemctl stop mysql
mkdir ~/mysql_old/
mv /var/lib/mysql/* ~/mysql_old/
innobackupex --copy-back /data/backups/my_backup
# wait for 'innobackupex: completed OK' message
chown -R mysql:mysql /var/lib/mysql
systemctl start mysql
#

Percona has detailed documentation :

Vim
1
2
3
#
https://www.percona.com/doc/percona-xtrabackup/2.3/index.html
#

There are various user created bash scripts available on GitHub to automate the process. Here is an example of bash script on my GitHub repo to automate the full incremental backup.

Tagged With innodbbackupex restore backup to new server , install xtrabackup 2 4 on ubuntu , install xtrabackup manualy

This Article Has Been Shared 364 Times!

Facebook Twitter Pinterest
Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Orthopaedic Surgeon, Author and Blogger. You can keep touch with him on Twitter - @AbhishekCTRL.

Here’s what we’ve got for you which might like :

Articles Related to How to Install Percona XtraBackup on Ubuntu Server

  • WordPress XML-RPC Attack & Fake PHP5-FPM Error

    WordPress XML-RPC Attack Can Bring DDoS Resulting in Random 502 PHP5-FPM Errors on Nginx Server or Can Make the Database Down. Here is Fix.

  • Install Nginx HTTP/2 With ALPN on Ubuntu 14.04 From ondrej/nginx PPA

    In our previous guide, we have shown how to easily upgrade Nginx on Ubuntu 14.04 for HTTP/2 support. The required changes in the /etc/nginx/sites-enabled/default file, /etc/nginx/nginx.conf file and limitations of that way of installation has been discussed on this article. In this guide, we will show how to install Nginx HTTP/2 with ALPN on Ubuntu […]

  • Steps to Install NextCloud on Cloud Server (Nginx, Redis Cache)

    Here Are the Steps to Install NextCloud on Cloud Server With Nginx Server, Redis Cache, 2 FA, HTTPS. NextCloud is Like Your Own Dropbox.

  • Configure Apache With Fail2Ban on Ubuntu 18.04

    Here is How To Configure Apache With Fail2Ban on Ubuntu 18.04 to block more types of malicious attempts towards server to create a practical firewall.

  • How To Install Apache Phoenix (SQL on HBase)

    We talked about Apache Phoenix in our previous guides and articles such as How To Install Apache HBase and List of Apache Projects For Big Data. Apache Phoenix is a massively parallel, relational database engine supporting OLTP for Hadoop using Apache HBase as store. Phoenix provides a JDBC driver that cleverly hides the noSQL store […]

Additionally, performing a search on this website can help you. Also, we have YouTube Videos.

Take The Conversation Further ...

We'd love to know your thoughts on this article.
Meet the Author over on Twitter to join the conversation right now!

If you want to Advertise on our Article or want a Sponsored Article, you are invited to Contact us.

Contact Us

Subscribe To Our Free Newsletter

You can subscribe to our Free Once a Day, Regular Newsletter by clicking the subscribe button below.

Click To Subscribe

Please Confirm the Subscription When Approval Email Will Arrive in Your Email Inbox as Second Step.

Search this website…

 

Popular Articles

Our Homepage is best place to find popular articles!

Here Are Some Good to Read Articles :

  • Cloud Computing Service Models
  • What is Cloud Computing?
  • Cloud Computing and Social Networks in Mobile Space
  • ARM Processor Architecture
  • What Camera Mode to Choose
  • Indispensable MySQL queries for custom fields in WordPress
  • Windows 7 Speech Recognition Scripting Related Tutorials

Social Networks

  • Pinterest (21K Followers)
  • Twitter (5.3k Followers)
  • Facebook (5.7k Followers)
  • LinkedIn (3.7k Followers)
  • YouTube (1.3k Followers)
  • GitHub (Repository)
  • GitHub (Gists)
Looking to publish sponsored article on our website?

Contact us

Recent Posts

  • What You Need to Know About the Microservices March 4, 2021
  • Fix Missing/Bad FileProvider for Freshchat (Android error code 354) March 3, 2021
  • Basics of Data Protection on the Internet March 2, 2021
  • What is Standard Software February 28, 2021
  • WordPress Link to text Fragment February 27, 2021

 

About This Article

Cite this article as: Abhishek Ghosh, "How to Install Percona XtraBackup on Ubuntu Server," in The Customize Windows, October 6, 2019, March 4, 2021, https://thecustomizewindows.com/2019/10/how-to-install-percona-xtrabackup-on-ubuntu-server/.

Source:The Customize Windows, JiMA.in

 

This website uses cookies. If you do not want to allow us to use cookies and/or non-personalized Ads, kindly clear browser cookies after closing this webpage.

Read Cookie Policy.

PC users can consult Corrine Chorney for Security.

Want to know more about us? Read Notability and Mentions & Our Setup.

Copyright © 2021 - The Customize Windows | dESIGNed by The Customize Windows

Copyright  · Privacy Policy  · Advertising Policy  · Terms of Service  · Refund Policy