๐ฆ Backup & Migration - Portable Backups for Flarum 2
A complete backup, export and import system for Flarum - bundles your forum
into a single .flarum file, restores it on the same install or a different
one, with optional libsodium encryption.

Inspired by All-in-One WP Migration, but written from scratch with a custom
streaming format (no .wpress, no zip) so multi-GB backups never need to fit
in memory.
โจ What it does
- Single portable
.flarum file โ database, public/assets, storage,
and any installed extensions (workbench or vendor)
- Per-extension picker with a tag on each row showing whether it's
composer-managed or local
composer.json + composer.lock travel along when bundling extensions,
so vendor extensions stay reproducible on the destination
- Resumable progress on both export and import (4 MB per HTTP request)
with live progress bars and an upload % indicator
- Optional libsodium encryption โ sealed-box wraps a per-archive
XChaCha20-Poly1305 stream key. Public key in the database, private key
only in config.php
- Cross-server transfer โ encrypt to a foreign public key, paste the
matching private key at import time
- Automatic URL rewriting โ the source URL is recorded in the archive
header and rewritten across settings, posts.content and
posts.parsed_content when restoring on a different host
- Selectable restore โ per-section and per-extension checkboxes,
populated from the archive's manifest
- Plus: foreign-key-safe DDL replay,
node_modules/.git pruning,
dedicated "you've been logged out" screen when a DB restore replaces the
admin session
๐ธ Screenshots
Creating a backup

Selecting what to restore

After a successful restore

๐ฅ Install
composer require ramon/backup
php flarum migrate
php flarum cache:clear
Then enable Backup & Migration under the Extensions page.
๐ Links
It's MIT-licensed and on Packagist. Tested on Flarum 2.0 with MySQL 8 / PHP 8.3
and 8.5. libsodium is required only when you opt into encryption.
Would love feedback โ especially edge cases around vendor-extension restores
and giant archives. Bug reports and PRs welcome on GitHub. ๐