Feature request: configurable remote path mapping for storage backends

Feature request: configurable remote path mapping for storage backends

Background

I recently ran into a problem with a Duplicati backup stored on an InfiniCLOUD WebDAV backend.

The backup had been working without issues for a long time. After changes on the provider side, the same remote files appeared to Duplicati under a different remote path/prefix than before.

The files themselves were still present on the remote storage, but Duplicati no longer interpreted their paths in the same way as when the backup was originally created.

For example, Duplicati previously expected:

file1
file2
file3

but the storage backend now exposed the same files as:

dav/Backup/file1
dav/Backup/file2
dav/Backup/file3

This caused problems when validating the backup and when trying to reconstruct the local database.

For example, Duplicati reported errors such as:

Found 27 files that are missing from the remote storage,
and no files with the backup prefix duplicati,
but found the following backup prefixes:

dav/Backup/duplicati

During database repair, Duplicati also reported errors such as:

Failed to accept new index file: duplicati-....dindex.zip.aes

Unknown remote file duplicati-....dblock.zip.aes detected

The existing remote files were therefore no longer correctly associated with the logical backup namespace Duplicati expected.

Ultimately, I had to abandon the old backup and create a new one, which meant losing all previous backup versions stored on that host.

Proposed feature

I would like to propose a general-purpose configurable remote path mapping for storage backends.

The idea is to introduce a mapping layer between the namespace exposed by the storage backend and the logical remote namespace used internally by Duplicati.

For example:

Storage backend namespace:
dav/Backup/file1

        ↓ path mapping

Duplicati logical namespace:
file1

A configurable mapping could therefore look conceptually like:

dav/Backup/  →  /

or, in the opposite direction when accessing the backend:

/  →  dav/Backup/

The important point is that this should not be implemented only as a special option for database repair.

It should be a general storage path mapping layer.

Where the mapping should apply

The mapping should be applied consistently whenever Duplicati interacts with the remote storage, including:

  • creating backups

  • restoring backups

  • validating / verifying backups

  • repairing databases

  • recreating databases from remote storage

  • enumerating remote files

  • reading and writing volumes

  • compacting backups

  • deleting / purging remote files

  • checking for missing or unexpected files

The mapping should support both directions, because the path used to store a file does not necessarily have to be the same path under which the file can later be accessed.

For example, a storage backend could behave like this:

Write:
path1/file1
    ↓
storage backend

Read:
path2/file1

In other words, the backend may require a file to be stored under path1/file1 but accessed or exposed under path2/file1.

The mapping layer should therefore be able to translate paths independently for the relevant storage operations.

For example:

Duplicati logical path:
file1

Write to storage:
path1/file1

Read from storage:
path2/file1

This is different from a simple static prefix replacement. The mapping may need to define how a logical Duplicati path is translated when writing, and how the storage-provider path is translated back when reading or enumerating files.

The important requirement is that Duplicati should be able to maintain a stable logical namespace even when the storage backend uses different paths for storing, exposing, or accessing the same file.

Why this would be useful

The physical or provider-side storage namespace does not necessarily have to remain identical to the namespace originally used by the backup application.

This can happen because of:

  • changes in a provider’s WebDAV implementation

  • reverse proxies or storage gateways

  • changes in mount points or virtual filesystem layouts

  • S3-compatible storage gateways

  • provider-side namespace changes

  • migrations between storage systems

  • different API representations of the same underlying files

In these situations, the files may still exist and be perfectly usable, but Duplicati may no longer recognize them because their remote paths have changed.

A configurable mapping would allow the user to tell Duplicati:

“The files are still the same files, but the storage backend now exposes them under a different path.”

This would be particularly valuable when a provider changes its infrastructure without changing the actual backup data.

Relation to backup prefixes

Duplicati already has the concept of a backup prefix, but a backup prefix is not the same as a general remote path mapping.

A prefix determines how backup files are named within Duplicati’s namespace.

The proposed feature would instead translate between two different remote path representations.

For example:

Storage namespace:
dav/Backup/duplicati-xxxx.dblock.zip.aes

Duplicati namespace:
duplicati-xxxx.dblock.zip.aes

This distinction is important because the problem can affect more than just the backup prefix.

Expected behavior

Ideally, the mapping would be configured at the storage-backend level and applied transparently.

For example:

Remote path mapping:

Remote storage: dav/Backup/
Duplicati path: /

When Duplicati enumerates the remote directory, the mapping would remove dav/Backup/ before passing the paths to the Duplicati core.

When Duplicati needs to access a logical path such as:

duplicati-123456.dblock.zip.aes

the mapping layer would translate it back to:

dav/Backup/duplicati-123456.dblock.zip.aes

This should happen consistently for all storage operations.

Summary

I believe a general-purpose remote path mapping would make Duplicati considerably more resilient to storage-provider changes and differences between storage namespaces and API-exposed namespaces.

Rather than tying this functionality specifically to database repair or database recreation, I would suggest implementing it as a general abstraction between the storage backend and the Duplicati logical namespace.

This would also make the feature useful for existing backups where the remote path representation has changed, without requiring users to abandon the backup and start from scratch.

I support the idea in general, but in this case, could you not simply change the path?

If you had

webdavs:://example.com?username=user

Then change it to:

webdavs:://example.com/dav/Backup?username=user

(In the UI, simply change the path).

Would that not work?

If implemented, we have multiple remote paths supported in a single backup (multi-destination, remote source), we would need some logic so it applies to a specific destination-url.

Unfortunately, I can’t say for sure. After many unsuccessful attempts to repair the backup, I eventually decided to abandon it and start over, as I have other backups available. I deleted the old backup, so I can no longer test whether changing the path would have solved the problem. All previous backup versions stored on that host were lost.

The situation was this:

Activity                         Remote path
--------                         ------------
Original Duplicati path           /path1/file1
Current remote read path          /path2/file1
Current remote write path         /path2/file1

The point of the mapping would be to let Duplicati continue recognizing the existing files as part of the original backup, even though the provider now exposes them under different remote paths.

There is also a related use case: some storage systems may require files to be written under one path but expose them under another path for reading. For example:

Write URL:
https://example.com/path1/file1

Read URL:
https://example.com/path2/file1

In this case, the write and read URLs need to be configurable independently.

The mapping should be configurable per backup job, with separate URL mappings for read and write operations.

The mapping would translate between the paths Duplicati expects for its backup files and the remote paths used by the storage backend.

In most use cases, a single mapping may be sufficient because only one operation requires a path change. However, separate read and write mappings should be supported if the two operations require different path translations.

For example, assuming the base URL is https://example.com, the configuration could conceptually look like this:

Use case 1: Provider changes the path

Original remote URL:
https://example.com/path1/file1

Current remote URL for reading and writing:
https://example.com/path2/file1


Use case 2: Different paths for reading and writing

Write URL:
https://example.com/path1/file1

Read URL:
https://example.com/path2/file1

These examples illustrate two different scenarios: in the first, the provider changes the path under which existing backup files are accessible; in the second, the storage backend uses different paths for writing and reading.

In short, I am proposing configurable remote path mapping that allows Duplicati to continue recognizing existing backup files after path changes and supports storage backends with different read and write paths. The mapping should be configurable per backup job or remote destination. Depending on the use case, it should allow either the read URL or the write URL to be mapped to a different remote path.