InnerWeb
Skip to main content

Backup and Trial Run Before a Migration Write: Best Practices

Writing the plant structure to the target environment should be reversible and checkable before approval. Three elements together most reliably provide this: a backup to an SQL file, a trial mode with rollback, and consistency gates with red tests.

1 m
inward offset of the building from the wall in the line check
Source: migration documentation
0.1 m²
overlap threshold for lines in the independent check
Source: migration documentation

Why three safeguards, not one

The backup protects against data loss, the trial mode shows the effects without writing, and the gates catch logical errors that no backup can fix. Each closes a different class of failure, which is why the implementation team combines them into one procedure.

Structure migration is repeatable: each run builds the structure from scratch. This means the trial can be repeated until it is clean, and the target write is just one of the runs.

Practice 1: back up the structure to an SQL file before the write

Before every write we make a backup of the structure to an SQL file. The file is named with the date and the run identifier, and we check its presence and size with a directory listing command, we do not assume it was created. The backup lets us restore the state from before the migration even when the write went through but the result turned out wrong only after a week.

Consistency gates: expected result before the write

Consistency gates: expected result before the writeHorizontal bar chart: expected zero for each gate and an example result with errors in a trial.01020304050itemsLines outside the wallExpected value (Lines outside the wall): 0 items0Example of error on trial (Lines outside the wall): 3 items3Markers outside the lineExpected value (Markers outside the line): 0 items0Example of error on trial (Markers outside the line): 44 items44Overlapping linesExpected value (Overlapping lines): 0 items0Example of error on trial (Overlapping lines): 2 items2
  • Expected value
  • Example of error on trial
Source: Expected values from the gate rules; the error example is an illustration (markers: 44 from the migration documentation, others assumed)

Practice 2: write in one transaction with a trial mode

The write runs in a single transaction. The trial mode performs all steps, counts the gates and at the end rolls back the changes. The result of the trial is a report: how many records would be created, how many changed, how many gates are non-zero. Only after a clean report do we run the write with confirmation.

One transaction means that an interruption in the middle does not leave the structure in an intermediate state. Either the whole write goes through, or no trace of it remains.

Practice 3: consistency gates with a red test

The migration script does not save data if any consistency gate is non-zero. Examples of gates: number of lines extending beyond the building wall (expected 0), markers outside their line area, overlapping lines. The interior of the building is reduced by 1 m from the wall, and the line shape is clipped to the interior and checked vertex by vertex.

A gate without a red test is a hypothesis. That is why every gate has a test in which we inject an old error and check that the gate lights up. A green result from a gate that never lit red proves nothing.

Practice 4: a second check through a different route

After the write we read the result through a different route: via the editor API, not through the same script that wrote it. The check looks for overlapping lines larger than 0.1 m², lines entering the wall and pins lying inside a line. We compare the state by content, that is by name, area, level and geometry, not by identifiers, because identifiers change with each run.

A script that assesses itself repeats its own assumptions. The second check is cheap, and it catches errors that the first check considered normal.

  • overlapping lines above 0.1 m²,
  • lines entering the building wall,
  • pins lying inside a line,
  • comparison by content, not by identifiers.

Order of actions on the day of the write

The day of the write is worth breaking down into steps that you tick off in order: backup, trial mode, review of the report, write, second check, decision to keep or roll back. Each step has an owner and proof, for example the backup file name, the number of gates equal to zero, the result of the independent check.

InnerWeb works as an independent system supplementing the client's systems, so writing the structure does not require an interruption of access control, time attendance or ERP.

Checklist

Video

Frequently asked questions

Is a backup enough if I have a trial mode?

No. The trial mode does not protect against an error found only after approval, while a backup lets you restore the state from before the migration.

Why a red test for a gate?

A gate that never lit red does not prove it will catch an error. An injected old error confirms that the gate works.

Why compare by content rather than by identifiers?

Identifiers change with each run because the structure is built from scratch. Name, area, level and geometry are stable.

Let's plan a trial migration

We will go through the backup, the trial mode and the gates on sample data with your team. Book a talk or a demo.

Let's talk