Skip to main content

XenForo Resource Manager (XFRM)

Migrates an existing XenForo Resource Manager 2.3+ library on the same XF installation into Downloads Manager.

Because the source is the current XF database, no external connection is needed. User IDs, attachment data rows, tag IDs, and content-vote rows are reused directly.

Requirements

  • XenForo Resource Manager 2.3.0 or newer, installed and active.
  • Source data lives in the current XF database (xf_rm_* tables).

Base configuration

The XFRM importer has no base-configuration fields. The only validation performed at this stage is:

  • XFRM is installed and active.
  • XFRM is at version 2.3.0 (version_id ≥ 2030031) or newer.

If either check fails, the import will not proceed.

Step configuration

The configuration screen lists every XFRM category, prefix group, prefix, and custom field with a per-row choice of:

  • A target Downloads Manager record to map to, or
  • Create new, or
  • Skip.

It also exposes three flags:

FlagDefaultEffect
Import non-visible resourcesoffWhen off, only resource_state='visible' rows are imported. When on, moderated and deleted rows come across too (their state is preserved on the Downloads Manager side).
Import reviewsonWhen on, xf_rm_resource_rating is migrated to xf_mc_dm_review, and helpful-vote rows in xf_content_vote are re-anchored from content_type='resource_rating' to content_type='mc_dm_review'.
Import watchersonWhen on, xf_rm_resource_watch is migrated to xf_mc_dm_download_watch.

Step list

Steps execute in dependency order. Most are bounded by MAX(id) on the source table, so progress percentages reflect the actual workload.

#StepSource tableNotes
1categoriesxf_rm_categoryWalked by lft so parents are inserted before children. Nested-set and breadcrumb caches are rebuilt at end-of-step.
2prefixGroupsxf_rm_resource_prefix_groupTitles read from the resource_prefix_group.<id> master phrase.
3prefixesxf_rm_resource_prefixTitles read from the resource_prefix.<id> master phrase. Allowed-category list is remapped through the new category IDs.
4fieldsxf_rm_resource_fieldString IDs are converted to unique DM field IDs (25-char max) when collisions exist. field_choices and match_params are unserialised.
5resourcesxf_rm_resourceImports the resource itself plus the description from the resource's description_update_id. State is normalised to visible / moderated / deleted.
6versionsxf_rm_resource_versionSorted by release_date (used as version_int proxy) so the newest version shows first in DM. Changelog is left empty — XFRM has no version-to-update FK; admins can populate post-import.
7filesxf_attachment where content_type='resource_version'Each binary is streamed out via Flysystem, copied to a temp file, hashed (sha256), and re-stored via MC\DownloadsManager\Util\Storage::store under DM's PathScheme layout. Missing source files are logged and skipped.
8iconsxf_rm_resource where icon_date > 0Each icon is fed through Service\Download\Icon::setImage() / updateIcon() so DM's full variant set is generated.
9fieldValuesxf_rm_resource_field_valueBulk-inserted into xf_mc_dm_field_value using the new download/field IDs.
10reviewsxf_rm_resource_ratingMapped to xf_mc_dm_review. Helpful-vote rows in xf_content_vote are re-anchored to content_type='mc_dm_review' at end-of-step. Requires the matching version to have been imported.
11watchersxf_rm_resource_watchBulk-inserted into xf_mc_dm_download_watch.
12attachmentsxf_attachment where content_type='resource_update'Description/changelog attachments. A new xf_attachment row is inserted with content_type='mc_dm_download', and [ATTACH]<id>[/ATTACH] markers in the download description and version changelogs are rewritten to the new attachment ID.
13tagsxf_tag_content where content_type='resource'Bulk-inserted with content_type='mc_dm_download'.

Notes and caveats

  • Same-DB importxf_attachment_data rows are reused; only xf_attachment mapping rows are duplicated. No physical file is copied for description/changelog attachments. For version files, the binary is copied to DM's storage layout because DM uses its own path scheme rather than xf_attachment_data.
  • Version changelogs are empty — there is no FK from xf_rm_resource_version to its own update post, so the importer cannot reliably populate per-version changelogs. The resource's overall description is imported once on the parent download.
  • Counters — category counter caches are rebuilt at the end of the resources step. The XFRM source counters (downloads, views, ratings) are copied verbatim onto the new download row.
  • State mapping — XFRM version_state='moderated' collapses to DM version_state='visible'; moderation is captured at the download level. Review rating_state='moderated' similarly collapses to visible.
  • No prefix-group de-duplication — every XFRM prefix group is its own row. If you map one to an existing DM group, child prefixes follow the mapping.