Salesforce data version control keeps earlier copies of your records, so you can see who changed a value and when, and revert it if needed. Field history, Field Audit Trail and data exports cover part of that, and backups and source control fill in the rest.
Most Salesforce version control guides talk about metadata, like fields, flows and profiles. This one is about the records themselves: what history Salesforce keeps for you, its limits, and how to cover the gaps.
What does data version control mean in Salesforce?
For a record or a piece of reference data, versioning means you can answer three questions later. What did it say before, who changed it, and when?
Salesforce metadata, the configuration and code your developers commit to a repository, is a separate job. We've written about that side in Salesforce version control and version control without Git, so here it's records only.
A Git repository only holds what someone commits to it, so record edits from users, external integrations and other data sources never show up there unless you export them. Trailhead's Backup & Recover unit is clear about who owns the problem: "As the customer, you are responsible for protecting the data you put into Salesforce."
Which Salesforce data needs versioning?
Different kinds of Salesforce data need different tools, and the first step is sorting yours into groups. The table below shows the main groups, with an example of each and where its versions usually live.
| Data type | Example | Where its versions live |
|---|---|---|
| Transactional records | Opportunities, cases, contacts | Field history and backups |
| Reference data | Product catalogs, price books | Source control, plus backups |
| Sensitive data | Personal details on contacts | Backups only, masked in sandboxes |
| Configuration | Record types, picklist values, flows | Metadata version control |
Record types and picklist values often get listed as reference data, but Metadata API treats them as metadata components. They belong in your metadata repository, while the products and price book entries that use them are records.
Which Salesforce features keep a history of your data?
Salesforce keeps some history for you out of the box, but each feature keeps a different slice for a different length of time. The infographic below lines them up, and the sections after it give the detail and sources.

Field History Tracking
Field History Tracking is something a Salesforce admin switches on in Setup. You pick fields on most custom and standard objects, and Salesforce logs the date, time, change and user every time one of them changes.
You get up to 18 months of that history in the app, and up to 24 months through the API. For the older entries, Salesforce points you to Data Loader or queryAll().
You can track up to 20 fields per object, and formula, roll-up summary and auto-number fields can't be tracked at all. Nothing is recorded from before you turned tracking on, either.
Long text is a blind spot too. For text over 255 characters, Salesforce notes that the field was edited but keeps neither the old nor the new value.
Field Audit Trail
If auditors need more than that, Field Audit Trail lets you keep field history until you delete it, for up to 200 fields per object. You need Enterprise, Performance or Unlimited Edition plus Salesforce Shield or a Field Audit Trail license.
Older history moves into a big object called FieldHistoryArchive, which you read through the API rather than the record page. Out of the box, that happens after 18 months in production and after one month in a sandbox.
Field Audit Trail is one of four products in Salesforce Shield, next to Event Monitoring, Platform Encryption and Data Detect. Our Field Audit Trail guide covers setup and retention policies.
Recycle Bin and Setup Audit Trail
When someone deletes a record, it sits in the Recycle Bin for 15 days by default, and users can bring it back in that time. Trailhead points out the catch: "The Recycle Bin only retains deleted records for a limited time and doesn't help with record changes or data corruption."
For settings rather than records, there's Setup Audit Trail. It lists changes admins made in Setup for at least the last 180 days, which is handy when a data problem started with a config change.
Data Export and Backup & Recover
The Data Export service gives you your data as CSV files. You can run it every 7 days on Enterprise, Performance and Unlimited Editions, and every 29 days on Professional and Developer Editions.
Storing those exports is up to you, because the zip files are deleted 48 hours after the notification email. Salesforce's paid Backup & Recover (formerly Own Recover) takes automated daily backups and can compare two of them to show what changed in records and fields.
How do you implement data version control in Salesforce?
A working setup combines the built-in history with backups and, for reference data, source control. These six steps build it in a sensible order.
1. Decide what to version
Start with the table above and list the Salesforce data your business can't afford to lose or misstate. A short planning pass usually turns up three groups:
- Fields auditors and finance ask about, such as stage, amount, owner and status
- Reference data that many processes read, such as products and price books
- Fields that hold personal data, which need extra care at every later step
2. Turn on field history where it counts
Start with the first group, and pick the fields where a wrong value would hurt most, like amount or stage on an opportunity. You only get 20 of them, so be careful with your picks and tell your team why each one made the cut.
If you need more fields, or history that outlasts 18 months for future audits, Field Audit Trail enables both. Its retention policy lives in HistoryRetentionPolicy, which you deploy with Metadata API.
3. Keep reference data in source control
Small reference datasets are a good use case for Git, next to your metadata and code. Salesforce's data tree commands work for sets of fewer than 3,000 records, and they write each export as JSON you can commit.
Once versioned, the same files help with small data migration jobs, like seeding a new sandbox. A plan file keeps related records together, and reference IDs stand in for record IDs so lookups survive when the records are imported.
The same guide tells you to leave out fields you can't write to, such as formula fields, and only export the writable ones you need. For bigger exports and data migration work, Data Loader is a client application that runs from its own interface or the command line.
A simple layout keeps data apart from metadata in one repo:
- force-app/main/default/ for metadata such as fields, flows and permission sets
- data/products/ for product and price book exports
- data/plans/ for the plan files that set the import order
- scripts/ for the export and import commands your team runs
4. Take regular snapshots and backups
Field history tells you what changed, but it can't bring back a record that was deleted or corrupted in bulk. That takes regular copies of the data itself, from Data Export, Backup & Recover or a third-party backup tool.
Don't count on a sandbox here. A Full Copy sandbox has full production data, but you can refresh it only every 29 days, so it can't give you a daily restore point.
For backup frequency and storage choices, see our Salesforce data backup and recovery strategy guide. If you want to report on data trends over time, our post on time series snapshots covers that.
5. Keep personal data out of Git
Even a private repo is the wrong place for personal data. When your test team needs realistic records, Salesforce's Data Mask & Seed masks sensitive CRM data in sandboxes, and our data masking guide explains the options.
When you refresh a sandbox, Salesforce copies the source org's metadata into it, plus its data if the sandbox is a clone or uses a sandbox template. Afterward, re-import your reference data from Git so the sandbox is back in sync, and see our sandbox environment types guide for what each type copies.
6. Test a restore
Test a restore before you need one to fix a real mistake. Change a test record, restore an earlier version into a test org, and check that the restore was successful, with its relationships to accounts and other records intact.
Do the same with a recently deleted record once the Recycle Bin window has passed, so your team knows the whole data management process works. Our guide to recovering deleted records shows the built-in routes and where each one stops.
How does data version control help with audits?
Auditors want to trace a change to a person, a time and a reason. Field history and backups answer the first two automatically, and the reason has to come from your change management process.
For reference data in Git, the commit message carries that reason. For example, "Add 2027 price book entries for EMEA (Ticket SALES-1234)" lets you demonstrate far more to an auditor than "data update."
Limiting who can change reference data is part of good data governance, and it helps here too. If price book updates go through a pull request, a second person reviews each commit before it's imported.
If your organization is regulated, you may need history kept longer than the current defaults, so check your retention requirements before you configure anything. Trailhead's Field Audit Trail module notes that regulated industries often have to retain data history for many years, beyond what standard field history keeps.
Our Salesforce audit trail guide covers the compliance side in full. For SOX controls on who can change financial records, see our steps for SOX compliance in Salesforce.
Where Flosum fits
Backup & Archive is a Cloud App that runs on Flosum-managed AWS infrastructure or on a virtual machine you own, and backups are encrypted at rest and in transit.
For record history, Backup & Archive offers point-in-time restore to field, record, or full-org level. It protects Salesforce data, metadata, files, attachments, and complex object relationships, and Flosum archives with policy-driven retention and in-place query access.
Metadata history sits with a different product. In Flosum's DevOps Cloud App, Git is optional, not mandatory, and our post on backing up Salesforce metadata shows how that side works.
FAQs
How long does Salesforce keep field history?
Up to 18 months on the record page and up to 24 months through the API, according to Salesforce Help. With Field Audit Trail turned on, Salesforce retains the history until you delete it.
How many fields can you track with Field History Tracking?
Twenty per object. Field Audit Trail raises that to 200 tracked fields per object, and it requires Salesforce Shield or a Field Audit Trail license.
Is the Salesforce Recycle Bin a backup?
No. It holds deleted records for 15 days by default, then Salesforce schedules them for permanent deletion, and it doesn't help with record changes to records that still exist.
Can you store Salesforce records in Git?
Yes, for small datasets. The Salesforce CLI's data export tree command writes records as JSON files for version control, and Salesforce suggests it for fewer than 3,000 records.
What's the difference between data and metadata version control?
Metadata version control tracks how the org is built, such as fields, layouts and flows. Data version control tracks the records inside it, which change through daily use rather than deployments.
Book a demo to see how Flosum Backup & Archive restores Salesforce records to an earlier point in time.
Thank you for subscribing




