Skip to main content

Invision Community 4 (Downloads)

Migrates an Invision Community 4.x Downloads library into Downloads Manager. The IC4 database lives on a different installation, so this importer connects to it as an external source over PDO and reads the IC4 uploads/ directory directly from disk.

The IC4 importer is a sibling of the IC5 importer. The IC4 and IC5 Downloads schemas are nearly identical (same table and column names for everything the importer touches), so the step list and per-step behaviour match the IC5 page very closely. This page focuses on what is different for IC4.

Requirements

  • An accessible IC4 database (host/user/password/dbname) — read-only access is enough.
  • Read access to the IC4 uploads/ directory from the PHP user running XF.
  • A prior XenForo Invision Community 4.x forum import, with its xf_import_log_<n> table still present on this XF install.

⚠ Forum-import log is mandatory. Unlike the IC5 importer, IC4 has no manual user-map fallback table. XenForo ships a first-party IC4 forum importer (XFI/Import/Importer/IpsForums.php, source label "Invision Community Forums 4.x"); you must run it first. The resulting log resolves IC4 member IDs to XF user IDs, IC4 topic IDs to XF thread IDs, and IC4 attachment IDs to XF attachment IDs. Without it the base-config validator refuses to proceed.

Base configuration

FieldDescription
Host / Port / Username / Password / DatabasePDO connection details for the IC4 database.
Table prefixIC4 default is empty (ips_ for older installs that opted into prefixing).
CharsetDefaults to utf8mb4. Change only if your IC4 install uses a different connection charset.
Files pathAbsolute filesystem path to the IC4 uploads/ directory, as readable by this server. Trailing slashes are stripped.
Forum import logRequired. Name of the xf_import_log_<n> table left behind by your prior IC4 forum import.

Validation runs the following checks:

  1. Open a PDO connection with the provided credentials.
  2. Fingerprint the schema with SHOW TABLES LIKE '{prefix}downloads_files'.
  3. Confirm the Downloads application version is in the IC4 range — SELECT app_long_version FROM {prefix}core_applications WHERE app_directory = 'downloads' must return a value > 0 and < 200000 (IC4 codes are 6-digit 1xxxxx numbers, e.g. 107836 = 4.7.24). This is what distinguishes IC4 from IC5.
  4. is_dir() + is_readable() on Files path.
  5. Forum import log must be set, exist on the XF DB, and contain at least one content_type='user' row.

Step list

The step list is identical to IC5's:

#StepSource tableNotes
1categoriesdownloads_categoriesWalked by cparent so parents are inserted first. Titles read from core_sys_lang_words keyed downloads_category_<id>.
2fieldsdownloads_cfieldsCustom field definitions. Titles read from downloads_field_<id> language words. Field types are mapped to the closest DM equivalent. Generated DM field IDs are prefixed ic4_.
3downloadsdownloads_filesEach IC4 file becomes a DM download. Author is resolved through the forum-import log via lookupUser(). The "Map discussion threads" flag remaps file_topicid to the XF thread ID through the same log.
4versionsderived from downloads_filebackup + the current file rowOlder versions reconstructed from IC4's backup table; the current file becomes the newest version.
5binariesdownloads_files_records (record_type='upload')Path is resolved as {files_path}/{record_location}. Missing files are logged and skipped. The binary is streamed to a temp file, sha256-hashed, and stored via MC\DownloadsManager\Util\Storage::store.
6urlFilesdownloads_files_records (record_type='link')IC4 external-URL "files" are imported as URL-type DM files.
7screenshotsdownloads_files_records (record_type='ssupload')Screenshot images are pushed through Service\Download\Icon so DM's variant set is generated. sslink (URL screenshots) are skipped and logged.
8fieldValuesdownloads_ccontentPer-download custom-field values, remapped through the field-ID map.
9reviewsdownloads_reviewsMigrated to xf_mc_dm_review.
10followsdownloads_files_notifyMigrated to xf_mc_dm_download_watch.
11tagscore_tags where tag_meta_app='downloads' AND tag_meta_area='files'Migrated to xf_tag_content with content_type='mc_dm_download'.

IC4 has no concept of prefix groups or prefixes, so those steps are not present.

Differences vs. the IC5 importer

For people coming from the IC5 page, the only behavioural deltas to be aware of:

AreaIC4IC5
User mappingForum-import log only — no fallback table.Forum-import log and/or xf_mc_dm_ic5_user_map.
Schema fingerprintdownloads_files exists and core_applications.app_long_version < 200000.downloads_files exists and core_applications.app_long_version >= 200000 (IC5 codes start at 5xxxxxx).
Generated DM field IDsPrefix ic4_.Prefix ic5_.
Log prefix[IC4 import].[IC5 import].
Source-platform label in the importer list"Invision Community 4 (Downloads)"."Invision Community 5 (Files)".

All other behaviour — the per-step row handlers, the timer-bounded batching, the path resolver, the description-attachment carry-over, the discussion-thread remap, the post-import finalize job — is shared with the IC5 importer and behaves identically.

Notes and caveats

  • Same monthly_YYYY_MM/ layout. IC4 stores file binaries under uploads/monthly_YYYY_MM/<originalname>.<HASH>.ext, the same layout as IC5. The IC4 record_location column already includes the monthly_YYYY_MM/... segment, so do not concatenate extra path segments yourself.
  • Forum import freshness. The XF forum-import log table is what links members, topics, and attachments. If you re-run the IC4 forum importer (creating a new xf_import_log_<n>), point the IC4 Downloads importer at the newest log table — the previous one will not have the latest user/topic IDs.
  • No user-map fallback. If you have a small number of orphaned IC4 members whose files you want to attribute to specific XF users, the IC4 importer does not currently support a hand-curated override map. You can either pre-create those XF users in the IC4 forum import (e.g. through user-merge passes there) or attribute their downloads to a placeholder user post-import.
  • Schema fingerprint band. The IC4 / IC5 discriminator uses app_long_version < 200000. If a future IC4 maintenance build pushes the long-version code past that, the band will need widening; today (4.7.24 = 107836) there is plenty of headroom.