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.