How to get Confluence attachments mapping after cloud migration

Hello,
We are developing our cloud migration system that will migrate data from server to cloud using the app migration library.
After following the documentation we were able to migrate our data from server to cloud successfully and we are able to get the mapping of the migrating page as mentioned in the doc. Now, we are facing an issue getting the attachments mapping. We did use the same code to get pages mapping ( with changing the namespace as mentioned here), but it didn’t work. we are always getting an empty map.
please could you help us find what we have missed or did you face the same issue?
thank you for the help.

Hello Ali,

Welcome to Developer Community.

I’ve run some tests and I’m following up with my team, but I don’t think attachment mappings are published yet. In my test run I can only see confluence:page and confluence:space mappings available.

Just to confirm, what scopes are you using to access the confluence:attachment mapping?

Thanks,
James.

Hello James,
thank you for your quick reply,
we didn’t change the scopes that we have found in the documentation examples. and to get attachments we did like this :
PaginatedMapping attachmentPaginatedMapping = gateway.getPaginatedMapping(transferId, “confluence:attachment”, 500);

and for the scopes we didn’t change it
/**

  • Declare what categories of data your app handles.
    */
    @Override
    public Set getDataAccessScopes() {
    return Stream.of(APP_DATA_OTHER, PRODUCT_DATA_OTHER, MIGRATION_TRACING_IDENTITY, MIGRATION_TRACING_PRODUCT)
    .collect(Collectors.toCollection(HashSet::new));
    }

thank you again for the help,
kind regards,

Hello Ali,

I’ve been testing this today and for my sample migration I was able to see results for confluence:attachment and all the other expected mappings. The attachments need to be attached to the space your migrating. If you inspect the database you can query which attachments should be included with (change to the uppercase spacekey, e.g. PROJ)

select content.contentid, content.title, content.pageid from content inner join spaces on content.spaceid = spaces.spaceid where content.contenttype = 'ATTACHMENT' and spaces.spacekey = '<spacekey>';

For example, I get 2 results in my query and in the mappings I get

mappings = {"917509":"843022340","917512":"843022343"}

where the ids 917509 and 917512 are the values for contentid.

Also, please make sure you’re using the latest versions of the libraries in pom.xml and the latest version of CCMA. We’ll have some new versions soon, but for now the latest should work. Generally, do a git pull from the app-migration-vendor-example repo should get you the latest of everything.

Can you do another test run and then let me know the migrationScopeId from the MigrationDetails object? It will be in the logs from the Migration context summary message.

Thanks,
James.

1 Like

Hello James,
thank you for your reply,
As you mentioned, I have tested it today and it worked correctly,
thank you for your support,
kind regards,