Repository navigation
feat: restore keeps document ids (--preserve-ids) - #10
Merged
Merged
Conversation
…n empty target) Restore POSTs each document with its backup id when the target has none of the restored (non-singleton) documents, or with --clean, so links and systems that name a document by id survive a restore. --preserve-ids forces it into a populated target (overwriting same-id documents); --preserve-ids=false opts out. An unlistable or unreadable target is never assumed empty. A refused write now reports the server's reason instead of always naming content:write.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Item 6 of the 3.6 "things that will bite you" work:
trokky restoreused to give every non-singleton document a new id, breaking anything outside the CMS that names a document by id.--clean. The create names its id, which the server keeps.--preserve-idskeeps them in a populated target too, overwriting same-id documents.--preserve-ids=falseopts out.Tested end to end against two real Trokky instances (empty and populated targets, singletons, cyclic references, media,
--clean,--dry-run,--collections). That run found a server bug, fixed in Trokky/trokky#100: a create by existing id suffixed the document's own slug. Against servers older than 3.6 the overwrite case can still suffix slugs; the help text says so. Reviewed by Codex as well.