Below are steps.to migrate attachments to Salesforce Files.
1. Export Attachments data using data loader. 2. Export Attachments files, using data export wizard or File exporter. 3. Create two fields, ParentId and AttachmentId on ContentVersion object
ParentId will hold the id of the entity, attachment was linked to.
AttachmentID (with unique constraint) will hold the id of the attachment from attachment object.
4. Create a CSV, ContentVersion_upload.csv, for ContentVersion with the following fields
Attachment_id (AttachmentId from file exported in step-1)
ISDELETED
PARENTID (Entity Id of the object, from file exported in step 1)
Versiondata (local file path)
PathOnClient (local file path)
Title (title of the file)
OWNERID
DESCRIPTION
5. Upload (Insert) ContentVersion.csv into ContentVersion object. 6. Export ContentVersion data uploaded in step-5 using data loader. 7. Create another CSV for ContentDocumentLink (and update ContentDocumentID andParentEntityId, from the ContentVersion file exported in step-5) with the following fields:
CONTENTDOCUMENTID (ContentDocumentId from file exported in step-6)
LINKEDENTITYID (ParentId from file exported in step-6)
SHARETYPE
VISIBILITY
8. Upload (Insert) ContentDocumentLink.
Hope above information was helpful.
Please mark as Best Answer so that it can help others in the future.
Below are steps.to migrate attachments to Salesforce Files.
1. Export Attachments data using data loader.
2. Export Attachments files, using data export wizard or File exporter.
3. Create two fields, ParentId and AttachmentId on ContentVersion object
- ParentId will hold the id of the entity, attachment was linked to.
- AttachmentID (with unique constraint) will hold the id of the attachment from attachment object.
4. Create a CSV, ContentVersion_upload.csv, for ContentVersion with the following fields- Attachment_id (AttachmentId from file exported in step-1)
- ISDELETED
- PARENTID (Entity Id of the object, from file exported in step 1)
- Versiondata (local file path)
- PathOnClient (local file path)
- Title (title of the file)
- OWNERID
- DESCRIPTION
5. Upload (Insert) ContentVersion.csv into ContentVersion object.6. Export ContentVersion data uploaded in step-5 using data loader.
7. Create another CSV for ContentDocumentLink (and update ContentDocumentID andParentEntityId, from the ContentVersion file exported in step-5) with the following fields:
- CONTENTDOCUMENTID (ContentDocumentId from file exported in step-6)
- LINKEDENTITYID (ParentId from file exported in step-6)
- SHARETYPE
- VISIBILITY
8. Upload (Insert) ContentDocumentLink.Hope above information was helpful.
Please mark as Best Answer so that it can help others in the future.
Thanks,
Vinay Kumar
Thanks,
Vinay Kumar