Page MenuHomePhabricator

Create maintenance script to remove a content model from a wiki, converting it to another one
Open, Needs TriagePublic

Description

Basically just mass-replace all instances of model 1 with model 2. Everywhere. Should not require model 1 to actually exist (main use case is the removal of a content model extension), should check if model 2 actually supports the content format of model 1 before doing it, possibly for all of them, before doing it for any of them, or just for each a la whatever specialchangecontentmodel does. (So no blind forcing it db-side, let's be sane here...)

Event Timeline

Based on randomly guessing, there's a very good chance that the actual issue behind T222670 and T222674 will also make this rather difficult.

@Isarra what should happen if the content cannot be converted?

It won't always work at all, but in most cases it should at very least be possible to change it to something that can be viewed/displayed in some sense. Most should be text-based, for instance, so it should be possible to, while not changing the actual content, change the type to something that could be displayed and accessed at all (even if it's only to privileged users or something) without erroring out or losing data...

Also there's probably some assumption here that whoever runs the script knows what they're converting in the first place and chooses appropriate content models to convert to.