Case study · Data migration

A migration that stops when the data is wrong.

Designed, built and tested by HyperScale.

We built a staged pipeline that counts and checks data before it reaches the target, and we test it on public and generated datasets. Below is one rehearsal in full: New York City’s public restaurant-inspection file, 295,481 rows, run in March 2026 on our earlier pipeline.

The March run’s report, summary · generated 6 April 2026
The March run’s report, summary · generated 6 April 2026
Rows in one flat, messy public file
295,481
The March rehearsal, on our earlier pipeline
4 min 30 s
Records left orphaned after the split
0
  1. 01The problem

    Real data arrives messy

    New York City publishes every inspection as one flat file. Each row repeats the restaurant and the visit, some rows record no violation, and some visits are dated 1 January 1900. A migration of data like this can lose or change rows quietly, and the damage is often found only after the old system is gone.

  2. 02What we built

    A staged engine that checks before it loads

    An eight-stage pipeline from PostgreSQL to PostgreSQL, plus a separate CSV import service. Row counts, null checks and type checks run before a load, and before a cutover can be queued a second staff member must sign off.

  3. 03What it showed

    Bad data stopped the load

    In a deliberate failure test on the current engine, validation stopped the job, the load never ran and the target was untouched. In the March rehearsal below, on an earlier pipeline, 295,481 source rows became 3 linked tables in about 4 min 30 s, with no record left orphaned.

Built
March to November 2026
Stage
Engine tested on generated data; an earlier pipeline on public data
Ownership
HyperScale product, owned by 2413189 Ontario Inc.

One file in, three tables out

Each fact stored once, in the right place

The file wrote every restaurant and every visit out again on each violation. Split into three tables, each restaurant is stored once, each visit once, and each violation is linked to the visit it was found on.

One flat file295,481 rows
  1. Restaurants30,832
  2. Inspections93,673
  3. Violations289,754

How the run went

Read, split, checked

What each step did with this file, in the March rehearsal.

SRC-01Reading

Read the file

295,481 rows in one flat file, each repeating its restaurant and its visit.

Rows read295,481
ETL-02Splitting

Split and clean

Each restaurant and each visit stored once; impossible dates and empty rows set aside and counted.

Set aside9,152
DB-03Checked

Three linked tables

Row counts reconciled and every link between records checked against the source.

ChecksPassed

What the run set aside

Rows that could not be true, or held nothing at all, were set aside and counted, never loaded as if they were real.

What the run set aside
ItemCount
Rows with no violation5,727
Visits dated 1 January 19003,425

Where the 4 min 30 s went

Reading the file was the quick part. Most of the time went into building the three tables and linking them.

Where the 4 min 30 s went
ItemCount
Reading the file90 s
Building the three tables180 s

1,094 rows a second, start to finish

After the move

Every check on the result passed

  • Row counts reconcile

    Every source row is accounted for: loaded, folded into its restaurant or visit, or set aside and counted.

  • 0 orphaned records

    Every inspection has its restaurant, and every violation its inspection.

  • 0 conversion errors

    Every value that was loaded converted to its type without an error.

The run tested us too

Faults found in our own tooling

A rehearsal is for finding problems before real data is at stake. This one found faults in our own pipeline, and each was corrected.

  1. 01

    The review after the migration stopped without saying so

    An automatic review was meant to run after the migration. It was starting and then stopping without a word, because of three separate set-up faults. All three were fixed.

    For a client: a migration with no review behind it, and nobody aware.

  2. 02

    The review was reading an outdated map of our own system

    It looked for information under names that had since changed, so its findings would have been incomplete. Every lookup was checked against the system as it really is.

    For a client: a report that leaves things out without saying so.

  3. 03

    Checking a finished job twice raised false alarms

    Running the review again on a finished migration recorded worse figures and flagged four problems that did not exist. It was changed to recognise a job it has already measured.

    For a client: time lost chasing problems that are not there.

  4. 04

    Six of ten pre-flight checks could not run

    The safety checks that run before a migration needed a tool that was missing, so six of ten never ran. They were rebuilt so they no longer depend on it.

    For a client: starting a migration with less protection than promised.

Under the hood, for your technical teamShow details

The current engine runs eight stages from PostgreSQL to PostgreSQL and was tested on a generated 200,000-row dataset, with checksums asserted when the pipeline has not deliberately changed a table. A 400,000-row CSV import was killed at 49,400 rows and resumed with no duplicates. An earlier Airbyte-based pipeline produced the run on this page on 28–29 March 2026, and in the same month moved the public TPC-H benchmark (8,661,245 rows) with row counts and aggregate checksums matching. Before a cutover can be queued, a second staff member must sign off, and a 72-hour wait applies unless another named staff member approves it early.

Have a migration of your own?

We rehearse on a copy of your data first, and you sign off before anything moves.

Book a call