Custom Fields Import/Export

Administration tools ::: tool_customfields_exportimport
Maintained by Serge Touvoli
Export and import the structure of user profile, course, and cohort custom fields in JSON format — includes CLI support.

Custom Fields Import/Export 2.0.0

Moodle 4.2, 4.3, 4.4, 4.5, 5.0, 5.1
Released: Monday, 24 November 2025, 7:15 PM

Changelog

[2.0.0] - 2025-11-24

Added

  • Laravel-style migration system for safe and automated custom field deployments:
    • New database table tool_customfields_migrations to track applied migrations.
    • Automatic detection of pending or modified migration files via MD5 hashing.
    • --auto CLI flag to discover and apply migrations in chronological order.
    • --dry-run CLI flag to preview migration changes without applying them.
    • Idempotent import process: safely re-imports categories and fields without duplicates.
    • Support for migration naming convention YYYYMMDD_description.json.
    • New class migration_manager handling discovery, tracking and execution.
    • Added language strings for migration-related functionality.

Changed

  • Refactored custom field importer logic to be fully idempotent:
    • Reuses existing categories instead of failing.
    • Skips existing fields while maintaining consistent import state.
  • Improved error messages with clearer context (field name, datatype, unsupported types).
  • Bumped plugin version to 2.0.0 due to new migration infrastructure and database changes.

Fixed

  • Privacy API compliance: moved privacy/provider.php to the correct location (classes/privacy/provider.php) to comply with Moodle's privacy subsystem structure.
  • Resolved multiple edge-case issues during re-import scenarios (duplicate categories/field shortnames no longer trigger errors).

[1.0.1] - 2025-06-02

Fixed

  • Custom fields: added timecreated and timemodified properties to imported categories and fields.
  • Custom fields: added validation to prevent importing a category with a name that already exists.
  • Custom fields: added validation to prevent importing fields with duplicate shortnames.

Version information

Version build number
2025112400
Version release name
2.0.0
Maturity
Stabiele weergawe
MD5 Sum
a93c77824841c3f2dfa0248cbe6720ae
Supported software
Moodle 4.2, Moodle 4.3, Moodle 4.4, Moodle 4.5, Moodle 5.0, Moodle 5.1
  • Latest release for Moodle 4.2
  • Latest release for Moodle 4.3
  • Latest release for Moodle 4.4
  • Latest release for Moodle 4.5
  • Latest release for Moodle 5.0
  • Latest release for Moodle 5.1

Version control information

Version control system (VCS)
GIT
VCS repository URL
VCS tag
v.2.0.0

Default installation instructions for plugins of the type Administration tools

  1. Make sure you have all the required versions.
  2. Download and unpack the module.
  3. Place the folder (eg "mytool") in the "admin/tool" subdirectory.
  4. Visit http://yoursite.com/admin to finish the installation