Database migration tools for migrating data from various panel systems to Pasarguard.
- Python 3.8+
- uv - Fast Python package installer and resolver
# Linux/macOS
curl -LsSf https://astral.sh/uv/install.sh | sh
# Windows (PowerShell)
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
# Or visit: https://github.com/astral-sh/uv# Linux/macOS - Add to PATH
source $HOME/.cargo/env
# Or: export PATH="$HOME/.cargo/bin:$PATH"- Marzneshin - See marzneshin/README.md
- X-UI - See x-ui/README.md
# Clone (or fork) the repository
git clone https://github.com/PasarGuard/migrations.git
cd migrationsMigrate your panel data to generate the URL mapping file.
cd marzneshin
# Install dependencies using uv (recommended) or pip
uv sync
# Or: pip install pymysql python-dotenv xxhash
# Configure and run
cp .env.example .env
# Edit .env with your database credentials
uv run migrate.pyImportant: The migration tool generates subscription_url_mapping.json - save this file path, you'll need it in the next step.
After migration completes, install the redirect server to handle old URL redirects.
# Run the automated installer with interactive setup
curl -fsSL https://raw.githubusercontent.com/PasarGuard/migrations/main/redirect-server/install_redirect_server.sh | sudo bashThe installer will:
- Download and install the redirect-server binary
- Prompt you for your URL mapping file (from Step 2)
- Guide you through server configuration (port, SSL, redirect domain)
- Set up and start the service automatically
# Check service status
sudo systemctl status redirect-server
# View logs
sudo journalctl -u redirect-server -f
# Test a redirect (replace with your old URL)
curl -I http://localhost:8080/sub/old_username/old_keyFor detailed configuration options, SSL setup, and troubleshooting, see redirect-server/README.md.