-
-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or request
Milestone
Description
Summary
Currently, RESTORE mirrors the backup's directory structure (respecting the original --rel, --abs, --flat choice). Users should have control over the restored structure independent of how the backup was organized.
Proposed Feature
Add a --structure (or -str) flag to RESTORE with the following options:
| Value | Behavior |
|---|---|
dst |
Default - Mirror the destination/backup structure (current behavior) |
orig |
Restore to original source paths as recorded in the manifest |
rel |
Use relative path structure |
abs |
Use absolute path structure (with drive letter as directory) |
flat |
Flatten all files into a single directory |
Usage Examples
# Current behavior (default: dst)
preserve RESTORE --src backup/ --dst restored/
# Result: mirrors backup structure
# Restore to original locations recorded in manifest
preserve RESTORE --src backup/ --structure orig
# Restore with absolute path structure
preserve RESTORE --src backup/ --dst restored/ --structure abs
# Result: restored/C/data/file.txt
# Restore flat
preserve RESTORE --src backup/ --dst restored/ --structure flat
# Result: restored/file.txt (all files in root)Technical Considerations
- Manifest already stores original source paths - this enables
origmode origmode should work without--dst(restores directly to original locations)- Other modes require
--dstto avoid overwriting original files - Conflict handling (
--on-conflict) should apply to all structure modes
Context
This complements the existing path preservation options (--rel, --abs, --flat) used during COPY/MOVE by giving equivalent control during RESTORE operations.
See discussion in README.md section "Understanding RESTORE --dst Behavior" for current behavior documentation.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request