IT Blog

BackupPC

How to upgrade BackupPC v3.3.1 to v4.3.0 in Centos 6

BackupPC when installed from the centos Repo and using my older post is quite an old version – a lot of updates have happened on github since it moved away from Sourceforge:

What we aim to accomplish:

  1. Upgrade of BackupPC
  2. Finishing touches (edits)
  3. Add some CSS to make it look nice

Firstly shutdown services backuppc and httpd:

sudo service backuppc stop
sudo service httpd stop

We need to compile a few things so we will need the Development tools installing:

sudo yum groupinstall "development tools" -y
sudo yum install perl-suidperl -y

Now we need to install a few things on the server before upgrades:

Installing Backuppc XS; According to github  “BackupPC::XS implements various BackupPC functions in a perl-callable module.”

cd /tmp/
wget https://github.com/backuppc/backuppc-xs/archive/master.zip
unzip master.zip
cd backuppc-xs-master/
perl Makefile.PL
make
make test
make install

I got an error on “make test” when writing this up but the install was fine.

We also have to install rsync-bpc which is a modified version of rsync for backuppc, his is a bit tricky as I faced some issues with compiling rsync-bpc originally.

The issues I had for anyone googling this was this:

syscall.c:341: error: ‘FALLOC_FL_PUNCH_HOLE’ undeclared (first use in this function)

which came up when I wanted to make it

Now on both my Development BackupPC server and Live I installed “yum install libhugetlbfs” but I don’t know if this was needed or not? Just leaving it here anyway.

This is what I had to do to install rsync_bpc:

Uncomment all lines in this file so that we can compile everything correctly:

vim /usr/include/linux/falloc.h

Now it’s time to clone the git project for rsync-bpc

git clone https://github.com/backuppc/rsync-bpc.git

Use a different branch as the latest one has not been fully tested and has some issues with Centos 6 compiling

cd rsync-bpc
git checkout 3.0.9
./configure
make
make install

Now your rsync-bpc bin file should be in /usr/local/bin/rsync_bpc

We need this location later to enter it into the server settings later or else rsync backups wont work:

For Later to enter it into rsync path (if it’s not already there):

Now we download backuppc v4.3.0 and install it:

cd /tmp/
wget https://github.com/backuppc/backuppc/releases/download/4.3.0/BackupPC-4.3.0.tar.gz
tar zxf BackupPC-4.3.0.tar.gz
cd BackupPC-4.3.0
perl configure.pl

It will start to ask you questions, just press enter if they are correct (I press Enter on them all)

This is the log it finishes with:

--> Do you want to continue? [y]? 
Created /usr/share/BackupPC/share
Created /usr/share/BackupPC/share/doc
Created /usr/share/BackupPC/share/doc/BackupPC
Created /usr/share/BackupPC/lib/Net
Created /usr/share/BackupPC/lib/Net/FTP
Created /var/lib/BackupPC/
Created /var/lib/BackupPC//pool
Created /var/lib/BackupPC//cpool
Created /var/lib/BackupPC//pc
Created /etc/BackupPC
Created /var/log/BackupPC
Created /var/run/BackupPC
Installing binaries in /usr/share/BackupPC/bin
Installing library in /usr/share/BackupPC/lib
Installing images in /usr/share/BackupPC/html/
Making systemd and init.d scripts
Making Apache configuration file for suid-perl
Installing docs in /usr/share/BackupPC/share/doc/BackupPC
Installing cgi script BackupPC_Admin in /usr/share/BackupPC/sbin/
Installing config.pl and hosts in /etc/BackupPC
Making backup copy of /etc/BackupPC/config.pl -> /etc/BackupPC/config.pl.pre-4.3.0

Now we can start the httpd and backuppc service:

service backuppc start
Starting BackupPC: [ OK ]


service httpd start
Starting httpd: [ OK ]

Lets go to the front-end and verify the version:

Great stuff!

Now there was one thing I forgot to do in the last installation tutorial and that was to configure the path which has mail, mailx or sendmail in it.

This is so BackupPC can send emails on failures etc.

Back to the server to find out where mail is:

which mail

in my case  it is in “/bin/mail”

so now go to the Server config page on the front-end and add this in:

Press Save!

Edit: 03/04/2019

I found that my backups were not performing in full. It turned out to be that BackupPC have changed the way we perform the “Sudo” when grabing the files. So any files owned by root or anotehr user were not being backed up. The fix was simple and this is also needed as part of the upgrade:

Under “Server”, Click on “Edit config” > Xfer >

Where it says RsyncClientPath /usr/bin/rsync

add sudo just before the path so it becomes like so:

sudo /usr/bin/rsync

That’s done now. Enjoy!