We are redesigning a landing page template for a client, with around 900 pages using this template.
The modules within the new template are much simpler, it will probably just be a single rich text module - we are integrating with the Algolia search platform and would like to have a single module that we index along with the title, description etc.
How do we go about migrating the pages onto the new template without losing the content? We need to get the content of the old modules into this single new module, then the indexing can commence and over time the client can review the copy and make it clearer and simpler.
I think if you change templates and the new template does not contain the same module names, the content of those modules is lost, is this correct? If you switch back does the content come back?
I have been racking my brains here - was thinking perhaps the following:
- Add the new module to the existing template
- Run a script that uses the pages API, grabs the content from the old modules, copies it to the new module, then using the update endpoint, updates the pages to reflect this
- Check everything has worked, and if so, delete the old modules.
Would this work? Any other suggestions?
Thanks in advance.