# Parity checks

> Measure the old and the new server side by side over the network (pages, certificates, mail reception, IMAP, POP3, submission and FTP) and compare mail per folder, gently enough that the source never bans you.

Source: https://www.berthpanel.app/library/parity-checks/ · Category: migration · Updated: 2026-10-29

Before you switch customers to Berth, you want evidence that their sites and mail behave the same as on the old server. The parity report measures both servers from the outside, per domain, and gives every check a verdict. A separate mail check compares every mailbox folder. Both work for every source (Plesk, cPanel, DirectAdmin or Berth) and are part of the migration console described in [Migrating a server](https://www.berthpanel.app/library/migrate-a-server/).

## Where to find it

On the migration's page, the card *Parity* shows the latest result with **Compare source and Berth** and the baseline. *Report and notes* opens the full report with every domain, check and verdict, the earlier reports and your notes.

```bash
berth migration parity run --id 1 --mode baseline    # baseline of the source
berth migration parity run --id 1                    # source and Berth now
berth migration parity run --id 1 --mode after       # after the cutover
berth migration parity show --id 1 --format csv      # exit code 1 on differences
berth migration parity list --id 1
```

## What is measured

Per domain:

- **Pages**: the home page and five other pages (configurable with `--pages`, up to 25). The pages are found on Berth, from the sitemap and the home page's links; the source is then asked only for pages that exist on Berth. Per page: status code, redirect target, title, length (within a 15 % margin) and the security headers.
- **Certificate**: valid or not, the names, days remaining and issuer.
- **Mail reception**: the MX with STARTTLS and an `RCPT` check for up to five known addresses and one made-up address, in one connection, without sending any mail.
- **Mail and FTP services**: IMAPS, IMAP, POP3S, POP3, submission (587), SMTPS (465) and FTP with explicit TLS. Is the port open, what does the banner say, is TLS offered, which certificate, which capabilities.
- **A login attempt** with a test account, if you provide one (see below).

In `after` mode the report also compares the DNS records.

## Verdicts

| Verdict | Meaning |
|---|---|
| *equal* | the same on both servers |
| *difference* | counts as a difference |
| *note* | says little, for example a banner text or an extra IMAP capability |
| *explained* | a known difference, with the reason |
| *not measured* | the source refused us or its budget ran out; not a difference, but the report is incomplete |

Berth explains some differences itself: another web server or HTTP version, and another certificate for the same names. A security header that Berth sets and the source does not (`X-Content-Type-Options`, `Referrer-Policy`, `Permissions-Policy`, `X-Frame-Options`, `Content-Security-Policy`) is *note* "Berth stricter"; a different value than on the source remains a difference.

In `live` mode, for accounts that are migrated while the source still runs, two things are expected and therefore explained: inbound mail that Berth answers with a temporary `450`, and mail services that still show Berth's own certificate (the source's names and certificates arrive at the cutover). A different status, title or content always remains a difference.

### Known differences

What you know about, for example a site relaunched after the baseline, you record as a note under *Known differences*. Domain and field may be patterns, such as `example.*` and `https.title`. Matching checks then get the verdict *explained* with your reason.

```bash
berth migration parity note add --id 1 --domain 'example.*' \
  --field https.title --reason 'new site launched after the baseline'
```

## Three modes

| Mode | What it measures | When |
|---|---|---|
| `baseline` (*Baseline of the source*) | only the source, on its own address; pages from its home page links; stored | well before the cutover |
| `live` (*The source and this server now*) | first Berth, where the pages are found, then the source with the same pages; the source measurement becomes the newest baseline | before the cutover |
| `after` (*This server after the cutover*) | Berth as the outside world sees it (through DNS), against the newest **valid** baseline, including DNS records | after the cutover, when the source is gone |

Take a baseline early. After the cutover the source no longer exists, and the baseline is what you compare against.

## Gentle on the source

The source is a server you may not control, often with fail2ban, cPHulk, the DirectAdmin Brute Force Monitor or CSF/LFD. The measurement is designed to work without whitelisting anything there, and to stay well below such limits:

- all traffic to the source goes over **one connection at a time**, with a pause between connections and a cap per time window;
- nothing is guessed on the source: no `robots.txt` or `sitemap.xml`, only pages that exist on Berth;
- there are separate budgets for 4xx responses and for SMTP address refusals; when one runs out, further checks of that kind are skipped and marked *not measured*;
- a test account gets at most one login attempt and is never retried after a failure;
- a closed port is not tried again.

Correctness comes before completeness: better to measure less than to get banned. With many domains, the source side can take up to about an hour. The limits are adjustable with `--source-gap`, `--source-max-conns`, `--source-4xx-budget` and `--source-5xx-budget` (API: `source_limits`), but raising them is rarely wise.

### When the source blocks anyway

If the source refuses a connection that worked earlier in the measurement, or its web port does not answer from the start, Berth treats it as a block: from that moment **nothing** more is sent to the source, so a block never turns into a second ban. Everything after it is *not measured*, and the top of the report says that the source refuses connections from Berth's address since a given time, probably because of fail2ban or a firewall.

Wait until the ban expires and measure again. Faster, but never required: add Berth's address as a trusted address on the source (Plesk's trusted IP addresses, the cPHulk whitelist, DirectAdmin's Brute Force Monitor whitelist, the CSF allow list). That is an action of the source's administrator; Berth never changes the source.

A baseline taken during a block is stored but marked **invalid**. `after` then uses the newest valid baseline and says so, and refuses if there is none, unless you pass `--accept-invalid-baseline` deliberately. The CLI exits with code 1 on an incomplete report or an invalid baseline.

## Test accounts for a login check

To include a login on IMAP, POP3, submission and FTP, give the CLI a JSON file with test accounts per domain. It must have mode 0600:

```json
{
  "example.nl": {
    "mail_user": "test@example.nl",
    "mail_pass": "…",
    "ftp_user": "acme_test",
    "ftp_pass": "…"
  }
}
```

```bash
berth migration parity run --id 1 --accounts-file /root/test-accounts.json
```

Passwords exist only in the memory of that one command. They never go into a task, report or log, and are only sent over TLS; without TLS, no login is attempted. The panel and the API therefore start measurements without login attempts.

## The mail check

Separately from the parity report, the migration's **Check** task compares mail per mailbox and folder: the number of messages, `UIDVALIDITY` and `UIDNEXT` on the source (read-only, from the file list and the `dovecot-uidlist`) against what Dovecot shows here, which is exactly what a mail client will see after the cutover.

- **Problem**: something a mail client would notice, such as a different `UIDVALIDITY` (the folder would be downloaded again) or mail that did not come along.
- **Behind**: a copy from before the latest mail on the source (fewer messages, or a lower `UIDNEXT` with the same `UIDVALIDITY`). A mail sync resolves it, and after the final sync of the cutover it must be zero.

Phase 1 of the cutover runs this comparison for every account; an account only turns green when all its folders match.

```bash
berth migration run --id 1 --kind check --wait
```

The check also covers the websites against the old server and the reception of every mail address. Results appear per account on the *What carries over* card.

## Measuring outside the panel

The standalone tool `berth-probe` performs the same measurements from any machine, for example from outside your network. Measure Berth first, then the source with the same pages and with `-source` (which applies all the protections above), then compare:

```bash
berth-probe -services -pages 5 -domains domains.txt -connect 192.0.2.20 > berth.jsonl
berth-probe -source -services -pages-from berth.jsonl -domains domains.txt \
  -connect 192.0.2.10 > source.jsonl
berth-probe parity --dns source.jsonl berth.jsonl
```

Never measure a source without `-source`. It exits with code 3 when the source blocks.

## API and AI integration

- `GET /api/v1/migrations/{id}/parity` for the overview and report, and `…/parity/export?format=csv|json|text`;
- `POST …/parity/notes` and `DELETE …/parity/notes/{note}`;
- start a measurement with `POST /api/v1/migrations/{id}/jobs` and `{"kind":"parity","options":{"parity":{"mode":"live"}}}`.

The [AI integration](https://www.berthpanel.app/library/ai-assistant-and-mcp/) has `migration_parity` and `migration_parity_run`. See the [REST API](https://www.berthpanel.app/library/rest-api/).

## Related

- [Moving to Berth](https://www.berthpanel.app/library/migration-overview/)
- [Migrating a server](https://www.berthpanel.app/library/migrate-a-server/)
