#
Migration Guide: From checkReVancedVersion.py to update_versions.py
This guide helps you migrate from the old checkReVancedVersion.py
script to the new update_versions.py
system.
#
Overview of Changes
#
Old System (checkReVancedVersion.py)
- Used ReVanced API v2 (deprecated)
- Required complex configuration files
- Used template-based file generation
- Limited git integration
- Manual branch management
#
New System (update_versions.py)
- Uses ReVanced API v4 (current)
- Simplified configuration
- Direct placeholder replacement in files
- Automatic git branch management
- Better error handling and logging
#
Migration Steps
#
1. Backup Current Configuration
# Backup existing configuration
cp -r .conf .conf.backup
cp checkReVancedVersion.py checkReVancedVersion.py.backup
#
2. Update GitHub Actions Workflow
Replace the current .github/workflows/version-and-lastCheck-bump.yml
with the new workflow:
# Backup existing workflow
cp .github/workflows/version-and-lastCheck-bump.yml .github/workflows/version-and-lastCheck-bump.yml.backup
# Copy new workflow
cp python/new-workflow.yml .github/workflows/update-versions.yml
#
3. Create Required Branches
The new system requires a docs-base
branch for development and commits to main
for production:
# Create docs-base branch from main
git checkout main
git checkout -b docs-base
git push origin docs-base
# The workflow will handle switching between branches automatically
#
4. Test the New System
# Test API connectivity
python3 python/test_api.py
# Dry-run test
python3 python/test_dry_run.py
# Test with wrapper script
./python/run_updater.sh --dry-run
#
5. Disable Old Workflow
Comment out or disable the old workflow to prevent conflicts:
# In .github/workflows/version-and-lastCheck-bump.yml
name: "[DISABLED] Bump version and last modified time"
# Add this at the top to disable
#
Configuration Changes
#
Files No Longer Needed
- Most of the complex
.conf/python/
configuration files - The template system (replaced with direct placeholder replacement)
#
Files Still Used
.conf/python/update.lut.json
- Package name to common name mapping.conf/python/update.state
- State tracking for updates
#
New Files
python/update_versions.py
- Main updater scriptpython/requirements.txt
- Python dependenciespython/run_updater.sh
- Convenient wrapper script
#
Placeholder System Changes
#
Old System
Used template files with {table}
, {date}
, {footnote}
placeholders that were processed to generate complete files.
#
New System
Direct replacement of placeholders in existing markdown files:
20.12.46
→ Latest YouTube version (e.g., "20.12.46")2025-06-18 16:11:26 UTC
→ Timestamp (e.g., "2025-06-18 15:37:15 UTC")
#
Workflow Differences
#
Old Workflow
- Run
checkReVancedVersion.py
- Generate template files
- Manual git operations
- Trigger rebuilds manually
#
New Workflow
- Ensure on
docs-base
branch - Fetch latest API data
- Update placeholders in all markdown files
- Commit changes to
main
branch - Return to
docs-base
branch - Automatically trigger website rebuild
#
Rollback Plan
If you need to rollback to the old system:
# Restore old files
cp checkReVancedVersion.py.backup checkReVancedVersion.py
cp -r .conf.backup/* .conf/
# Restore old workflow
cp .github/workflows/version-and-lastCheck-bump.yml.backup .github/workflows/version-and-lastCheck-bump.yml
# Remove new workflow
rm .github/workflows/update-versions.yml
# Switch back to main branch
git checkout main
#
Testing Checklist
Before going live with the new system:
- API connectivity test passes
- Dry-run test completes successfully
- Git branches are set up correctly (
docs-base
andmain
) - GitHub Actions has proper permissions
- Discord webhook is configured (if using notifications)
- Old workflow is disabled
- New workflow can be triggered manually
#
Benefits of Migration
- Future-proof: Uses current API v4 instead of deprecated v2
- Simpler: Less configuration, more direct approach
- Automated: Better git integration and branch management
- Robust: Improved error handling and recovery
- Maintainable: Cleaner, more readable code
- Flexible: Easy to extend for new features
#
Support
If you encounter issues during migration:
- Check the workflow logs in GitHub Actions
- Run the test scripts to isolate problems
- Use the dry-run mode to safely test changes
- Refer to the README.md for detailed documentation