Automation scripts for migrating DreamFactory documentation to MediaWiki.
# Install system dependencies apt-get install pandoc python3 python3-pip # Install Python dependencies pip3 install -r requirements.txtScans all documentation sources and generates a tracking spreadsheet.
python3 inventory.py --output migration_inventory.csvOutput: CSV file with columns:
- source_path, source_type, title, target_wiki_page
- priority (P0-P3), status, assigned
- word_count, images, links, links_verified
- difficulty, keywords, notes
Converts all markdown files in a directory to MediaWiki format.
./batch_convert.sh [source_dir] [output_dir] # Example: Convert df-docs ./batch_convert.sh ../df-docs/df-docs/docs ./convertedFixes common Pandoc conversion issues:
- Extracts YAML frontmatter for categories
- Fixes code block syntax highlighting
- Converts internal links to wiki format
- Fixes image references
- Converts Docusaurus admonitions to templates
- Adds categories based on path/keywords
python3 postprocess.py <wiki_file> [source_md_file]Bulk uploads converted pages to MediaWiki via API.
python3 upload_to_wiki.py --wiki-url https://wiki.dreamfactory.com \ --input-dir ./converted \ --dry-runValidates migrated content:
- Checks for broken internal links
- Verifies images are uploaded
- Compares word counts
- Validates category assignments
python3 validate_migration.py --wiki-url https://wiki.dreamfactory.com \ --inventory migration_inventory.csvGenerates nginx configuration for URL redirects.
python3 generate_redirects.py --inventory migration_inventory.csv \ --output redirect_map.conf- Generate inventory:
python3 inventory.py - Review and prioritize: Edit
migration_inventory.csv - Convert content:
./batch_convert.sh - Review conversions: Check
./converted/directory - Upload to staging wiki:
python3 upload_to_wiki.py --dry-run - Validate migration:
python3 validate_migration.py - Generate redirects:
python3 generate_redirects.py
Syncs markdown documentation from GitHub to MediaWiki with conflict detection.
# Check for conflicts python3 sync_to_wiki.py --check-conflicts --wiki-url https://wiki.dreamfactory.com # Deploy (with environment variables) export WIKI_URL=https://wiki.dreamfactory.com export WIKI_USER=BotUser export WIKI_PASSWORD=secret python3 sync_to_wiki.py --source ../df-docs/docs --deploy # Dry run python3 sync_to_wiki.py --source ../df-docs/docs --deploy --dry-run # Verify deployment python3 sync_to_wiki.py --verifyBacks up wiki-editable namespaces (Legacy, FAQ, etc.) to a Git repository.
# Backup all legacy namespaces python3 backup_wiki_to_git.py --wiki-url https://wiki.dreamfactory.com \ --output ./wiki-backup \ --namespaces V2 V3 V4 V5 V6 Legacy # Backup without committing python3 backup_wiki_to_git.py --wiki-url https://wiki.dreamfactory.com \ --output ./wiki-backup \ --no-commitThe scripts support a hybrid ownership model:
| Content Type | Edit Location | Sync Direction |
|---|---|---|
| Current docs (7.x) | GitHub | GitHub → Wiki (sync_to_wiki.py) |
| Legacy docs (V2-V6) | Wiki | Wiki → Git (backup_wiki_to_git.py) |
See the full plan for MediaWiki protection configuration and CI/CD setup.
Before migration, create these templates in MediaWiki:
Template:Note- Info/note boxesTemplate:Warning- Warning boxesTemplate:Tip- Tip boxesTemplate:VersionBanner- Version noticesTemplate:V2DocthroughTemplate:V6Doc- Version-specific bannersTemplate:CurrentDoc- Current version bannerTemplate:VersionSwitcher- Version navigation
See /root/.claude/plans/ancient-wobbling-twilight.md for template code.