Community

Free, open-source Tar archive import

Free, open-source import of tar and tar.gz archives into encrypted, deduplicated snapshots, read in place without extraction, compared and exported as tar.

Tar archives, kept as one deduplicated history

A tar archive records a directory tree with its paths, permissions, owners and modification times. A nightly `tar czf` is one of the oldest backup routines there is, and every archive it produces is a full copy. Gzip compresses each archive as one stream, so two archives that differ by a single file share almost no bytes on disk.

Plakar opens the archive, decompresses it as it reads, and stores each entry as a file. Each archive becomes a dated, encrypted snapshot you can browse, compare, restore or export as a tarball again.

Overview

What the tar integration does

The tar integration imports a tar or tar.gz archive into an encrypted, deduplicated Plakar snapshot without extracting it to disk. Plakar reads the archive file on the machine where it runs and records every entry with its path, permissions, owner and modification time. It is built into the free, open-source plakar CLI, with tar:// for plain archives and tgz:// for gzip-compressed ones.

A path inside the archive keeps its place in the snapshot: srv/app/config.yml becomes /srv/app/config.yml. From there the snapshot behaves like any other Plakar snapshot. You list it, search it, compare it with the archive of the previous night, restore one directory from it, or turn it back into a tar file with plakar archive.

$ plakar at /var/backups create
$ plakar at /var/backups backup \
    -force-timestamp 2025-03-14T02:00:00Z \
    tgz:///mnt/nas/backup-20250314.tar.gz
a1f61c48: OK ✓ /srv
a1f61c48: OK ✓ /srv/app
a1f61c48: OK ✓ /srv/app/etc
a1f61c48: OK ✓ /srv/app/etc/nginx
a1f61c48: OK ✓ /srv/app/etc/nginx/nginx.conf
a1f61c48: OK ✓ /srv/app/uploads
a1f61c48: backup completed without errors in 41.3s
$ plakar at /var/backups ls
2025-03-14T02:00:00Z   a1f61c48    12 GiB       41s /
2025-03-13T02:00:00Z   c396e52a    12 GiB       39s /
$ 

Inside the archive

Why import tar archives into Plakar

tgz://

Gzip-compressed tarballs that still deduplicate

Plakar decompresses the archive while it reads it and splits each file into content-defined chunks. Two .tar.gz files of the same tree, compressed on different nights, share most of their files, and those files are stored once in the store.

0 bytes extracted

No extraction and no staging disk

The archive is read from start to end, one entry after the other, and each entry goes straight into the snapshot. A 200 GB tarball needs no 200 GB of scratch space to be imported.

mode · uid · gid · mtime

Tar entry metadata recorded with each file

Every entry keeps its mode, numeric owner and group, user and group names and modification time. Directories, symbolic links, device nodes and named pipes keep their type.

built in

Part of the plakar binary

The tar importer ships with the CLI. There is no package to add, and the same store can hold the imported archives next to the backups of servers, databases and buckets.

Migration

How to import old tar.gz backups into a deduplicated repository

A NAS holds three years of backup-YYYYMMDD.tar.gz files, one per night, each a full copy of the same server. A short loop turns them into one snapshot per night, each dated to the night its archive was made.

Create the store. It can sit on a local disk, an SFTP server or an object storage bucket, and it is encrypted with the passphrase you choose.

Import each archive with its own date. -force-timestamp sets the snapshot date from the file name. -tag marks the imported snapshots so you can list them apart.

Verify the store. plakar check reads every snapshot back and verifies its content.

Retire the old copies. Once plakar ls -tag nas-import shows one snapshot per night, the archives on the NAS can go.

Shell
$ plakar at /var/backups create

$ for f in /mnt/nas/backup-*.tar.gz; do
    d=$(basename "$f" .tar.gz | cut -d- -f2)
    plakar at /var/backups backup -tag nas-import \
      -force-timestamp "${d:0:4}-${d:4:2}-${d:6:2}T02:00:00Z" \
      "tgz://$f"
  done

$ plakar at /var/backups check
$ plakar at /var/backups ls -tag nas-import
New data stored per imported archiveIllustrative values: the first archive is stored in full, each later one adds only the files that changed that night.
  1. D1 full first backup
  2. D2 3% new data
  3. D3 2% new data
  4. D4 4% new data
  5. D5 2% new data
  6. D6 3% new data
  7. D7 5% new data
  8. D8 2% new data

Scenarios

Tar archive scenarios

plakar diff nginx.conf

Finding when a file changed between two tar archives

An auditor asks when TLS 1.2 was dropped from the web servers. plakar locate nginx.conf lists every snapshot that holds the file, and plakar diff c396e52a:/srv/app/etc/nginx/nginx.conf a1f61c48:/srv/app/etc/nginx/nginx.conf prints the change. Neither archive is unpacked.

docker export

Tracking drift in a container filesystem

docker export -o /srv/exports/web-01.tar web-01 writes the filesystem of the container as a tar file each night, and tar:///srv/exports/web-01.tar imports it. plakar diff -recursive between two nights lists the files that appeared and the lines that changed in every modified file.

plakar restore -to

Restoring one directory from a 2023 tarball

The archive you need is now a snapshot, so there is nothing to download and unpack. plakar restore -to /srv/restore/uploads c396e52a:/srv/app/uploads writes the contents of uploads into the target folder.

plakar archive -output -

Sending a snapshot to a host without Plakar

A vendor needs the configuration of one release as a plain tarball. plakar archive -output - a1f61c48:/srv/app/etc | ssh vendor-host tar xzf - streams it as tar.gz to the other side, where tar is the only tool needed.

Formats

Tar formats Plakar reads and writes

tar://

Plain tar archives

Uncompressed .tar files, read from a local path such as tar:///mnt/exports/app-export.tar.

tgz://

Gzip-compressed tar archives

.tar.gz and .tgz files, decompressed during the import. tar+gz:// and tar+gzip:// are accepted as the same protocol.

plakar archive -format

Tar, tar.gz or zip on export

plakar archive writes a snapshot or one of its paths as tarball (tar.gz, the default), tar or zip. -rebase drops the leading path inside the export.

Quickstart

How to import a tar archive with the open-source Plakar CLI

The Plakar CLI is free and open source, and tar support is part of it. Create a store, then point plakar backup at the archive file with the protocol that matches its compression.

The tar integration documentation describes the protocols and the location option.

Shell
$ plakar at /var/backups create

$ plakar at /var/backups backup tar:///mnt/exports/app-export.tar

$ plakar at /var/backups backup \
    -force-timestamp 2025-03-14T02:00:00Z \
    tgz:///mnt/nas/backup-20250314.tar.gz

$ plakar at /var/backups ls

FAQ

Tar archive backup FAQ

Which tar formats can Plakar import?

Plain tar archives with tar:// and gzip-compressed archives (.tar.gz, .tgz) with tgz://, also accepted as tar+gz:// and tar+gzip://. The archive is a file on the machine running Plakar.

How does Plakar read a tar archive?

It reads the entries in order, decompressing gzip on the fly, and writes each one into the snapshot as it goes. Nothing is unpacked to a temporary directory.

Do tar.gz archives deduplicate in Plakar?

Yes. Deduplication works on the files inside the archive, not on the compressed stream, so unchanged files are stored once across all the archives you import.

Does Plakar keep the permissions and dates of tar entries?

Yes. Mode, owner, group and modification time are recorded for each entry. A restore to a directory applies modes and times, and owners when it runs as root.

How do I keep the original date of an old tarball?

Pass -force-timestamp to plakar backup, for example -force-timestamp 2025-03-14T02:00:00Z. The snapshot is then listed under that date.

How do I compare two tar archives?

Import both, then run plakar diff on the two snapshots, with a file path for a single file or -recursive for the whole tree. Changed files show as a unified diff.

How do I turn a Plakar snapshot back into a tar.gz file?

Run plakar archive -output export.tar.gz followed by the snapshot ID. Add a path after the ID to export one directory, and -format tar for an uncompressed file.

Where can I restore an imported tar archive?

To any directory with plakar restore -to, or to any destination Plakar supports, such as an SFTP server or an object storage bucket.

Ready to protect your data using Tar integration?

Tar docs

Security by design

Reduce your attack surface by keeping encryption keys out of storage. With true end-to-end encryption, your data is protected before it leaves the source and remains unreadable even to your storage provider.

  • End-to-end encryption with modern crypto (no compromise on "at-rest/in-transit")
  • Snapshots that cannot be altered without detection
  • Tamper-evident metadata
  • Zero-trust-friendly architecture
"You don't have to trust your storage provider."
Plakar demo

Regroup all your data protection workflows in one platform

From edge devices to SaaS platforms and hybrid clouds, Plakar keeps your data safe, synced, and instantly restorable: all from one unified tool.

For SaaS, endpoints & edge

Whether you're backing up remote laptops, on-premise servers or third-party SaaS data, Plakar gives you full control. Deduplicated backups, minimal storage, full flexibility. Even in disconnected environments.

In your data center

Legacy systems or critical data. All backed up with the same simplicity. Plakar integrates directly into your infrastructure with a scriptable CLI, orchestration support, and instant recovery.

Across clouds

Cloud-native or multi-cloud? No problem. Plakar works with object storage, S3-compatible services, and hybrid environments, without locking you in or slowing you down.

Discover Plakar, book a demo or join a community call

Plakar is not another complex "backup project".
Protect what matters with little investment.

Demo