Skip to content

Phase 7: import from a running iForum installation - #8

Merged
fiammybe merged 2 commits into
claude/imforum-phase-6from
claude/imforum-phase-7
Nov 4, 2026
Merged

fiammybe merged 2 commits into
claude/imforum-phase-6from
claude/imforum-phase-7

Conversation

@fiammybe

Copy link
Copy Markdown
Contributor

Summary

Phase 7 of the rebuild (module version 1.0.0 Alpha 7). Stacked on #7: merge #6 and #7 first, then retarget this PR to main.

Importer and admin/import.php copy the data of a running iForum installation into imforum, keeping every id. The tables of iForum are only read.

  • Check (writes nothing): missing tables and columns, character sets, orphans (posts without topic or text, topics without forum, forums without category), posts that grow past 64 KB when converted, missing attachment files, and text that looks like UTF-8 inside latin1 columns.
  • Import: empties the imforum tables first, so an interrupted run is repeated from the start. It copies categories, forums, moderators (from the serialized list), topics, posts joined with their text (integer IPs become text), edit histories (base64 serialized list to JSON), attachments (from the posts and from the reserved table; names that could leave the upload folder are refused; files are copied and measured), reports, suspensions that have not ended, read marks (one per member and item), digests, the archive, group permissions under the id of imforum, subscriptions that imforum has events for, matching preferences and the cached permission template. Ratings, polls, tags and poll rights are left out. Counters are recounted afterwards.
  • Verify: row counts, posts per forum and per topic, a checksum of 200 random posts, rights and attachment files.
  • Roll back: empties the imforum tables and removes the copied rights, subscriptions and files.
  • Importing and rolling back ask for a confirmation and run only on a POST with a security token.
  • Option to read the text as UTF-8 bytes for sites whose old columns say latin1.

Test plan

  • Unit tests (42) and integration tests (116 assertions 1776) pass locally on MariaDB, also with MyISAM
  • PHPStan level 6 clean
  • Integration tests build an old iForum installation and check every table, the source staying unchanged, running twice, rollback, the latin1 case and the largest case (43,778 posts)
  • CI on MySQL 5.5, MySQL 5.7 MyISAM and MariaDB 10.11
  • Manual test by David on http://iforum.test (checklist in the thread)

Generated by Claude Code

Importer copies categories, forums, moderators, topics, posts, edit histories,
attachments, reports, suspensions, read marks, digests, the archive, rights,
subscriptions, preferences and the permission template, keeping all ids and
never touching the source. admin/import.php offers check, import, verify and
roll back. Module version 1.0.0 Alpha 7.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MZy45V5RV9nx6Buq8vqKHr
…at are not

A stock MySQL 5.5 creates the IPF tables as latin1, which the importer rightly
refuses. The test database now starts as utf8mb4, as a correctly set up site is.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MZy45V5RV9nx6Buq8vqKHr
@fiammybe
fiammybe added this pull request to stack #11 November 4, 2026 20:29
@fiammybe
fiammybe merged commit 3323468 into main Nov 4, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants