How to Migrate Salesforce Attachments to Files Using Dataimporter

Sam Hoult
July 11, 2025

As Salesforce phases out legacy Attachments in favor of Files (ContentVersion), many teams are looking to clean up historical data and modernize their orgs. Whether you're migrating between Salesforce environments or updating records in place, converting Attachments to Files is a crucial step—and Dataimporter makes it easy.

Why Convert Attachments to Files?

Salesforce Files offer numerous advantages over legacy Attachments:

Organizations aiming to standardize on Files often face challenges with manual conversion or Apex-heavy approaches. Dataimporter provides a no-code, Salesforce-native solution to convert Attachments to Files—across environments or within the same org.

Supported Use Cases

With Dataimporter, you can convert Attachments to Files in:

How It Works with Migration Templates

Dataimporter Migration Templates let you define multi-object workflows that preserve relationships and apply transformations. Here's how to set up a template to convert Attachments to Files.

Step 1: Add the Parent Object

Start by adding the parent object—such as Account, Opportunity, or Case—as a top-level object. Apply filters as needed to control which records are included.

Step 2: Add the Attachment Object

Add the Attachment object as a related object to the parent, using the ParentId relationship. This pulls in only the relevant Attachments.

Step 3: Convert to ContentVersion

Change the target object for the Attachment job to ContentVersion in the Configure tab.

Field mappings:

Step 4: Link the File to Its Parent

Use the FirstPublishLocationId field on ContentVersion to associate each File with its parent record.

Salesforce automatically creates the ContentDocumentLink when FirstPublishLocationId is set—there’s no need to add it manually.

Step 5: API and Batch Size Settings

Files must be migrated using the REST API. Bulk API 2.0 does not support ContentVersion.

Additionally, Salesforce enforces a 50MB per API call limit on binary data. To avoid errors:

Why Use Dataimporter?

Unlike Apex scripts or export/import tools, Dataimporter gives you:

Conclusion

Whether you're modernizing your existing Salesforce org or consolidating data between environments, converting Attachments to Files is a critical step. With Dataimporter, you can handle it all—no code, no manual exports, and no risk of breaking relationships.

Start your Attachment-to-File conversion today with Dataimporter’s powerful, flexible Migration Templates.

Get Started with Dataimporter