Skip to main content
Confluence

Smarter Server to Cloud Confluence migration with Smartmatic

Smartmatic share how they used ScriptRunner for Confluence to ease their macro migration from Server to Cloud using a combination of a custom search and replace script and a CQL Escalation Service Job.
A Confluence admin considers their Confluence page

The challenge

Atlassian first announced the sunsetting of Server way back in 2020. Since then, migrations have been on all of our minds.
As anyone who has already completed their server migration knows, it is a massive undertaking. Choosing between Cloud and Data Center, while a hugely important decision, is just the beginning. For those of us about to embark on this journey, you’ll be glad to hear there are ways to work smarter, not harder, and save yourself some headaches in the long run: just like Smartmatic.
Smartmatic, the world leader in secure election technology, chose to migrate their Confluence instance from Server to Cloud. Their migration strategy involved moving a whopping 700 Confluence spaces containing 22,000 pages, as well as their 2000 users.
While planning their migration strategy, they spotted a big problem. Most of their pages were built using templates that relied on macros to customise their appearance. These on-prem macros don’t have a Cloud counterpart, so a simple transfer of these pages was not possible. Some macros might transfer over, but display incorrectly, and others would be lost in the transfer, and the information they contain gone with it.

The solution: search and replace

With the majority of their 22,000 pages on the servers, they required a solution that would enable them to retain all the information contained within these macros. Manually sifting through their pages was not an option: their instance was too large, and the migration would demand an excessive amount of manpower. They might have been tempted to start afresh on the Cloud, opting not to migrate their pages and instead begin with a clean slate. However, this approach was not viable. Their 2,000 users depended on the information contained in these pages, and requesting their users to reconstruct these pages would have caused significant disruption throughout the entire organisation.
Smartmatic figured out a faster, smarter solution.
First, they compiled a list of all the macros in use on their instance. Then they took each macro in turn and researched whether there was a Cloud equivalent, and how they would look and function after the transfer.
This information was then used to determine whether the macro could be replaced by a cloud equivalent or converted to a ScriptRunner custom macro. If neither of these options was possible, the macro was to be removed entirely and the content displayed on the page, outside of any macro. Their goal was to ensure all content stored within their existing macros would be displayed legibly on the Cloud page.
To achieve their smarter solution, they turned to their existing ScriptRunner for Confluence on Server license, and used a combination of a custom search and replace script, and a CQL Escalation Service Job.
It was so easy. After we knew what we were dealing with in terms of macros, we just replaced the macro code directly on the Confluence page. That’s it!
Jose Dos Ramos
Applications Specialist, Smartmatic

The process

Before jumping into the implementation of their solution on their new Cloud instance, Smartmatic created a demo space for testing:
A screenshot of a demo Confluence space for testing
They also kept a copy of the latest version of each page on their instance so they could revert back to it at any time:
A script showing how to revert a page to an older version
With these safety measures in place, they got to work. A script was created for each macro, such as this “replace a comment macro with a page properties macro”:
An example of a Confluence page with and without a comment macro
They used a CQL Escalation Service Job to find the pages containing each macro, so they could replace the macro directly on the page. This CQL query was set up to look for pages containing each macro and run a custom search and replace script for each resulting page.
The custom search and replace script would then parse the page, select the root, and either remove some parameters, replace the macro, or remove it altogether.
A sample of a script that replaces macros
Below, you can see an example of a Confluence page with a Brickit Plugin macro before and after they used ScriptRunner for Confluence to remove the macro.
A Confluence page shown with macros and without macros
Due to the large number of pages in their instance, they ran these scripts in batches using the escalation service. A job was created for each macro category:
A list of scripts running in batches

The result: working smarter with ScriptRunner

Now that Smartmatic have resolved their macros challenges, they’re ready to move onto the next stage of their migration. Once complete, they are planning to use their ScriptRunner for Confluence on Cloud license to manage permissions for spaces and to enforce assigning of group permissions rather than individual permissions.

Sound like what you’re looking for?

ScriptRunner for Confluence can take the headache out of your server to Cloud migration too.

More about Smartmatic

Smartmatic is the leading provider of secure, accessible and transparent election technology and services.
Since its founding in 2000, Smartmatic has built a unique body of experience helping election commissions in more than 30 countries modernize their elections. Using technology designed and developed by Smartmatic, these electoral commissions have registered more than 6.5 billion votes with zero security breaches.