Kopia, with additional features :)
Find a file
Snowy 1e5b0c1a1b
All checks were successful
/ deploy (push) Successful in 37s
Pull before building
2026-01-11 01:57:34 +08:00
.forgejo/workflows Pull before building 2026-01-11 01:57:34 +08:00
bin Added check for KOPIAPLUS_BACKUP_DIR 2024-11-09 16:53:04 +08:00
Dockerfile Initial commit :) 2024-09-07 15:44:07 +08:00
README.md Added README (#3) 2024-11-09 08:40:17 +00:00

KopiaPlus

Kopia is an incremental backup/restore tool. This fork extends it with a few features:

  • Access to the docker command within the container
  • Scripts to backup/restore named volumes in docker
  • Scripts to backup/restore databases running in docker

Usage

Given this docker-compose.yml file:

services:
    kopia:
        image: forgejo.umucat.day/snowy/kopiaplus
        environment:
            KOPIAPLUS_BACKUP_DIR: "${HOME}/Backups"
        volumes:
            - /var/run/docker.sock:/var/run/docker.sock
docker compose run --rm -it kopia backup_docker minecraft

Running the above command will backup the minecraft named volume to the ${HOME}/Backups directory on the host system.


Environment Variables

Backup

Name Default Description
KOPIAPLUS_BACKUP_DIR - Required, the absolute directory of where backups should be written to
KOPIAPLUS_BACKUP_PGUSER postgres The user used to access the postgres database

Restore

Name Default Description
KOPIAPLUS_RESTORE_DIR - Required, the absolute directory of where backups should be read from
KOPIAPLUS_RESTORE_PGUSER postgres The user used to access the postgres database

Scripts

Backup

backup_docker <volume_name...>
backup_mysql <container_name> <database_name...>
backup_postgres <container_name> <database_name...>

Restore

restore_docker <volume_name...>
restore_mysql <container_name> <database_name...>
restore_postgres <container_name> <database_name...>