Data Machine Migration
WordPress plugin for migrating Data Machine from dm_ to datamachine_ prefixes for WordPress repository compliance
by Chris Huber · github.com/chubes4/data-machine-migration · website
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/chubes4/data-machine-migration/archive/refs/heads/main.zipReadme
Data Machine Migration Plugin
A standalone WordPress plugin to migrate Data Machine from dm_ prefixes to datamachine_ prefixes for WordPress repository compliance.
Overview
This plugin provides a safe, step-by-step migration process to convert:
- Database table names:
wp_dm_*→wp_datamachine_* - Meta keys:
dm_*→datamachine_* - WordPress options: Any serialized data containing
dm_references - Custom post types:
dm_events→datamachine_events - Gutenberg blocks:
dm-events/*→datamachine-events/*
Migration Status
Current Phase: Phase 2 Complete
- Phase 1: ✓ Complete (migration plugin ready)
- Phase 2: ✓ Complete (core plugin fully migrated to datamachine_ prefixes)
- Phase 3: ✓ Complete (database tables migrated to wpdatamachine*)
- Phase 4: ✓ Complete (extension migrations deployed and verified)
Status: Migration complete across all Data Machine Ecosystem components. Plugin v1.0.0 available for production deployment on existing installations. See ecosystem root MIGRATION-PLAN.md file for full migration details.
Installation
- Download or clone this plugin to your
wp-content/plugins/directory - Activate the plugin through WordPress admin (Plugins → Installed Plugins)
- Navigate to Tools → Data Machine Migration
Migration Process
Phase 1: Preparation
- Install this migration plugin alongside your existing Data Machine plugins
- Ensure you have complete database backups (server-level)
- Run pre-flight checks
Phase 2: Execute Migration Steps
Step 1: Database Tables
Renames core Data Machine tables:
wp_dm_pipelines→wp_datamachine_pipelineswp_dm_flows→wp_datamachine_flowswp_dm_jobs→wp_datamachine_jobswp_dm_processed_items→wp_datamachine_processed_items
Step 2: Meta Keys
Updates all post and user meta keys:
- Post meta:
dm_*→datamachine_* - User meta:
dm_*→datamachine_* - Handles serialized data recursively
Step 3: Options
Updates WordPress options containing old prefixes:
- Option names:
dm_*→datamachine_* - Option values: Any serialized data with
dm_references
Step 4: Post Types
Migrates custom post types in wp_posts table:
dm_events→datamachine_events- Batch processing for large datasets
- Verifies zero posts remain with old type
Step 5: Block Content
Updates Gutenberg block references in post content:
dm-events/event-details→datamachine-events/event-detailsdm-events/calendar→datamachine-events/calendardm-recipes/recipe-schema→datamachine-recipes/recipe-schema- Includes reusable blocks
Step 6: Validation
Comprehensive checks to ensure migration success:
- Verifies all tables exist and are accessible
- Confirms no old prefixes remain
- Validates data integrity
Phase 3: Completion
- Review migration logs
- Test Data Machine functionality
- Remove this migration plugin
Safety Features
Backups
- Server-level backups are your responsibility
- Plugin creates detailed migration logs
- Rollback capabilities for each migration step
Validation
- Pre-migration checks for system readiness
- Post-migration validation of all changes
- Detailed error reporting and logging
Error Handling
- Graceful failure handling
- Partial rollback options
- Logging via PHP
error_log()function
Usage Instructions
For Each Site Migration
-
Install Plugin
# Upload to wp-content/plugins/datamachine-migration/ # Activate via WordPress admin -
Access Migration Interface
- Go to Tools → Data Machine Migration
- Review the migration overview
-
Run Migration Steps
- Click "Start Migration"
- Execute steps in order: Database → Meta → Options → Post Types → Block Content → Validation
- Monitor progress and resolve any errors
-
Verify Completion
- Check validation results
- Test Data Machine functionality
- Review migration logs
-
Cleanup
- Deactivate and delete this migration plugin
- Remove migration log files if desired
Troubleshooting
Common Issues
"Table does not exist"
- Ensure Data Machine plugins are installed and activated
- Check database prefix settings
"Permission denied"
- Verify user has database modification permissions
- Check file system permissions for log files
"Timeout errors"
- Large datasets may require batch processing adjustments
- Check PHP max_execution_time settings
Recovery Options
If Migration Fails:
- Check WordPress debug.log or server error logs for detailed error information
- Use server backups to restore database
- Contact support with log entries
Partial Rollback:
- Some steps support individual rollback
- Full rollback requires server backup restoration
Technical Details
Database Operations
- Uses
RENAME TABLEfor atomic table renames - Maintains foreign key relationships
- Batch processes large meta datasets
Data Handling
- Recursive processing of serialized arrays/objects
- Preserves data structure and types
- Handles nested key replacements
Logging
- Logging via PHP
error_log()function - Messages appear in WordPress debug.log or server error logs
- Error details for troubleshooting
Requirements
- WordPress 5.0+
- PHP 7.4+
- MySQL 5.6+
- Data Machine plugins installed
- Database backup available
Support
For issues with this migration plugin:
- Check
migration.logfor error details - Verify all requirements are met
- Test on staging environment first
- Include log files when reporting issues
Changelog
1.0.0
- Initial release
- Database table migration
- Meta key migration
- Options migration
- Validation system
- Admin interface
- Comprehensive logging