Mysql Backup Taking up Space on Local Machine #530

Closed
opened 2022-05-09 20:15:25 +00:00 by HippieBeak · 3 comments

What I'm trying to do and why

I am trying to properly backup my MySQL (MariaDB) database without taking up space on my local machine.

Steps to reproduce (if a bug)

It's likely that my configuration file is just wrong, but I haven't been able to find anything online:

location:
    source_directories:
        - /var/lib/mysql
        - /etc/mysql

    one_file_system: true

    repositories:
        - Repository1
        - Repository2

    exclude_caches: true

storage:
    compression: auto,zstd
    archive_name_format: '{hostname}-{now}'
    ssh_command: ssh -i /root/.ssh/id_ed25519 -o VerifyHostKeyDNS=yes

retention:
    keep_daily: 1
    keep_weekly: 4
    keep_monthly: 12
    keep_yearly: 2
    prefix: '{hostname}-'

hooks:
    mysql_databases:
        - name: all
          hostname: hostname
          username: username
          password: password
consistency:
    checks:
        # uncomment to always do integrity checks. (takes long time for large repos)
        #- repository
        - disabled

    prefix: '{hostname}-'

Actual behavior (if a bug)

My database VM ran out of space a few nights ago. The MySQL dump to /root/.borgmatic/mysql_databases/ seems to be taking up space on my local machine rather than piping directly to the repository.

Expected behavior (if a bug)

I expect the MySQL dump to not take up space on my local machine, instead it should be piped/streamed directly to the repository.

Environment

borgmatic version: 1.5.1

borgmatic installation method: Ubuntu package & Python3/PIP

Borg version: borg 1.1.15

Python version: Python 3.8.10

Database version (if applicable): mysql Ver 15.1 Distrib 10.3.34-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2

operating system and version: Ubuntu 20.04.3 LTS

#### What I'm trying to do and why I am trying to properly backup my MySQL (MariaDB) database without taking up space on my local machine. #### Steps to reproduce (if a bug) It's likely that my configuration file is just wrong, but I haven't been able to find anything online: ``` location: source_directories: - /var/lib/mysql - /etc/mysql one_file_system: true repositories: - Repository1 - Repository2 exclude_caches: true storage: compression: auto,zstd archive_name_format: '{hostname}-{now}' ssh_command: ssh -i /root/.ssh/id_ed25519 -o VerifyHostKeyDNS=yes retention: keep_daily: 1 keep_weekly: 4 keep_monthly: 12 keep_yearly: 2 prefix: '{hostname}-' hooks: mysql_databases: - name: all hostname: hostname username: username password: password consistency: checks: # uncomment to always do integrity checks. (takes long time for large repos) #- repository - disabled prefix: '{hostname}-' ``` #### Actual behavior (if a bug) My database VM ran out of space a few nights ago. The MySQL dump to /root/.borgmatic/mysql_databases/ seems to be taking up space on my local machine rather than piping directly to the repository. #### Expected behavior (if a bug) I expect the MySQL dump to not take up space on my local machine, instead it should be piped/streamed directly to the repository. #### Environment **borgmatic version:** 1.5.1 **borgmatic installation method:** Ubuntu package & Python3/PIP **Borg version:** borg 1.1.15 **Python version:** Python 3.8.10 **Database version (if applicable):** mysql Ver 15.1 Distrib 10.3.34-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2 **operating system and version:** Ubuntu 20.04.3 LTS
HippieBeak changed title from Mysql Backup Taking up Space on Local Machine & Not Dumping Correctly to Mysql Backup Taking up Space on Local Machine 2022-05-09 20:21:53 +00:00
Owner

Thanks for filing this and providing the detailed info. The reason this isn't working is because the streaming database feature wasn't yet implemented in the version of borgmatic you're using! It was first introduced in borgmatic 1.5.3. So you'll need to upgrade borgmatic to take advantage of it. If you can, I recommend upgrading to the newest release (1.6.0 right now). The documentation mentions different ways of installing borgmatic that may help you get a newer version. (I'll also update the borgmatic documentation to mention the version requirement.)

Let me know if that works for you!

Thanks for filing this and providing the detailed info. The reason this isn't working is because the streaming database feature wasn't yet implemented in the version of borgmatic you're using! It was first introduced in borgmatic 1.5.3. So you'll need to upgrade borgmatic to take advantage of it. If you can, I recommend upgrading to the newest release (1.6.0 right now). The documentation mentions [different ways of installing borgmatic](https://torsion.org/borgmatic/docs/how-to/set-up-backups/) that may help you get a newer version. (I'll also update the borgmatic documentation to mention the version requirement.) Let me know if that works for you!
witten added the
question / support
label 2022-05-09 23:06:20 +00:00
Author

Thanks, upgrading to the newest release resolved the issue!

Thanks, upgrading to the newest release resolved the issue!
Owner

Awesome, glad to hear it!

Awesome, glad to hear it!
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: borgmatic-collective/borgmatic#530
No description provided.