Skip to main content

Move a company between installs

An MSP or administrator can move a single company between MonoPbx installs — self-hosted to self-hosted, self-hosted to MonoPbx Cloud, or server to server — without taking a full-server backup. The company is packed into one encrypted archive file on the source install, then unpacked into a brand-new company on the target. Nothing on the source install is ever changed or deleted.

:::note Console coming soon Today this is a command the person with shell access to the install runs (mpbx tenant export / mpbx tenant import). A Console page for company admins and MSPs/partners is planned; this guide will be updated once it ships. :::

What moves, and what does not​

CategoryMoves?Notes
Configuration (users, extensions, trunks, queues, IVRs, dial plan, settings, roles…)AlwaysEverything except the categories below.
Credentials (trunk passwords, API keys, saved integration secrets)NeverRemoved on export. Re-enter them after import — see below.
Voicemail, recordings, call history, chat/SMS history, faxes (metadata)With --include-dataPostgres rows only.
Call detail records (CDR)With --include-data, when ClickHouse is configuredOpt out with --no-clickhouse.
Recording, voicemail and fax audio/document bytesWith --include-data, when object storage is configuredOpt out with --no-objects.
Numbers, trunks, devicesNot automaticallySee Numbers and trunks need re-binding below.

A number, DID or trunk belongs to at most one company on a whole install — exporting a company's configuration never implies anything about numbers on a different install, and importing never claims a number another company on the target install already holds.

If any legal hold — of any scope: company, user or number — is active on the company, --include-data is refused unless you also pass --include-held-data and --hold-reason <text>. Doing so is written to the company's audit log, naming every active hold's case reference. Configuration alone is never gated by a hold: a hold covers customer data, not the fact that a trunk or a ring group exists.

Exporting​

mpbx tenant export --company <uuid> --out <file> \
[--include-data [--include-held-data --hold-reason <text>]] \
[--no-clickhouse] [--no-objects] \
(--passphrase-file <path> | --passphrase-stdin)
  • --company <uuid> — the company to export.
  • --out <file> — where to write the archive.
  • --include-data — also export voicemail, recordings, call history, chat/SMS history, faxes, call detail records and the recording/voicemail/fax bytes themselves (subject to the opt-outs below). Without it, only configuration is exported.
  • --no-clickhouse / --no-objects — leave call detail records, or the recording/voicemail/fax bytes, out of an --include-data export even when ClickHouse or object storage is configured on this install.
  • The passphrase seals the archive with the same encryption a backup uses (Argon2id, AES-256-GCM in authenticated chunks). There is deliberately no command-line flag for the passphrase itself: pass --passphrase-file <path> (a 0600 file), --passphrase-stdin, or run on a terminal and you will be prompted. Keep the passphrase — without it, the archive cannot be opened.

The archive records the table and object counts, total size, and whether any held data was included. Nothing is written to the source company; this command only reads.

Importing​

Import always creates a brand-new company — it never merges into or overwrites an existing one. Always run a dry run first and resolve anything it reports before applying.

1. Dry run​

mpbx tenant import --archive <file> --dry-run \
(--passphrase-file <path> | --passphrase-stdin)

This reports, without writing anything:

  • Tables the archive has that this install's schema does not (these rows are skipped, not a failure — usually means the target needs an upgrade first).
  • Tables that hold a redacted credential column: re-enter those after import.
  • Conflicts — a value that already belongs to another company (or still belongs to the exporting company itself, on the same install) that import would otherwise fail on, such as a DID already claimed elsewhere.
  • Whether the archive was written by a newer schema than this install has applied, in which case import is refused until this install is upgraded.

2. Apply​

mpbx tenant import --archive <file> --apply --name <name> --slug <slug> \
[--no-clickhouse] [--no-objects] \
(--passphrase-file <path> | --passphrase-stdin)
  • --name / --slug — the new company's name and slug.
  • --no-clickhouse / --no-objects — leave call detail records, or the recording/voicemail/fax bytes, out of the import even though the archive carries them and this install has ClickHouse or object storage configured. An install with neither configured leaves them out automatically, the same as a table this install's schema does not have.

Re-run --apply as many times as you need: an object (recording, voicemail or fax file) already copied to the destination with the matching size is never uploaded again, so continuing after a cut-off run is safe.

Re-enter credentials​

Trunk passwords, SIP credential secrets, saved integration API keys and the like are never carried across — the dry run lists which tables held one. Re-enter each one on the new company before relying on it.

Numbers and trunks need re-binding​

A DID, a trunk's main number, or a provisioned device are not automatically rebindable to a brand-new company: re-bind each number or trunk to its real carrier connection, and re-provision each device, on the target install after import. The dry run's conflict list tells you which numbers, if any, are already claimed elsewhere on the target install and must be freed or changed first.

  • Backup and restore — a full-server, scheduled backup, as opposed to one company's one-time move.
  • Customer offboarding — handing a company to a different reseller inside the same install.
  • Legal hold — what an active hold gates, and how to release one.