Download the PHP package ramon/mybb-migrator without Composer
On this page you can find all versions of the php package ramon/mybb-migrator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ramon/mybb-migrator
More information about ramon/mybb-migrator
Files in ramon/mybb-migrator
Package mybb-migrator
Short Description Migra fielmente um fórum MyBB (DVZ Hash) para o Flarum 2: usuários, senhas preservadas, grupos, permissões, fóruns, tópicos, posts (BBCode->Flarum), curtidas, menções, citações, assinaturas, mensagens privadas e enquetes.
License MIT
Informations about the package mybb-migrator
MyBB Migrator (ramon/mybb-migrator)
A faithful, ID-preserving migrator from MyBB (with the DVZ Hash password
plugin) to Flarum 2. It is a Flarum extension that ships a suite of
php flarum mybb:* console commands. Unlike a generic importer, it keeps the
original primary keys (uid -> users.id, tid -> discussions.id, pid -> posts.id,
fid -> tags.id, custom gid -> groups.id) so every cross-reference (likes,
mentions, quotes, polls, PMs, trader feedback) lands on the right row.
What it migrates:
- Users (IDs preserved) + original passwords kept working (MyBB classic and DVZ Hash / bcrypt), transparently upgraded to Flarum bcrypt on first login.
- Groups (custom groups, IDs preserved) and role mapping (MyBB Admin/Mod -> Flarum Admin/Mod, Banned -> suspended, Awaiting Activation -> unconfirmed e-mail).
- Forums -> Tags (hierarchy preserved) and per-forum view restrictions.
- Threads -> Discussions and Posts -> Posts, with BBCode -> Flarum conversion (s9e), mojibake repair, sticky/locked/soft-deleted flags, and extraction of user/post mentions.
- Likes, Subscriptions, Private Messages (->
fof/byobu), Polls (->fof/polls), iTrader feedback and Community Reviews (->huseyinfiliz/traderfeedback), avatars (URL backfill), signatures.
1. Requirements
| Requirement | Notes |
|---|---|
PHP ^8.3 |
with ext-pdo (MySQL) enabled — used to read the MyBB DB |
Flarum ^2.0 |
target install |
| MySQL/MariaDB | both the MyBB source DB and the Flarum DB |
| CLI access | the migration is run entirely through php flarum mybb:* |
Target Flarum extensions
These must be installed and enabled before migrating, because the commands write directly into their tables:
| Extension | Used for |
|---|---|
flarum/tags |
forums -> tags (required — content depends on tags) |
flarum/likes |
mybb:likes |
flarum/mentions |
user/post mentions extracted by mybb:content |
flarum/subscriptions |
mybb:subscriptions |
flarum/suspend |
banned users -> suspended |
flarum/sticky |
sticky threads -> is_sticky |
flarum/lock |
closed threads -> is_locked |
flarum/approval |
soft-deleted / unapproved state |
flarum/bbcode + flarum/markdown |
rendering of converted BBCode |
fof/byobu |
private messages |
fof/polls |
polls + votes |
fof/upload |
attachments / uploaded files |
huseyinfiliz/traderfeedback |
iTrader + Community Reviews |
michaelbelgium/mybb-to-flarum |
optional companion — see below |
About michaelbelgium/mybb-to-flarum
You do not need it at all. This extension has no admin settings page of
its own — the MyBB database credentials are supplied via CLI flags and the
extension stores them itself (see Configuration below). All data logic lives in
this extension's own mybb:* commands.
The companion extension is only useful for copying the physical files
(avatars / attachments) into public/assets/..., since this migrator only
backfills users.avatar_url and references attachments — it does not move files.
If you copy those files manually, you can skip the companion entirely.
Note on settings keys: the credentials are stored under the keys
mybb_host,mybb_port,mybb_user,mybb_password,mybb_db,mybb_prefix. These happen to be the same keys the companion extension uses, so if it is installed, filling its admin page is just an alternative way to set the same values. The values are written by this extension's commands regardless — no companion required.
2. Installation
Enable the extension in the Admin panel. Make sure all target extensions above are installed and enabled first.
2.1. Quick start (full command sequence)
Copy-paste, edit the credentials on the first line, and run from the Flarum
root (d:\laragon\www\flarum). Only the first command carries the connection
flags — every later command reuses them from settings.
Tip — stop on first error. Wrap Phases 1–2 in a loop so a failure halts the whole run (each step depends on the previous one):
Then run the Phase 3 clean-up passes you need (see §4). Linux/macOS users:
replace ^/backtick line breaks with \ and run under bash.
3. Configuration (MyBB database connection)
This extension has no admin UI. You point it at the MyBB database entirely through CLI flags. Each command resolves the connection in this priority order:
- the CLI flag you pass (
--host,-u,-p, ...); - otherwise the value previously stored in Flarum
settings; - otherwise a built-in default.
After resolving, it writes the values back to settings — so you pass the
flags once (on the very first command) and every later command only needs
--force. No settings page, no companion extension required.
Every command shares these options:
In this project the live MyBB tables used the prefix
dfsmybb_.
Example (first command sets and stores the connection):
After that, later commands can be run with just --force.
4. Migration order
All write commands require
--force. Most support--dry-runto preview. Run from the Flarum root:php flarum <command>.
Recommended order at a glance
The order below is not arbitrary — it is the exact sequence enforced by the ID/foreign-key dependencies between MyBB and Flarum. Run the phases top to bottom.
| Phase | # | Command | What it does |
|---|---|---|---|
| 0 (optional) | — | mybb:wipe |
clears Flarum content for a clean re-run |
| 1 — Core | 1 | mybb:groups |
custom groups (gid≥8), IDs preserved |
| 2 | mybb:users |
users (uid=id), captures passwords, maps groups | |
| 3 | mybb:avatars |
backfills users.avatar_url |
|
| 4 | mybb:tags |
forums → tags (fid=id) + hierarchy | |
| 5 | mybb:content |
threads → discussions (tid=id), posts (pid=id), BBCode→Flarum, mentions | |
| 6 | mybb:likes |
post likes | |
| 7 | mybb:permissions |
default + custom-group permissions | |
| 8 | mybb:forum-perms |
per-forum view restrictions → tag perms | |
| 2 — Secondary | 9 | mybb:subscriptions |
thread/forum follows |
| 10 | mybb:messages |
private messages (fof/byobu) |
|
| 11 | mybb:polls |
polls + votes (fof/polls) |
|
| 12 | mybb:trade-feedback |
iTrader (traderfeedback) |
|
| 13 | mybb:reviews |
Community Reviews (traderfeedback) |
|
| 14 | mybb:make-admin |
promote your own account to Admin | |
| 3 — Cleanup | — | mybb:fix-* / mybb:revert-* |
data-specific fidelity passes — run only what you need |
⚠️ Golden rule: if any command fails, stop and fix it before continuing — each step depends on the previous one. Always back up the Flarum database before you start, and use
--dry-runfirst wherever it is available.
Before you start, confirm:
- [ ] Flarum DB backed up.
- [ ] All target extensions (§1) installed and enabled.
- [ ]
php flarum migraterun (createsmybb_legacy_passwords). - [ ] MyBB DB credentials known (host/port/user/password/db/prefix).
Phase 0 — Preparation
Phase 1 — Core data (order matters — IDs/foreign keys depend on it)
Why this order:
- groups before users — users get attached to custom groups by ID.
- users before content — posts/discussions reference
user_id. - tags before content — discussions are attached to tags (
discussion_tag). - content before likes/mentions/quotes — those reference
posts.id/discussions.id, which are only correct because content preservespid/tid.
Phase 2 — Secondary content (after users + content exist)
Phase 3 — Content clean-up / fidelity passes (run as needed)
These are idempotent fix-up passes over already-migrated content. They were created to repair specific artifacts found in this forum's data (Tapatalk emoji, mojibake, literal BBCode that didn't parse, quote/mention styling, signatures). Run only the ones you need; safe to re-run.
Do not run them all blindly. They are specific to your dataset and some are opposites of each other (e.g.
restore-quote-mentions↔revert-quote-mentions,fix-quotes↔compact-quotes) — running everything would undo itself. Migrate Phases 1–2 first, look at the live forum, then apply only the passes you actually need. The most commonly needed ones arefix-charset,fix-smilies,fix-emojis,normalize-bbcode,fix-user-mentionsandfix-signatures.
Helpers / diagnostics
5. How passwords keep working
MyBB stores either the classic hash md5(md5(salt) . md5(password)) or, with
the DVZ Hash plugin, a bcrypt hash ($2y$..., sometimes bcrypt over the
classic md5).
mybb:userscopies each original hash/salt/algorithm into the companion tablemybb_legacy_passwords(created by this extension's migration).- A custom Flarum password checker (
mybb-legacy, seesrc/Auth/MybbPasswordChecker.php) intercepts logins:- if a legacy row exists, it verifies the password the MyBB way
(
src/Support/MybbPassword.php); - on success it re-hashes to Flarum bcrypt, saves, and deletes the legacy row — so each user is upgraded transparently on first login.
- if a legacy row exists, it verifies the password the MyBB way
(
No password resets, no e-mails — users log in with their existing credentials.
6. Architecture
Design notes:
- Reads MyBB with a buffered cursor for small sets and an unbuffered
cursor (
MybbDatabase::cursor()) for large tables to keep memory flat. - Writes in batches (200–2000 rows) with
FOREIGN_KEY_CHECKS=0around bulk inserts. mybb:contentself-cleans the Flarum content tables before re-importing, so it can be re-run safely.
7. Caveats
- The fix-up passes in Phase 3 are data-specific: they target artifacts seen
in this particular forum (Tapatalk, DVZ Hash, double-UTF-8 mojibake). Review
each before running on a different dataset; always try
--dry-runfirst where available, and back up the Flarum DB. - Avatar/attachment files are not copied by this extension — use
michaelbelgium/mybb-to-flarumor copy them manually intopublic/assets/. mybb:wipeis destructive (clears Flarum content). It keeps schema, core groups and settings, but use it only on a throw-away/staging install.
8. License
MIT.