2

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?

7

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

  • I couldn't get File Exporter to work (with DL 22.0), but successfully downloaded the attachments using Data Export. Although this wasn't quite what I originally intended it works well. My original idea was to download the attachment body directly to the db (as a blob or similar) and whilst I managed to achieve that, I couldn't figure out how to get it to upload back as it always expected a file path as the 'body'. – Patrick Dixon Sep 13 '12 at 7:59
  • The link to File Exporter is dead. – Sander de Jong Apr 20 '15 at 11:11
  • Update to the FileExporter Link. Please note it doesn't work with DL after 23, and 17 (download link is provided in readMe) is the suggested version per the readMe. Just used it myself and found it extremely helpful to convert the binary to the file. – zainogj Jan 30 '16 at 18:09
  • thanks @Michael for including "Moving Attachment" blog post. #happytohelp if anyone needs more details around doing this. – Chirag Mehta Jun 22 '17 at 6:34
6

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.

0

Take a look at Skyvia Salesforce migration.

  • 4
    While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. – Bartley Jul 1 '15 at 16:46
  • Ok! Sorry! I'll keep it in mind during next answer. – David Fisher Jul 23 '15 at 14:25

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.