I am trying to copy data from one org to a sandbox via a backup tool and SF Data loader. Most things worked fine, but ContentDocumentLinks are missing. I tried loading them via Salesforce Data Loader, authenticated with my Admin account with "View all files", "View all data" and "modify all Data" permissions. This worked for 10% of the links but most get a "invalid cross reference id" error. Taking the IDs from the CSVs, I can without problems
- access the document and linked entity when appending it to the org url
- take the ContentDocumentId and LinkedEntityId and create a new ContentDocumentLink with it via anonymous apex
Am I missing something? Is the data loader (and our backup tool) using different permission or sharing rules?
Further investigation showed that inserts via apex also fail - but only when inserting multiples at once. I haven't found the exact number yet, but inserting 3 at a time works, when trying inserting 130 at a time including the 3 before that, all get the error. The log shows only the insert, no triggers or anything else.