In the distant past I have migrated thousands of files to Salesforce as 'Attachments'.

I am currently on a project where I need to migrate thousands of files to Salesforce as 'Files' - this will be an unfamiliar task for me. As I understand it the process is similar (ie. upload via Apex Data Loader using a suitably populated csv). However my searching for the correct procedure has produced no clear instructions (not clear to me anyway).

For example:

1 https://help.salesforce.com/articleView?id=000232998&type=1

2 https://help.salesforce.com/articleView?id=loader_content.htm&type=5

3 https://www.simplysfdc.com/2018/02/salesforce-mass-upload-files-to-files.html

Nos. 2 and 3 appear very similar (and if I was more SFDC savvy perhaps they would turn out to be the same), but the first one (Trailblazer) is different in that it advises the creation of two csv files and what appears to be a different process.

Am I on the right track here? Maybe someone who has done this before can point me to 'best practice' instructions?

  • Do you want to move the same attachment you have in your system as files? – sanket kumar Apr 4 at 7:32

Uploading a File and associating an uploaded File with a particular record is actually a 2-step process. In summary, you will need to perform:

  1. Load the file data into the ContentVersion object
  2. You then export the ContentDocument records and by using the success file generated on the first step, get the corresponding ContentDocumentId for those files. Then you create a new CSV file with the ContentDocumentId and associate those to the respective records in Salesforce and insert data in the ContentLink object

The first link in your question details these steps. I haven't done too many of File uploads, but whenever I have been in that situation, I have followed these steps.

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.