Black Friday Sale: Get 30% OFF on All Plans!

How to Compare Salesforce Sandbox and Production Before a Release?

Published: Nov 27 2026

How to Compare Salesforce Sandbox and Production

Quick Answer:

Before a release, compare the two orgs in the order that dependencies run: objects and fields first, then validation rules, then profiles and permission sets, then list views, and finally code. Compare only what the release touches, look at the differences rather than the matches, and decide for each one whether it is intended. Salesforce has no single screen for this, so you combine Setup, change set or CLI tools, and a comparison tool where the manual route gets slow.

Every release has a moment where someone asks, “Is this already in production?” An admin built a field, a rule or a permission change in the sandbox, tested it, and now needs to be sure production will behave the same way once the change lands. A related question comes up when something works in one org and fails in the other, and nobody knows why.

Both questions have the same answer: compare the two environments, deliberately and in a sensible order. This guide explains why the orgs drift apart, what to compare and why, how to do it with the tools you already have, and where a dedicated comparison tool such as BOFC saves time.

Why Sandbox and Production Drift Apart?

A sandbox starts as a copy of production, but the copy begins aging the day it is created. These are the usual reasons the two diverge:

  • Direct fixes in production. A quick change is made live to solve an urgent problem and is never repeated in the sandbox.
  • Sandbox refreshes. A refresh brings the sandbox back in line with production, which silently removes any work that was never deployed.
  • Partial deployments. A change set carries the new field but not the validation rule, the layout or the access change that belongs with it.
  • Manual permission edits. Profiles and permission sets get adjusted in one org during testing and are forgotten in the other.
  • Several sandboxes. Each developer or admin works in a separate environment, and the changes are merged later by memory.

Knowing the cause tells you where to look first. If the symptom started after a refresh, check what was in flight. If it started after a hotfix, check production’s recent changes.

What the Native Tools Give You?

Salesforce offers a few ways to see differences, each with a limit.

  • Change sets show what you are about to send, and validating a deployment tells you whether it would succeed. They do not tell you how the target org differs from the source.
  • Setup Audit Trail lists recent configuration changes in an org, including who made them. It is excellent for explaining why something changed, but it records history, not a side-by-side comparison, and it only goes back about six months.
  • Salesforce CLI and VS Code can retrieve metadata from both orgs and diff the files. This is thorough for code and works well for developers, but it needs local setup and produces raw XML for things like profiles that is hard to read.
  • Opening each item in two browser windows works for a handful of items and breaks down quickly.

None of these gives an admin a quick answer to “what is different about this object, this profile or this rule between the two orgs?” That is the gap the rest of this guide fills.

Step 0: Scope the Release

You do not need to compare the whole org. List what the release touches: the objects and fields, validation rules, profiles and permission sets that need access, list views people depend on, and any Apex classes, triggers or Lightning components that changed. Keep this in a spreadsheet. It becomes both your comparison checklist and your sign-off record.

Step 1: Compare Objects and Fields

Start with the data model, because everything else depends on it. A rule, layout or permission that references a missing field will fail, so a missing or mismatched field is the first thing to rule out.

For each object on your list, look at three things:

  • Fields that exist in only one org
  • Fields that exist in both but differ in data type, length, required setting or picklist values
  • Differences in record types

Doing this in Setup means reading Fields & Relationships for the same object in two orgs. For a few fields that is fine. For an object with several hundred fields, a comparison tool is easier. BOFC’s Compare Objects and Fields lets you choose an object and two connected environments, then show everything, only the differences, or only the matches, so a long field list narrows down to the items that need attention.

Step 2: Compare Validation Rules

Validation rules are a common reason a release passes testing and then breaks something in production. A rule that exists only in production never ran against your sandbox test data, so a flow, an integration or a data load can fail after go-live. The opposite also happens: a rule in the sandbox that was never deployed will not protect production data.

Check each object in scope for rules that exist in only one org, and for rules that exist in both but have different formulas, error messages or active status. Pay attention to inactive rules. A rule deactivated in the sandbox for testing and forgotten there is a classic source of “it worked in the sandbox.”

You can read these in Setup, object by object. BOFC’s validation rule comparison puts the rules from both orgs next to each other and can filter to the rules that are common or that exist in only one org, which is the view that matters before a release.

Step 3: Compare Profiles and Permission Sets

A new field, object or page is only useful if the right people can reach it. Access differences are among the most frequent causes of “it works for me but not for the users,” because test accounts usually have broader permissions than real ones.

Compare the access that the release depends on:

  • Object permissions (read, create, edit, delete)
  • Field-level security for new or changed fields
  • Access to Apex classes and Visualforce pages
  • Record type assignments and tab or app visibility
  • System and administrative permissions

If you grant access through permission sets, compare those as well as the profiles. Many orgs have moved toward permission sets, and a gap in either one produces the same complaint from users.

Salesforce stores these as XML when you retrieve them, and the structure makes manual comparison slow. A tool can flatten them into a readable grid. BOFC does this with bulk profile comparison, where you can compare profiles between the current org and another connected org, and with permission set comparison, which exports several permission sets into one Excel file. Field permissions are compared on a separate page, so run that one too when fields are part of the release.

Step 4: Compare List Views

List views feel like a user preference, but many teams build their daily routine around them. A view that exists only in the sandbox, or that has different filters or columns in production, can confuse users on the first morning after a release.

Check that the views in scope exist in both orgs, that the filter criteria match, that the columns are the same, and that the visibility setting (private, shared with groups, or visible to all) is what you intended. Opening each view to read its filters is slow when there are many. BOFC’s list view comparison fetches the views for selected objects and exports their details to Excel, so you can scan them together.

Step 5: Compare Code Where It Applies

If the release includes Apex classes, triggers, Visualforce pages, Lightning Web Components or Aura components, confirm that the code in production is the version you tested against. Production code can change between your last refresh and your release through hotfixes, so do not assume it matches.

Developers usually do this with Salesforce CLI retrieval and a diff tool. Avoid pasting proprietary code into a public online diff checker, because that sends your business logic to a site you do not control. If you prefer to stay inside Salesforce, BOFC’s Compare and Sync shows classes, triggers, Visualforce, LWC, Aura and email templates side by side across connected orgs, with differences highlighted. It can also sync code in either direction, so treat that action with the same care as any production deployment and confirm the comparison again afterward.

What to Do With the Differences

Finding a difference is only half the job. For each one, decide which of three situations it is:

  1. Intended. It is part of this release and will be deployed. Note it and move on.
  2. Stale. The sandbox is behind production, usually after a hotfix. Bring the change back into the sandbox so future testing is accurate.
  3. Unexplained. Nobody on the team can say why it differs. Check the Setup Audit Trail in both orgs, ask the person who last changed it, and resolve it before you deploy.

Record the decision next to each item in your scope spreadsheet. After the deployment, run the same comparisons again. A clean result is the simplest proof that both environments now match.

Investigating an Unexpected Difference

When the trigger is a bug report rather than a release, work from the symptom outward and check the simplest explanations first:

  1. Identify the object, screen or record where the behavior differs.
  2. Compare the object’s fields, looking for a missing or changed field.
  3. Compare its validation rules, since a rule in only one org often explains a save error.
  4. Compare the access of an affected user, covering profile and permission sets.
  5. If automation is involved, compare the related Apex or flows.
  6. Check the Setup Audit Trail around the date the behavior changed.

Most causes turn up in the first three steps, long before you reach the code.

Pre-Release Comparison Checklist

  • List the objects, fields, rules, access changes, list views and code in the release
  • Compare each object and review the differences
  • Check validation rules that exist in only one org, and inactive rules
  • Compare profiles and permission sets, including field-level security
  • Check that the list views users rely on match
  • Compare changed Apex, Visualforce, LWC and Aura components
  • Mark each difference as intended, stale or unexplained
  • Resolve the unexplained ones before deploying
  • Run the comparison again after deployment and keep the results

Conclusion

Comparing a sandbox with production is less about any single tool and more about a repeatable order of checks: data model, rules, access, list views and code, reviewed by difference and recorded as you go. Setup, the Audit Trail and the CLI cover a lot of this for a small release. As the number of objects, profiles and permission sets grows, a comparison tool like BOFC takes over the repetitive reading so you can spend your time deciding what each difference means. Either way, the habit of checking before you deploy is what prevents most release-day surprises.

Like what you see? Share with a friend.

Frequently Asked Questions

Before every release, after every sandbox refresh, and after any hotfix made directly in production. Teams that release often also run a regular check so drift is caught early.

A refresh replaces the sandbox with a fresh copy of production, which removes any undeployed work. A deployment moves specific changes into an org and leaves everything else alone. Check what is still in progress before refreshing.

It depends on the type. Developer and Developer Pro sandboxes copy metadata only, Partial Copy sandboxes add a sample of data, and Full sandboxes copy everything. Data differences can look like configuration problems, so rule them out when troubleshooting.

Yes, but comparisons are done in pairs. A common approach is to compare each environment against production, since production is the source of truth for what users see.

Both. The first run catches gaps before they reach users. The second confirms the deployment landed completely and the two orgs now match.