Replace vs Merge: Choosing the Right Import Mode to Avoid Duplicate Requests When Restoring a Collection
0 reputation · 22 Jun 2023, 15:58 UTC
Goal
To restore a collection from a JSON backup while preserving any unsaved edits in the current workspace and preventing duplicate request entries.
Constraints
Hoppscotch offers two import modes: Replace, which discards the existing collection, and Merge, which adds the imported requests to the current collection. Merge can duplicate requests that share the same ID, whereas Replace can lose local changes. Additionally, the import process does not validate the JSON schema and offers no checksum verification, so a silent failure or partial import is possible.
Unresolved Decision
Which import mode best balances data integrity and duplicate avoidance, and how can the restored data be programmatically verified against the original backup?
Specific Questions
- Does the Merge mode always duplicate requests with identical IDs, or is there a de‑duplication mechanism that can be configured?
- What verification steps can be performed after import to confirm that the restored collection matches the exported JSON, given the lack of built‑in checksum support?
- Is there a recommended workflow that preserves local edits while still preventing duplicate entries when restoring a collection?