First, update your system and install the required tools:
sudo apt update -y && sudo apt upgrade -y
sudo apt install -y python3 python3-pip python3-venv unzip wget git
Ensure prerequisites are installed as in Step 1.
- Install Uv:
export PIP_BREAK_SYSTEM_PACKAGES=1
pip install uv
- Download the Import Tool:
cd && git clone https://github.com/erfjab/migration.git && cd migration
Edit the Marzneshin Docker configuration to include these volumes:
nano /etc/opt/marzneshin/docker-compose.yml
for v0.6.0 to v0.6.2:
volumes:
- /var/lib/marzneshin:/var/lib/marzneshin
- /root/migration/app/importer/docker/v062/user.py:/app/app/models/user.py
- /root/migration/app/importer/docker/v062/crud.py:/app/app/db/crud.py
for v0.6.3 to v0.6.4:
volumes:
- /var/lib/marzneshin:/var/lib/marzneshin
- /root/migration/app/importer/docker/v063/user.py:/app/app/models/user.py
- /root/migration/app/importer/docker/v063/crud.py:/app/app/db/crud.py
for v0.7.0:
volumes:
- /var/lib/marzneshin:/var/lib/marzneshin
- /root/migration/app/importer/docker/v070/user.py:/app/app/models/user.py
- /root/migration/app/importer/docker/v070/crud.py:/app/app/db/crud.py
Restart Marzneshin to apply changes:
marzneshin restart
- Edit the Environment File:
cd /root/migration && nano .env
Add environment details for the import, creating a new sudo admin account. Ensure this username is unique:
MARZNESHIN_USERNAME="sudo_user"
MARZNESHIN_PASSWORD="sudo_pass"
MARZNESHIN_ADDRESS="https://sub.domain.com:port"
MARZBAN_USERS_DATA="marzban.json"
- Run Project
cd /root/migration && uv sync && uv run import.py
-
Save exceptions.json file to your pc
-
Delete docker map files
After the import is complete, delete the Docker map files in volume. and
marzneshin restart
-
Delete script Files
rm -rf /root/migration