Hi all,
Up until yesterday, I was able to migrate my app data from Server to Cloud using CCMA v3.1.6.
However, once I installed the latest release v3.1.7 - it no longer works.
As far as I know, I shouldn’t be affected by the alpha to beta breaking changes as my migration path doesn’t include migration details (project and spaces). But out of curiosity, I went ahead and implemented the recommended changes anyways but still no luck. Here’s what I did;
- bumped osgi to v0.3.6
- use MigrationDetailsV1
- use AppCloudMigrationListenerV1
There was an old post in here that describes a similar situation to mine but that didn’t help either.
Restarted, cleaned, uninstalled and reinstalled - still no luck.
Just before I write this post, I noticed the release notes for the latest version of CCMA states that
This release is to support the app migrations EAP scheduled for March 2021.
Do I need to be in the EAP to use the latest version of CCMA successfully?
Anyone facing similar issues to mine after upgrading?
For references, here’s my original onStartAppMigration
and access scopes.
public void onStartAppMigration(String transferId, MigrationDetails migrationDetails) {
log.info("onStartAppMigration");
try {
log.info("Migration context summary: " + new ObjectMapper().writeValueAsString(migrationDetails));
// If you know exactly the entities you are looking for a migration mapping, you can query them directly by IDs (up to 100 in a single request)
// Map<String, String> mappingById = gateway.getMappingById(transferId, "identity:user", Collections.singleton("email/admin@example.com"));
PaginatedMapping paginatedMapping = gateway.getPaginatedMapping(transferId, "confluence:page", 5);
Integer index = 0;
while (paginatedMapping.next()) {
Map<String, String> mappings = paginatedMapping.getMapping();
log.info("mappings = {}", new ObjectMapper().writeValueAsString(mappings));
JSONObject migrationData = new JSONObject();
for (Map.Entry<String, String> pageMapping : mappings.entrySet()) {
Page page = pageManager.getPage(Long.parseLong(pageMapping.getKey()));
if (page != null && page.isCurrent()) {
JSONArray formStructure = scaffoldApiService.getFormStructure(page);
JSONArray formData = scaffoldFormService.getFormData(page);
log.info("pageMapping {}", pageMapping.toString());
log.info("formStructure = {}", formStructure.toString());
log.info("formData = {}", formData.toString());
if (formStructure.length() == 0 || formData.length() == 0)
continue;
migrationData.put(pageMapping.getValue(), formData);
}
}
if (migrationData.length() > 0) {
OutputStream firstDataStream = gateway.createAppData(transferId, index.toString());
firstDataStream.write(migrationData.toString().getBytes());
firstDataStream.close();
}
index++;
}
} catch (IOException | XhtmlException | JSONException e) {
log.error("Error retrieving migration mappings", e);
}
}
....
public Set<AccessScope> getDataAccessScopes() {
return Stream.of(PRODUCT_DATA_UGC, APP_DATA_UGC, MIGRATION_TRACING_PRODUCT)
.collect(Collectors.toCollection(HashSet::new));
}
Any input or feedback is much appreciated.
Thanks.