Skip to content
This repository has been archived by the owner on Oct 25, 2022. It is now read-only.

Contentful importer: Clarify that this is a destructive/dangerous operation #131

Closed
arcataroger opened this issue Dec 9, 2021 · 3 comments

Comments

@arcataroger
Copy link
Member

arcataroger commented Dec 9, 2021

Following the instructions on this DatoCMS help page about Contentful imports, I ran this program to import a particular Contentful model over to Dato.

It was not clear that this operation will destroy many things in Dato:

  • Unused DatoCMS assets (i.e., it could clear your whole media library)
  • Unused DatoCMS locales
  • Any models of the same name as what's being imported

There was no warning of this either on the help page or in the script itself. Had I not run it against a sandbox environment first, we would've lost a lot of files.

Ideally, I think this importer should failsafe to leaving unused things alone instead of deleting them. Deletion could be an optional parameter, not the default behavior. And in the case of overwrites, it should prompt you: "A model named _____ is already in this DatoCMS environment. Do you wish to overwrite it, rename the new model, or skip this model?"

Alternatively, a simpler workaround would be to at least warn the user when they run this CLI tool: "WARNING: This import will destroy ALL unused assets in DatoCMS (1,542 files) and locales (3), along with the following models: _____, ______, ______. Type CONTINUE to confirm."

@stefanoverna
Copy link
Member

Agreed. We'll work on it real soon

@arcataroger
Copy link
Member Author

arcataroger commented Dec 9, 2021

Awesome, thank you!

Edit: FYI, not urgent for us... I monkeypatched the code to leave out the destructive operations and successfully imported what we needed. But it's still dangerous for other users who don't know this is the behavior :)

@marcelofinamorvieira
Copy link
Contributor

marcelofinamorvieira commented Jan 3, 2022

Added with v. 3.5.12
Thanks once again @arcataroger for the feedback!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants