Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

Cloning: Exclude Table vs. Preserve Data

ctsmith
Mega Sage

Can someone go into a bit of detail on Excluding Tables and Preserving Data in a clone.  I think I had it a bit mixed up.

If you exclude a table, the documentation says: "Exclude a table to create an empty but usable table on the target instance."

So, if I exclude a table, it just creates the same table that was there with no data?  And is that the table that existed in the lower instance before the clone, now blank.  Or is it the table from PROD, blank (thinking if there are mismatches in fields between the two).

If you are preserving data on a lower instance, does that mean it keeps just that data, or does it mean it keeps that data AND adds the existing data from the PROD clone?

Let's say the scenario is this:

Table A in prod has record X.

Table A in dev has record Y.

I want Table A in dev with ONLY record Y after the clone, not Table A in dev with record X AND Y.

Let's say I want the freshest version of the table (which may be PROD) but I want the data from ONLY the lower instance that is being cloned.

 

Thanks!

 

10 REPLIES 10

adrianbissd
ServiceNow Employee

Added answers in line

When you exclude a table, the documentation says: "Exclude a table to create an empty but usable table on the target instance."

So, if I exclude a table, it just creates the same table that was there with no data?  And is that the table that existed in the lower instance before the clone, now blank.  Or is it the table from PROD, blank (thinking if there are mismatches in fields between the two).

When you exclude a table, Clone will copy over the table schema from the source. After the clone you will have the table from the source but it will be "empty" = no records.

If you are preserving data on a lower instance, does that mean it keeps just that data, or does it mean it keeps that data AND adds the existing data from the PROD clone?

Let's say the scenario is this:

Table A in prod has record X.

Table A in dev has record Y.

I want Table A in dev with ONLY record Y after the clone, not Table A in dev with record X AND Y.

Let's say I want the freshest version of the table (which may be PROD) but I want the data from ONLY the lower instance that is being cloned.
If your goal is to only keep the records from the target, you will need to add an Exclusion +  Preserver.

To illustrate all other scenarios, sharing a 2x2 matrix:P_E_cheat_sheet.png

 

Scenario 1: Preserving and excluding a table. You want the records on your target instance to remain the same.

Scenario 2: Preserving and not excluding a table. You want records on your target Instance to remain the same and records for your source instance to be copied over.
Note: if records share the same sysID, the preservers supersede.

Scenario 3: Not preserving and excluding a table. You want records from your source instance not to be copied over and records on your target instance to be removed: The table is empty but usable after the clone.

Scenario 4: Not preserving and not excluding a table. You want records from your source instance to replace records on your target instance.