databacker / mysql-backup

image to enable automated backups of mysql databases in containers
648 stars 184 forks source link

How to create a backup copy of not only data and tables, but also functions and procedures? #289

Open GMELUM opened 7 months ago

GMELUM commented 7 months ago
  mysql-master-backup:
    image: databack/mysql-backup
    container_name: mysql-backup
    restart: always
    environment:
      SINGLE_DATABASE: true
      DB_SERVER: mysql
      DB_PORT: 3306
      DB_USER: root
      DB_PASS: $MYSQL_PASSWORD
      DB_NAMES: $MYSQL_DATABASE
      DB_DUMP_FREQ: $INTERVAL
      DB_DUMP_TARGET:  "s3://$AWS_BUCKET/dumps/$MYSQL_DATABASE"
      AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
      AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
      AWS_REGION: $AWS_REGION
      AWS_ENDPOINT_URL: $AWS_ENDPOINT
      COMPRESSION: bzip2
    command: dump
deitch commented 7 months ago

Honestly, had not thought about it until now, mainly because no one asked. But it is a good thing to add. The legacy version did mysqldump without --routines. The more modern version would need the right templates added, but that shouldn't be too radically difficult.

Are you interesting in trying your hand at a PR?