function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
PatcsPatcs 

how to import attachments using dataloader?

I am new to this data migration section.

 

I am using two different developer edition.


when I try to export the attachments from one developer login, it is exported.
when I try to import that attachments in to another developer login, it showing an error.

 

if any body knows please let me know.

Best Answer chosen by Admin (Salesforce Developers) 
Jeff TalbotJeff Talbot

Sorry that link didn't work. Here's the full text from the help page:

 

Knowledge Article Number: 95779


Description

How do I import attachments using my Data Export files?




Resolution
  1. Create an attachments.csv file (the name of the file is unimportant) with the following column headers:
    • ParentId - ID of the record to which the attachment should be associated 
    • Name - Name of the attachment 
    • ContentType - Format of the extension (e.g. .xls, .pdf, etc) 
    • OwnerID - ID for the owner of the attachment
    • Body - File path to the Attachment on the local machine (C:\documents and settings\schun\desktop\attachments\file.xls)
  2. Log in to the Data Loader. 
  3. Select the "Insert" command. 
  4. In the 'Select Sforce Object' step, select the 'Show all Sforce Objects' checkbox and then select "Attachments". 
  5. Choose the attachments.csv file. 
  6. In the mapping step, map the following fields:
    • Parent ID 
    • Name 
    • Owner ID 
    • Body - Make sure to map the Body column which you created previously with the file extension. This is how you designate the file and location of the attachments to be inserted. 
  7. Click "OK" to proceed with the insert. It may take a few minutes but the attachments should be successfully uploaded to your salesforce org.

Hope that helps!

All Answers

kxa422kxa422

What kind of error ?

Jeff TalbotJeff Talbot

I migrated attachments from one org to another just a week ago. I followed these instructions:

 

https://help.salesforce.com/apex/HTViewSolution?id=95779&language=en

 

Good luck. I hope that helps!

PatcsPatcs
Error converting value to correct data type.
PatcsPatcs

when i try to go to that link, it asking for login id when i try to give the developer edition id
it shows the following error

 

 

"Your Organization is not enabled for Force.com Help And Training. Please contact your salesforce.com representative or log a case for access"

Ritesh AswaneyRitesh Aswaney

The thumb rule with improting attachments is, if I remember correctly, setting the fully qualified path of the attachment (file) in the 'Body' column and setting the ParentId. Wondering if you're doing this.

kxa422kxa422

It could be a problem with the data mapping when you try to import your file.

Check also that ParentId, ID have no mapping.

For ParentId you'll need to update it from your second system, the values from your first ont won't match.

Just for checking, could you publish the SOQL that dataloader have produce when you export your file ?

PatcsPatcs

Hi


 i have tried that now its showing the following error

 

"Failed to find mapping for 'LASTMODIFIEDBYID' "

 

I didn’t see any LastModifiedById field to map.
But when I export, I exported along with LastModifiedById field.

 

thanks

Ritesh AswaneyRitesh Aswaney

you should prolly post your mapping file on here. your mapping file should just contain two lines i would reckon, Body and ParentId. Don't think you need anything else for attachments. O and prolly Name.

Jeff TalbotJeff Talbot

Sorry that link didn't work. Here's the full text from the help page:

 

Knowledge Article Number: 95779


Description

How do I import attachments using my Data Export files?




Resolution
  1. Create an attachments.csv file (the name of the file is unimportant) with the following column headers:
    • ParentId - ID of the record to which the attachment should be associated 
    • Name - Name of the attachment 
    • ContentType - Format of the extension (e.g. .xls, .pdf, etc) 
    • OwnerID - ID for the owner of the attachment
    • Body - File path to the Attachment on the local machine (C:\documents and settings\schun\desktop\attachments\file.xls)
  2. Log in to the Data Loader. 
  3. Select the "Insert" command. 
  4. In the 'Select Sforce Object' step, select the 'Show all Sforce Objects' checkbox and then select "Attachments". 
  5. Choose the attachments.csv file. 
  6. In the mapping step, map the following fields:
    • Parent ID 
    • Name 
    • Owner ID 
    • Body - Make sure to map the Body column which you created previously with the file extension. This is how you designate the file and location of the attachments to be inserted. 
  7. Click "OK" to proceed with the insert. It may take a few minutes but the attachments should be successfully uploaded to your salesforce org.

Hope that helps!

This was selected as the best answer
PatcsPatcs

Thanks a lot.

 

 

its working fine.

Nara9Nara9

Hi,

 

I am looking to import Opportunities from a csv file and it gives the error mapping for lastmodifedbyid is missing. I have lastmodifiedbyid column in my csv file but the mapping doesn't happen automaticall. Could you help on this plz?

 

Where do I find the helppage for this?

PatcsPatcs

hi

 

while export you should not select lastmodifieddate from the system, if you want to map the lastmodifieddate you should raise a case to salesforce , so they will give you the permission to map.

 

 

Thanks!

vinothvinoth

Hi,

 

 plz find red text

 

  • ParentId - ID of the record to which the attachment should be associated 
  • Name - (is there any possibility to capture the Attachments name which we are attaching eg:file)
  • ContentType - Format of the extension (e.g. .xls, .pdf, etc) 
  • OwnerID - ID for the owner of the attachment
  • Body - File path to the Attachment on the local machine (C:\documents and settings\schun\desktop\attachments\file.xls)

Thanks

 

lakshman.mattilakshman.matti

i'm new to this.this may looks simple.but please tel me how to create .csv file for a attachment?

 

lakshman.mattilakshman.matti

what is exactly owner id in the above .csv file.what we have to mention that column.

 


TA_Invisible wrote:

Sorry that link didn't work. Here's the full text from the help page:

 

Knowledge Article Number: 95779


Description

How do I import attachments using my Data Export files?




Resolution
  1. Create an attachments.csv file (the name of the file is unimportant) with the following column headers:
    • ParentId - ID of the record to which the attachment should be associated 
    • Name - Name of the attachment 
    • ContentType - Format of the extension (e.g. .xls, .pdf, etc) 
    • OwnerID - ID for the owner of the attachment
    • Body - File path to the Attachment on the local machine (C:\documents and settings\schun\desktop\attachments\file.xls)
  2. Log in to the Data Loader. 
  3. Select the "Insert" command. 
  4. In the 'Select Sforce Object' step, select the 'Show all Sforce Objects' checkbox and then select "Attachments". 
  5. Choose the attachments.csv file. 
  6. In the mapping step, map the following fields:
    • Parent ID 
    • Name 
    • Owner ID 
    • Body - Make sure to map the Body column which you created previously with the file extension. This is how you designate the file and location of the attachments to be inserted. 
  7. Click "OK" to proceed with the insert. It may take a few minutes but the attachments should be successfully uploaded to your salesforce org.

Hope that helps!

 


 

vinothvinoth
You have to give user id as a owner id. for eg. you can give your salesforce id as a owner id.
Jeff HunsakerJeff Hunsaker
For the ParentID, can you use an ExternalID for the Parent Object?  I have 2000 Attachments to load each month.  I would like to take the filename, parse off the directory, and use that as an ExternalID in the Parent object to perform the linkage.  

Thoughts?
Jeff HunsakerJeff Hunsaker
Anyone?  ExternalID for the ParentID?
 
UC InnovationUC Innovation
Checkout this tool:

http://cloudexplorer.ucinnovation.com/

No need to download attachments, or import/export any csv files. Just drag and drop. 30 day free trial, no sign up required. It's our company's product, and I can proudly say it's the best tool for data migration, especially for something like attachments.
Eric Pohlabel 3Eric Pohlabel 3
How does the cloud explorer know what account to associate the attachemment to in the target org??
UC InnovationUC Innovation
Hi Eric,

When you move attachments, it will automatically try to tie to the parents they were originally tied to in the source org. If your target org does not have the same parents (same ID or external ID) then the attachment will not be tied to any parents.

However, if you move attachments and choose to move over their parent accounts as well, then both the account and attachments will be moved over from the source to the target. You can set this up by going to Settings -> Copy -> Parents, choose the object you want to move, and then select then parent lookups you want to copy over.

User-added image

If you need any further help, you can contact our support team at cloudexplorerteam@ucinnovation.com, or visit our support site at http://cloudexplorer.ucinnovation.com/support.html
Adam RedmondAdam Redmond
Followed the steps above, getting the following error: 
Parent ID: id value of incorrect type: ka00X000000ft8nQAA

Any ideas?