A simple tool to update file paths in Rekordbox backup XML files. It helps you move your music library to a new location and update your Rekordbox database accordinglyβno coding experience required!
- macOS or Linux (Windows users: see Windows Subsystem for Linux)
- Python 3.6+ (usually pre-installed on macOS)
- Homebrew (recommended for installing tools)
- Oh My Zsh (optional, for a friendlier terminal experience)
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"- Click the green Code button above and choose Download ZIP
- Unzip it and open the folder in your Terminal
Option A: If you have make installed (most common):
make depsOption B: If you don't have make installed:
# First install make
brew install make
# Then run the setup
make depsOption C: Manual installation (if you prefer):
# Install Homebrew (if you don't have it)
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Install Python and xmlstarlet
brew install python xmlstarlet
# Make scripts executable
chmod +x rekordbox_path_updater.py
chmod +x rekordbox_path_updater.shWhat this does:
- Checks your Python version
- Installs Python (if needed)
- Installs Homebrew (if needed)
- Installs
xmlstarlet(for advanced features) - Makes sure everything is ready to go!
Preview what will change (safe!):
make dry-run XML_FILE="rekordbox backup.xml" NEW_PATH="/Volumes/External/Music/"Actually update your file:
make update XML_FILE="rekordbox backup.xml" NEW_PATH="/Volumes/External/Music/"Enable debug logging for troubleshooting:
make update DEBUG=true XML_FILE="rekordbox backup.xml" NEW_PATH="/Volumes/External/Music/"Restore from backup if needed:
make restore XML_FILE="rekordbox backup.xml"- Finds all your music file paths in your Rekordbox backup
- Lets you move your music to a new folder or drive
- Updates the XML so Rekordbox can find your music again
- Makes a backup before changing anything
- Shows you a list of any missing files
- See the rest of this README for advanced usage, Makefile commands, and troubleshooting.
- All scripts are in Python or Bash, and you can run them directly if you prefer.
| Command | What it does |
|---|---|
make deps |
Installs all dependencies (Python, Homebrew, etc) |
make install |
Prepares scripts (run after make deps) |
make dry-run |
Shows what will change, but does NOT edit files |
make update |
Updates your XML file (creates a backup first) |
make debug |
Runs with debug logging enabled |
make debug-dry-run |
Dry-run with debug logging enabled |
make restore |
Restores your XML from the backup |
make help |
Shows all available commands |
- Always run
make dry-runfirst! - Your original XML is backed up automatically.
- If you get stuck, check the error messages or ask for help.
- If you have any questions, open an issue on GitHub or ask a friend who knows the terminal.
- You can also check the Homebrew and Oh My Zsh docs for help with your terminal.
Just follow the steps above and your Rekordbox library will be updated for your new music locationβno coding required!
- macOS, Linux, or Windows (with Python support)
- Python 3.6 or higher
- Internet connection (for dependency installation)
- Rekordbox XML file - Your exported library
- New music directory path - Where your music files are now located
- Music files - The actual audio files that should exist at the new path
# Clone or download this repository
git clone <repository-url>
cd rekordbox-editor
# Install dependencies and verify setup
make install
make test# Install Python dependencies
pip install -r requirements.txt
# Make scripts executable
chmod +x rekordbox_path_updater.py
chmod +x rekordbox_path_updater.shYour Rekordbox XML contains entries like this:
<TRACK Location="file://localhost/D:/Old%20Mix/03%20Together%20We%20Stand.mp3" />The tool will:
- Extract
03%20Together%20We%20Stand.mp3(URL decoded to03 Together We Stand.mp3) - Look for this file at your new path
- Update the Location to point to the new location
- Leave unchanged if the file doesn't exist
# Ensure your music files are in the new location
ls "/Volumes/External/Music/"
# Should show your .mp3, .wav, .aiff, .m4a filesmake dry-run XML_FILE="rekordbox.xml" NEW_PATH="/Volumes/External/Music/"This will show you:
- β Files that will be updated (found at new location)
- β Files that won't be updated (not found at new location)
- Summary of what will happen
make update XML_FILE="rekordbox.xml" NEW_PATH="/Volumes/External/Music/"This will:
- Create a of your original file (
rekordbox.xml.backup) - Update all found files
- Leave unchanged files that don't exist
- Show a detailed report
python rekordbox_path_updater.py <xml_file> <new_root_path> [options]
Options:
--dry-run Preview changes without modifying the file
--no-backup Skip creating a file
-h, --help Show help message./rekordbox_path_updater.sh <xml_file> <new_root_path> [--dry-run]# Install dependencies
make install
# Test the installation
make test
# Run with dry-run (preview changes)
make dry-run XML_FILE="your_file.xml" NEW_PATH="/your/new/path/"
# Run the actual update
make update XML_FILE="your_file.xml" NEW_PATH="/your/new/path/"
# Enable debug logging
make update DEBUG=true XML_FILE="your_file.xml" NEW_PATH="/your/new/path/"
# Debug mode with dry-run
make debug-dry-run XML_FILE="your_file.xml" NEW_PATH="/your/new/path/"
# Clean up temporary files
make clean
# Show help
make helprekordbox-editor/
βββ README.md # This file
βββ Makefile # Automated build and run commands
βββ requirements.txt # Python dependencies
βββ rekordbox_path_updater.py # Python version (recommended)
βββ rekordbox_path_updater.sh # Bash version
βββ resources/
β βββ test_rekordbox.xml # Sample Rekordbox XML for testing
βββ tests/
β βββ debug_hanging.py # Debug script for file system issues
βββ logs/ # Log files
- Automatic: Original file is always backed up before changes
- Dry-run mode: Test changes before applying them
- File verification: Only updates files that exist at new location
- Error reporting: Comprehensive list of files that couldn't be found
- Files that exist at the new location β Updated
- Files that don't exist at new location β Left unchanged
- Non-music files β Left unchanged
.mp3- MP3 audio files.wav- WAV audio files.aiff- AIFF audio files.m4a- M4A audio files.flac- FLAC audio files- And other audio formats
# Check if the file exists and has the correct name
ls -la "rekordbox.xml"# Verify the directory exists and is accessible
ls -la "/Volumes/External/Music/"This usually means:
- Files don't exist at the new location
- Filenames don't match exactly (case sensitivity)
- Path is incorrect
# Make scripts executable
chmod +x rekordbox_path_updater.py
chmod +x rekordbox_path_updater.sh# List files in your new music directory
find "/Volumes/External/Music/" -name "*.mp3" | head -10
# Check if specific files exist
ls "/Volumes/External/Music/03 Together We Stand.mp3"# Check if your XML file is valid
python -c "import xml.etree.ElementTree as ET; ET.parse('rekordbox.xml')"Processing XML file: rekordbox.xml
New root path: /Volumes/External/Music/
DRY RUN MODE - No changes will be made
--------------------------------------------------
β Updated: 03 Together We Stand.mp3
β Updated: Mirror Cluster.wav
β Error: File not found: /Volumes/External/Music/Missing Song.mp3
β Updated: Put You On.m4a
--------------------------------------------------
Summary:
Successfully processed: 3 files
Errors: 1 files
Files not found at new location:
- File not found: /Volumes/External/Music/Missing Song.mp3
To apply these changes, run without --dry-run flag
Processing XML file: rekordbox.xml
New root path: /Volumes/External/Music/
--------------------------------------------------
β Updated: 03 Together We Stand.mp3
β Updated: Mirror Cluster.wav
β Error: File not found: /Volumes/External/Music/Missing Song.mp3
β Updated: Put You On.m4a
Backup created: rekordbox.xml.backup
Updated XML file: rekordbox.xml
--------------------------------------------------
Summary:
Successfully processed: 3 files
Errors: 1 files
If something goes wrong, you can restore from the:
# Restore the original file
cp "rekordbox.xml.backup" "rekordbox.xml"
# Or use the makefile
make restoreBoth scripts automatically calculate the optimal number of worker threads based on your system resources:
Automatic Thread Calculation:
- CPU Cores: Base calculation on available CPU cores
- Memory Factor: Adjusts based on available RAM (more RAM = more threads possible)
- I/O Optimization: Adds 50% more threads for file system operations
- Smart Bounds: Minimum 2 threads, maximum 32 threads or 4x CPU cores
Python Script:
# Let the script choose optimal thread count (recommended)
python3 rekordbox_path_updater.py "rekordbox backup.xml" "/new/path/"
# Override with custom thread count
python3 rekordbox_path_updater.py "rekordbox backup.xml" "/new/path/" --workers 16Bash Script:
# Let the script choose optimal thread count (recommended)
./rekordbox_path_updater.sh "rekordbox backup.xml" "/new/path/"
# Override with custom thread count
./rekordbox_path_updater.sh "rekordbox backup.xml" "/new/path/" 8Makefile:
# Let the script choose optimal thread count (recommended)
make update XML_FILE="rekordbox backup.xml" NEW_PATH="/new/path/"
# Override with custom worker count
make update XML_FILE="rekordbox backup.xml" NEW_PATH="/new/path/" WORKERS=16System Requirements for Optimal Performance:
- psutil (optional): For better memory detection in Python script
- bc (optional): For better calculations in bash script
- nproc/sysctl: For CPU core detection
For troubleshooting and detailed analysis, use debug mode:
# Enable debug logging
python3 rekordbox_path_updater.py "rekordbox backup.xml" "/new/path/" --debug
# Debug with single-threaded mode
python3 rekordbox_path_updater.py "rekordbox backup.xml" "/new/path/" --debug --single-thread
# Debug with dry-run
python3 rekordbox_path_updater.py "rekordbox backup.xml" "/new/path/" --debug --dry-runDebug Features:
- File-by-file logging: Every file processed is logged
- Subdirectory tracking: Shows which subdirectories are being searched
- Detailed timing: Each step is timed and logged
- Error tracing: Complete error paths and causes
- Performance metrics: Detailed processing statistics
- Large Libraries: For libraries with 10,000+ tracks, the smart threading can provide 3-5x speed improvement
- SSD vs HDD: Performance gains are more noticeable on slower storage
- Memory: More RAM allows for more concurrent file operations
- Network Drives: Consider using fewer threads for network-mounted storage
Both scripts now provide detailed logging to help you track and troubleshoot:
Log Files:
- Location:
logs/directory (created automatically) - Naming:
{xml_filename}_{mode}_{timestamp}.log - Example:
rekordbox_backup_dry-run_20241201_143022.log
Log Contents:
- Detailed processing steps
- File verification results
- Error messages with full paths
- Performance metrics
- Processing time and statistics
Debug Log Features:
- File-by-file processing: Every file is logged with its status
- Subdirectory search tracking: Shows which directories are being searched
- Detailed timing: Each operation is timed
- Error tracing: Complete error paths and stack traces
- Performance breakdown: Detailed statistics for each phase
Each run generates a comprehensive summary including:
Statistics:
- Total files processed
- Success/error counts and percentages
- Processing speed (files/second)
- Processing time
Error Details:
- Complete list of missing files
- Full file paths that were searched
- Recommendations for troubleshooting
Recommendations:
- Success rate analysis
- Suggestions for improving results
- Next steps for dry runs
============================================================
REKORDBOX PATH UPDATER - DRY RUN SUMMARY
============================================================
XML File: rekordbox backup.xml
New Root Path: /Volumes/External/Music/
Processing Time: 2.34 seconds
Mode: DRY RUN
STATISTICS:
Total Files Processed: 1,247
Successfully Updated: 1,198 (96.1%)
Errors: 49 (3.9%)
Processing Speed: 532.5 files/second
ERROR DETAILS:
- File not found: /Volumes/External/Music/Missing Song.mp3
- File not found: /Volumes/External/Music/Another Missing.mp3
RECOMMENDATIONS:
β Some files were not found. Check the error list above.
β Most files were successfully processed.
DRY RUN COMPLETE:
No changes were made to your XML file.
To apply these changes, run without --dry-run flag.
============================================================
This tool is provided as-is for educational and personal use. Always your Rekordbox library before making changes.
Feel free to submit issues or pull requests to improve this tool!