4

I have completed a data export of an org we acquired through the following steps:

  1. In Setup, navigate to Data Management | Data Export enter image description here
  2. Click on either Export Now or Schedule Export button, whichever button is available
  3. Choose file encoding (recommendation is Unicode UTF – 8)
  4. Check the box to include Salesforce Files and Document Versions enter image description here
  5. Uncheck the box to replace carriage returns (i.e. new lines) with spaces
  6. Uncheck Include all data (unless you want to export all data)
  7. Check ContentVersion (this includes Salesforce Files and Enhanced Notes)
  8. Check Note (if you want Classic Notes from “Notes & Attachments” related lists) - checked this just in case the had notes in the classic format enter image description here
  9. Click Save button
  10. Wait for the email that states that the Data Export is complete which contains a link to your generated export.
  11. Click the link in the email
  12. Download the zip files(s) that were generated
  13. The zip files(s) contain .csv files for the objects exported enter image description here
  14. You’ll notice a ContentVersion folder which contains even more files, one per ContentVersion record exported enter image description here
  15. The name of these files are the ContentVersion.ID which correlates to the “Id” column in “ContentVersion.csv” file. Note: ContentVersion object is the common object that includes both Salesforce Files and Enhanced Notes. (i.e. File Type of SNOTE are for Notes)
  16. For each “Id” in “ContentVersion.csv” file is then in the folder “ContentVersion” existing with a file name with the same name as the “Id” column value.

My problem is trying to understand how to import these files into our current org. We had a field on the opportunity record of the acquired org that contains the Account ID of the account in our current org we want to attach the corresponding Files and Notes to. We are using Salesforce Lightning.

I was sent to this link for uploading the Notes but completely stumped at how I map these note to the correct accounts.

Import Notes to the ContentNote object with Data Loader

Any clear direction on how to complete this would be appreciated.

  • 1
    +1 for one of the nicest, well-documented questions; – cropredy Oct 13 '19 at 5:14
2

The key to this is the ContentDocumentLink record that is a junction between the Object (Account in your case) and the ContentDocument (which is the parent of ContentVersion). You have to reconstruct this.

Example:

Source org

ContentDocumentLink.LinkedEntityId = someAccountId in source org
ContentDocumentLink.ContentDocumentId = some ContentDocument parent of 
                                        one or more versions of a ContentVersion

Target org (you have to build this)

ContentDocumentLink.LinkedEntityId = someAccountId in target org
ContentDocumentLink.ContentDocumentId = some ContentDocument parent of 
                                        imported ContentVersion

When I have done this in the past (and it was an unpleasant experience requiring a lot of concentration), I ended up using a spreadsheet tool to do the correlation. Others have used MySQL or MS Access to keep track of the correlation.

Remember that the Ids of the source org will never be the same as the Ids in the target org. If you transferred accounts and opportunities already, you know this by now. You would have had to do an xref prior to Data Loading the Opportunities to make sure that the uploaded Oppos point to the newly uploaded Accounts (and the right Accounts)

Doing the Files and Notes is no different except the schema is more complicated

| improve this answer | |
  • Thank you for your response. I do appreciate. So, basically just doing some lookups, per se, to get the right items connected together? Would you happen to have a sample of the spreadsheet that you had used. I have been working on compiling my sheet via vlookups but it seems silly based on the instructions I have found to have to upload the items first then use the success file to attach them to the correct record. Is that what you had to do? – Rachel Linder Oct 14 '19 at 14:36
  • @RachelLinder - there are lots of ways to do this (the success file will certainly have the ids of the newly loaded CV in the target. But you need the CV's parent CD. This will require a query/export. One thing I have also done is to create custom/hidden fields in the target org to hold the source Ids. Then use data loader to include these. This makes it a bit easier when querying the target org to also fetch the corresponding source org ID. – cropredy Oct 14 '19 at 17:49
  • @cropedy - again thank for such quick responses. With your help and some more digging and testing on my side I got it done. Question - is there a way for me to mark an answer as the best answer as I am new to this site and not sure if I can? – Rachel Linder Oct 16 '19 at 15:38
  • @RachelLinder - so glad you succeeded and have no doubt said, "I'm never doing an org migration again". Simply choose the check mark on this answer to mark it as accepted – cropredy Oct 16 '19 at 16:34
  • LOL...you are so right on the migration statement. But unfortunately we aren't done yet that was just a small piece. Tested using Sandbox. Unfortunately now we are running into problems importing Quote Lines...woo hoo... – Rachel Linder Oct 16 '19 at 18:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.