How to convert the page editor style to new editor in cloud using the Confluence Command Line Interface
This article explains how to convert the old editor style of a page to a new editor in the cloud using the Confluence Command Line Interface (CLI).
Instructions
To convert a single page into a new editor: Use the renderRequest action as given below:
--action renderRequest --request "/rest/api/content/506527918/convert?hash=13" --type "JSON" --requestType PUT
In the above action command, 506527918 within the URL refers to the page id.
To convert multiple pages to the new editor: Use the renderRequest action along with runFromPageList as given below:
--action runFromPageList --space KT --common "--action renderRequest --request "/rest/api/content/@contentId@/convert\?\hash=13" --type "JSON" --requestType PUT" --continue
To convert multiple pages to the new editor that are modified from a specific date: Use the --cql parameter along with the action as given below:
--action runFromPageList --cql "space = "HTML" AND lastModified > "2020-12-11" " --common "--action renderRequest --request "/rest/api/content/@contentId@/convert\?\hash=13" --type "JSON" --requestType PUT" --continue
The above actions contain the following parameters:
- space: Space key
- request: URL fragment for a request.
- type: Application type, shortcut type, content type, or similar depending on the context.
- requestType: Type of a render request like GET or POST.
- cql: CQL content search.
It is recommended to test the commands in a non-production environment or run the action with the --simulate parameter to verify the behavior before deploying.