Skip to content

Latest commit

 

History

History
106 lines (71 loc) · 2.16 KB

readme.md

File metadata and controls

106 lines (71 loc) · 2.16 KB

Installing Prerequisites on Ubuntu/Debian

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

Step 2: Import Marzban Data

Setup & Run

Ensure prerequisites are installed as in Step 1.

  1. Install Uv:
export PIP_BREAK_SYSTEM_PACKAGES=1
pip install uv
  1. Download the Import Tool:
cd && git clone https://github.com/erfjab/migration.git && cd migration

Configure Marzneshin

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

Configure Import

  1. 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"
  1. Run Project
cd /root/migration && uv sync &&  uv run import.py
  1. Save exceptions.json file to your pc

  2. Delete docker map files

    After the import is complete, delete the Docker map files in volume. and marzneshin restart

  3. Delete script Files

rm -rf /root/migration