How to remove restrictions before migration and restore those restrictions after the migration
Problem
When migrating Scaffolding Forms & Templates from Data Center to Cloud using Confluence Cloud Migration Assistant (CCMA) + Appfire’s add-on migration, the migration gets stuck.
Cause
A message pops up as below
“Some data are still not migrated. If these space(s) contain restricted pages, please run the migration script provided.”
Solution
There is a script that does not remove restrictions but instead includes the app user to the affected pages, which avoids the need to restore the restrictions. Instead, it simply adds the user to the Cloud pages, allowing the migration to progress until it is successful.
Prerequisites
Before running the script or re-triggering migration
Ensure the Space and the App are migrated in the same plan.
Ensure the Atlassian dark feature is not enabled, as it will block the app migration.
Also an Atlassian ticket needs to raised prior to the migration, so that the Atlassian team will be able to add flag to pause the App migration, run the script and then remove the flag, so that the migration will run smoothly(including the restricted pages).
Another case is that if the migration stops due to the restricted pages, then the Atlassian team still be able to run the script, and then the App migration can be re-triggered using the API.
https://developer.atlassian.com/platform/app-migration/testing/trigger-app-migration/Below is a sample curl command for your reference. username, password, base_url, and {PlanID} needs to be replaced:
curl -v -u uname:PWD "base_urlofDatacenter/confluence/rest/migration/latest/app-migration/trigger/{PlanID}" -H "Accept: application/json" -H "Content-Type: application/json" -d "{\"includeServerAppKeys\":[\"net.customware.confluence.plugin.scaffolding\"]}"
Migration Steps
Run the Atlassian script (which adds the app user to the restricted pages).
Follow the instructions in the readme file to run the script, or consult with the Atlassian team to assist in running the script.
The script can be downloaded here:
The script is an old one, as it is owned by Atlassian. Once the customer reaches Atlassian, they may be provided with the latest script from Atlassian.
Re-trigger the app migration https://developer.atlassian.com/platform/app-migration/testing/trigger-app-migration/#how-to-trigger-the-app-migration.
This forces CCMA to retry the app migration after adding the app user.
This can be executed using either the curl command or Postman.
Monitor CCMA progress until the app migration reaches 100%.
If the app migration is stuck at any percentage, share the latest screenshot with the Appfire team using the support ticket.
Scaffolding waits to receive the ‘migration completed’ events from all spaces in the migration context. Only after receiving them does it mark the process as 100% complete.
Do not share the Atlassian permission script (which adds the app user to restricted pages in Cloud) to any customers!
The script does not work out of the box and requires direct engagement with the Atlassian team to complete the CSV file. It needs three values: ServerPageIds, CloudPageIds, and SpaceKey.
Currently, you can extract ServerPageIds and SpaceKey from CCMA App vendor checks (Restricted pages). However, the Atlassian team must provide the CloudPageIds.
Only offer the script if Atlassian has specifically requested this workaround and approved assistance with generating the CSV file.