Find your content:

Search form

You are here

What's the best way to migrate attachments from one SF Org to another?

 
Share

Dataloader to csv doesn't work because of the binary Body, Dataloader to db seems to have problems with heap sizes and API limits ... so what works?


Attribution to: Patrick Dixon

Possible Suggestion/Solution #1

Have you taken a look at File Exporter? Here is a blog post explaining usage of it:

File Exporter

In addition, here is another way to retrieve the attachments without a third party tool.

Moving Attachments


Attribution to: Michael Welburn

Possible Suggestion/Solution #2

You can use the Data Loader to upload attachments to Salesforce. Before uploading attachments, note the following:

If you intend to upload via the Bulk API, verify that Upload Bulk API Batch as Zip File on the Settings | Settings page is enabled.

If you are migrating attachments from a source Salesforce organization to a target Salesforce organization, begin by requesting a data export for the source organization. On the Schedule Export page, make sure to select the Include Attachments... checkbox, which causes the file Attachment.csv to be included in your export. You can use this CSV file to upload the attachments. For more information on the export service, see Exporting Backup Data.

To upload attachments:

Confirm that the CSV file you intend to use for attachment importing contains the following required columns (each column represents a Salesforce field):

ParentId - the Salesforce ID of the parent record.

Name - the name of the attachment file, such as myattachment.jpg.

Body - the absolute path to the attachment on your local drive.

Ensure that the values in the Body column contain the full file name of the attachments as they exist on your computer. For example, if an attachment named myattachment.jpg is located on your computer at C:\Export, Body must specify C:\Export\myattachment.jpg.

Your CSV file might look like this:

ParentId,Name,Body

50030000000VDowAAG,attachment1.jpg,C:\Export\attachment1.gif

701300000000iNHAAY,attachment2.doc,C:\Export\files\attachment2.doc

The CSV file can also include other optional Attachment fields, such as Description.

Proceed with an insert or upsert operation; see Inserting, Updating, or Deleting Data Using the Data Loader. At the Select data objects step, make sure to select the Show all Salesforce objects checkbox and the Attachment object name in the list.


Attribution to: Priyanka
This content is remixed from stackoverflow or stackexchange. Please visit https://salesforce.stackexchange.com/questions/1349

My Block Status

My Block Content