How to Migrate Salesforce Attachments to Files Using Dataimporter

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.
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:
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.
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.
Add the Attachment
object as a related object to the parent, using the ParentId
relationship. This pulls in only the relevant Attachments.
Change the target object for the Attachment job to ContentVersion
in the Configure tab.
Field mappings:
Body → VersionData
Name → Title
Name → PathOnClient
(required; use the formula [Name]
)
Use the FirstPublishLocationId
field on ContentVersion to associate each File with its parent record.
ParentId → FirstPublishLocationId
directly.ParentId → FirstPublishLocation Account MagicId
(or another external ID). This ensures Files are linked to the correct records in the target org.Salesforce automatically creates the ContentDocumentLink
when FirstPublishLocationId
is set—there’s no need to add it manually.
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:
Unlike Apex scripts or export/import tools, Dataimporter gives you:
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.