Hi,
We would like to migrate our on-premises Confluence to Confluence Cloud however we have used a custom user NoPrint macro throughout most of our pages. Unfortunately user macros are not supported in the Cloud. We don't mind removing the macro but we have thousands of pages so manually updating the content is not a viable option.
Can I migrate the content to the Cloud and then update our pages via an API or some other kind of scripting?
Any suggestions would be greatly appreciated.
You can use modifyPage from Confluence Command Line Interface (CLI). This is discussed in How to globally search and modify content.
Patrick,
The Confluence REST api has what i think you need, I would approach it like this:
1) Use CQL to find all pages with your macro on it (See: https://developer.atlassian.com/confdev/confluence-rest-api/advanced-searching-using-cql#AdvancedSearchingusingCQL-macroMacroMacro). I just had a thought, this may not work with a macro that is no longer installed. If it doesn't, you can just parse all pages.
2) For each file, you can parse the structured storage format using the content api (See: https://developer.atlassian.com/confdev/confluence-rest-api/confluence-rest-api-examples)
3) The storage format is well structured XHTML so you can use jquery or some other library to parse and manipulate it.
Good luck!
Cheers
Matt
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.