Looks like no deduplication after copying repo

The plan is to move a repo from a Google Cloud Storage bucket to a local directory.

Here is what I did:

  1. Set environment for the remote repo (password hidden):

    $ export GOOGLE_PROJECT_ID=wiwi-backup
    $ export GOOGLE_APPLICATION_CREDENTIALS=$HOME/.config/gs-secret-restic-key.json
    $ export RESTIC_PASSWORD=…
    $ export RESTIC_REPOSITORY=gs:t550:/
    
  2. Initialized the local repo using the chunker parameters from the remote repo:

    $ restic -r ~/.restic_repo init --from-repo gs:t550:/ --copy-chunker-params
    
  3. Copied all snapshots from the remote repo:

    $ restic -r ~/.restic_repo copy --from-repo gs:t550:
    
  4. Checked the local repo with restic check and restic stats, and all looked good.

  5. From a Systemd service, ran the backup using the same parameters as before, but with the local repo instead of the remote repo (password hidden):

    [Unit]
    Description=Run Restic Backup
    
    [Service]
    Environment=RESTIC_REPOSITORY=/home/wiwi/.restic_repo
    Environment=RESTIC_PASSWORD=…
    ExecStart=restic backup --verbose --exclude-caches backup %h
    
    [Install]
    WantedBy=default.target
    

In the last step, I realized that it generated a lot of data. In fact the local disk overflowed. This is unexpected as only very little had changed of the data in the directory being backed up. Apparently, despite initiating the local repo with the chunker parameters from the remote repo, deduplication didn’t happen.

The Restic version hasn’t been changed between the last backup to the remote repo and the backup to the local repo:

$ restic version
restic 0.18.0 compiled with go1.24.1 on linux/amd64

Is there anything I did wrong?

I realize the backup destination is part of the backup source. So the backup backs itself up into the backup.

This should not be.

I will fix it later.

1 Like