Data 360 Inspector

Features · Health and governance

Compare two orgs

Sandbox against production, with a deployment checklist.

Video coming soon.

From the article Is my Data Cloud sandbox the same as production? (part 27 of the series).

Before a Salesforce Data Cloud release, someone always asks "what is different between the sandbox and production?" The usual answer is two browser windows side by side, scrolling through Data Model Objects (DMOs), segments and calculated insights, and hoping the eye catches a field type or a changed WHERE clause. It rarely does, and the difference turns up after go-live, when a segment in production counts a different set of people from the one everyone tested.

Two orgs, one data space

Compare works with the orgs you are logged in to in this browser. If only one is, the page says so and asks you to log in to the second org in another tab, then choose Find orgs again in the connection menu.

Pick the first org and the second, then the data space. The data space list holds every data space of either org.

The first org is the reference. The note under the form says so, and it matters for the deployment checklist later: the checklist says what to create or change in the second org so it matches the first. For a release I put the sandbox first and production second. To bring a sandbox up to date with production, it is the other way round, and that is what I did for the pictures below.

The pencil next to each org names it. I named my two orgs "Production" and "UAT sandbox", and the picker shows the name with the my-domain host in brackets. The names then appear in the result, the report and the checklist instead of two long hosts that differ by one word.

Choose what to compare

The checkboxes under the orgs choose what is read:

  • Objects and fields: every Data Lake Object (DLO), DMO and calculated insight object, with field types, labels, primary keys, key qualifiers and relationships.
  • Data streams: label, DLO, connector, data source, source object and refresh.
  • Field mappings: which source fields fill each DMO field.
  • Identity rulesets: match rules, reconciliation rules, whether they run automatically and case sensitivity.
  • Calculated insights: type, schedule, SQL, dimensions and measures.
  • Segments: the object it is on, type, refresh, lookback, criteria and exclusion criteria.
  • Activations: segment, target, attributes and how they are sent, contact points, filters and refresh settings.
  • Data graphs: the primary object, and the objects and fields in the graph.

Field mappings are off by default, because they take one call per DMO, often 100 or more per org, and the checkbox says so next to its name. Hovering a checkbox shows roughly how many calls it costs per org, and the page remembers your choice.

Compare runs in the background. While it reads, a line shows each org's step, for example "Production: data graphs read; UAT sandbox: done, 11 calls", and you can use other pages meanwhile. When it finishes, the line above the result says which orgs and data space were compared, when, and how many calls each org took: 15 and 11 here.

Compare two orgs with Production as the first org and UAT sandbox as the second, data space default, every box ticked except Field mappings. Below the Compare button, the result line reads "Compared Production and UAT sandbox, data space default (15 and 11 calls)", followed by the errors from the sandbox and four notes saying Objects and fields, Data streams, Identity rulesets and Activations were not compared.

When one org cannot answer

My UAT sandbox turned out to have no Data Cloud set up. Its metadata API answers "Couldn't find CDP tenant ID", and data spaces, data streams, identity resolution and activations answer FUNCTIONALITY_NOT_ENABLED.

Compare does not treat that as "everything is missing". Each kind that one org could not read is left out, with a note saying it was not compared and why, and the errors from each org are listed above the result. Calculated insights, segments and data graphs did answer in the sandbox, with empty lists, so those three were compared.

What is compared, and what is ignored

Items are matched by their API name. An item in only one org is listed under "Only in" that org, and an item in both orgs is compared on its definition.

IDs, dates, counts and statuses are ignored. A segment that published yesterday in one org and last week in the other is the same segment, and a data stream with more rows in production is the same stream. What counts is what was built: the fields, the rules, the SQL and the criteria.

SQL gets one more step. Before two calculated insights are compared, comments are removed, spaces collapsed and everything outside quoted values is put in lower case, so a reformatted query does not show as a change.

The result

The result starts with a tile for each kind that was compared: only in the first org, only in the second, changed, and the same. Clicking a tile jumps to that kind.

In my comparison, production has 3 calculated insights, 6 segments and 2 data graphs that the sandbox does not, and nothing is changed or the same, because the sandbox has none of them yet. Each kind opens to two lists side by side, one per org, with the label, the API name and, for a segment, the object it is on.

The Compare result: three tiles, Calculated insights with 3 only in Production, Segments with 6 and Data graphs with 2, and 0 only in UAT sandbox, changed or the same. Below, Filter by name, Show only differences and Inline or Side by side, then the Calculated insights and Segments lists of what is only in Production.

When an item exists in both orgs with a different definition, it is listed under Changed, and the differences show in three ways, depending on what changed:

  • Lists of what exists on one side only, such as fields or relationships only in one org.
  • A table of changed values, such as a field whose type is Text in one org and Number in the other.
  • A line diff for longer text: calculated insight SQL, match rules, reconciliation rules, segment criteria in plain words, and activation filters.

The line diff shows inline (minus and plus lines) or side by side, and Filter by name narrows the result. Show only differences hides the kinds and items that are the same, and unticking it lists those too.

Report and deployment checklist

Download report gives the full comparison as Markdown, Word, PDF or HTML, with the line diffs, or as Excel with a Summary sheet and a Differences sheet.

Deployment checklist is the one I share before a release. It lists the steps to make the second org match the first, kind by kind in deployment order (objects before the streams and mappings that use them, segments before activations). Within each kind:

  • Create what is only in the first org (Map, for field mappings).
  • Change what differs, with the differences in a line.
  • Review what is only in the second org: it says to remove it there if the first org is the reference.

Mine has 11 steps: create the 3 calculated insights, the 6 segments and the 2 data graphs in the UAT sandbox. Its first line also names the kinds that were not compared, so nobody reads a short checklist as "nothing else to do".

The deployment checklist viewed as Markdown: "Deployment checklist: UAT sandbox to match Production", 11 steps in deployment order, not compared Objects and fields, Data streams, Identity rulesets and Activations, then tables for Calculated insights, Segments and Data graphs where every step is Create.

Nothing is removed or created for you. Compare only reads, and the checklist is a document for the person doing the deployment.

Limits

A few things to know:

  • Items are matched by API name, so an item renamed in one org shows as only in one and only in the other.
  • When a kind cannot be read in one org, the page says it was not compared, with the reason, instead of listing everything as missing. An activation or data graph whose definition could not be read only counts as present.
  • An org without Data Cloud can still answer some kinds with empty lists, as my sandbox did, and then everything of that kind shows as only in the other org.
  • Field mappings are slow on large orgs: one call per DMO, per org.
  • Only one data space is compared at a time. When both orgs list their data spaces, those that exist in only one org are listed above the result.
  • The comparison is kept until the browser closes, not longer. Download the report to keep it.