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
- Expected value
- Example of error on trial
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