Does anyone know if you can encrypt the database backup using AutoMYSQLBackup on Ubuntu 14.04?

March 13, 2018 2.2k views
MySQL Ubuntu

Does anyone know if you can encrypt the database backup using AutoMYSQLBackup on Ubuntu 14.04? I've tried adding the parameter to encrypt but it doesn't work.

If not do you have a recommendation for how to do it?

Any help is much appreciated.

10 comments
  • I've tried adding the parameter to encrypt but it doesn't work.

    Can you clarify which part is not working?

    Also, what guide are you following?

  • Thanks for the questions.

    I've tried adding the following parameters to the /etc/default/automysqlbackup config file:

    #Do you wish to encrypt your backups using openssl?
    CONFIG_encrypt='no'
    
    #Choose a password to encrypt the backups.
    CONFIG_encrypt_password='password0123'
    

    When I do nothing changes in the backup files when I manually run "automysqlbackup"

    Here's a link to the guide I was using:

    https://www.tecmint.com/mysql-mariadb-postgresql-database-backup-using-automysqlbackup-autopostgresqlbackup/

  • I also tried modifying the config file like so:

    #Do you wish to encrypt your backups using openssl?
    encrypt='no'
    
    #Choose a password to encrypt the backups.
    encrypt_password='password0123'
    

    Still didn't work

  • Sorry if this is a silly question, but.

    1. Did you uncomment those two lines? (i.e. remove the trailing # symbol).
    2. Did you change CONFIG_encrypt='no' to CONFIG_encrypt='yes'?

    Those two lines should look something like this

    # Do you wish to encrypt your backups using openssl?
    CONFIG_encrypt='yes'
    # Choose a password to encrypt the backups.
    CONFIG_encrypt_password='$YOUR_PASSWORD'
    

    replacing $YOUR_PASSWORD with whatever password you want to use.

  • Yes I did it as you posted, which setting the values to

    # Do you wish to encrypt your backups using openssl?
    CONFIG_encrypt='yes'
    # Choose a password to encrypt the backups.
    CONFIG_encrypt_password='$YOUR_PASSWORD'
    

    That said I had to add those parameters to the config file. They were not there by default to only be uncommented

  • Show 5 more comments
2 Answers

Thanks. I think that is the problem. I just installed this on Ubuntu 14.04 and it looks like it is using version 2.6. However in the tutorial they are installing version 3.0 automysqlbackup-v3.0_rc6.tar.gz.

I also checked Ubuntu 16.04 and 17.10 and they are all using this old version. It is possible that this feature was not added until a later version.

In order to get this to work, I would uninstall the version that you installed with apt apt-get remove automysqlbackup and install this manually with the following steps.

mkdir /opt/automysqlbackup

cd /opt/automysqlbackup

wget http://ufpr.dl.sourceforge.net/project/automysqlbackup/AutoMySQLBackup/AutoMySQLBackup%20VER%203.0/automysqlbackup-v3.0_rc6.tar.gz

tar zxf automysqlbackup-v3.0_rc6.tar.gz

./install.sh

Once you have ran the install script, you should see the up to date file located in /etc/automysqlbackup/automysqlbackup.conf and be able to change the settings for encryption. They should look something like this:

# Do you wish to encrypt your backups using openssl?
CONFIG_encrypt='yes'
# Choose a password to encrypt the backups.
CONFIG_encrypt_password='$YOUR_PASSWORD'

Be sure to replace $YOUR_PASSWORD with whatever password you want to use.

  • Thanks a ton. That worked perfectly. One last question, is there a easy way to decrypt the file on Windows after I download it from the Linux server?

Have another answer? Share your knowledge.