Score:0

How to clone a content type and then convert nodes between the original and any clone it has?

sh flag

I have a Drupal 9 core without any contrib modules.

I want to clone content type A to at least one other content type such as content type B, C, D or whatever and after doing so convert at least one node from content type A to one of the new ones.
Any cloned content type should have a different name in any possible database context such as human-readable name, machine name, etc. to prevent possible database conflicts and crashes.
Node ID and node alias should stay the same to prevent possible SEO problems.

I doubt that Content Type Clone is the right tool for me because allegedly it requires the module Token, but I don't use tokens and don't want to use them.

I don't know of a way to do it automatically in Drupal 9. One of the reasons I consider upgrading to Drupal 10 is to do just that. Does Drupal 10 has a mechanism for that?

id flag
It recommends Token. It does not require it.
cn flag
For copy/clone operations, it's usually something you do only once, so whatever the dependencies are, you can install them and then uninstall everything when you're done. Since this is a dangerous operation, I would do it locally, export config, commit config to code, and then only do the content conversion on production. This means that the dependencies you install locally will never go up to production anyway.
alhemist avatar
sh flag
Or I could just make database backup in at least two different ways and try on production, but the main question is, if everything seems to go okay and I uninstall the module, could there be problems after I uninstall?... Could there be problems when I upgrade from 9 to 10?
id flag
Drupal Questions is a one-question-at-a-time website rather than a support forum.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.