Skip to main content

qBittorrent: migrating seeding torrents from Windows to Linux

qBittorrent: migreramigrating seedandeseeding torrents from Windows to Linux (Docker)

GuideA förguide attfor flyttamoving etta stortlarge antalset seedandeof seeding torrents frånfrom ena qBittorrent-klientqBittorrent client on Windows tillto qBittorrent iin Docker on Linux utanwithout attbreaking brytathe seedningenseeding (viktigtwhich förmatters privatafor private trackers somlike TorrentLeech ochand derastheir Hit-and-Run-regler)Run rules).

GenomförtDone 2026-06-29: 193 torrents (filmer,movies, anime, TV, PC-spel,PC OS-ISO)games, migreradeOS frånISOs) enmigrated Windows-from a Windows server tillto Docker-qBitDocker qBittorrent on the arr-servern.server. AllaAll 193 seedar,are verifieratseeding, reboot-säkert.verified to survive a reboot.

FörutsättningarPrerequisites

  • KällfilernaThe liggersource redanfiles already live on the NAS (sammathe fysiskasame filerphysical somfiles Linux-kliententhe skaLinux seeda)client will seed).
  • BådeBoth Windows-the ochWindows Linux-qBitand körLinux enqBittorrent run a standard-standard release (ejnot beta/forkad)a beta annarsor kanfork) trackern bannaotherwise klienten.the tracker may ban the client. qBittorrent 5.2.2 äris OKfine förfor TL.TorrentLeech.
  • TorrentsThe hartorrents redanhave uppfylltalready trackernsmet minstathe seed-tidtracker's minimum seed time (annars:if migreranot: ändå,migrate menanyway, varbut medvetenbe omaware HnR)of the Hit-and-Run risk).

NAS-NAS layout (NFS on the arr-server)

NAS Export MountpointMount point
NAS01 /volume1/Movies /mnt/media/movies
NAS01 /volume1/Apps /mnt/media/apps
NAS02 /volume1/TV /mnt/media/tv
NAS02 /volume1/Anime /mnt/media/anime
NAS02 /volume1/Games-PC /mnt/media/games-pc

VarjeEach share liggeris iin /etc/fstab medwith _netdev ochand bind-monterasmounted ininto ithe qBit-containernqBittorrent container (/mnt/media/x:/mnt/media/x).

StegStep 1 ExporteraExport frånfrom Windows

The .torrent- ochand .fastresume-filerna finnsfiles i:live in:

C:\Users\<user>\AppData\Local\qBittorrent\BT_backup\

KopieraCopy the helaentire mappenfolder (bådeboth the .torrent OCHAND the .fastresume) tillfiles) ento platssomewhere Linux når,can t.ex.reach, ene.g. temp-mappa temp folder on the NAS.

Obs:Note: taalways ALLTIDkeep enan orörduntouched kopiacopy somas a "pristine source" rörnever dentouch aldrig,it, återskapaalways alltidrecreate frånfrom den.it.

StegStep 2 Docker-volymDocker volumes

qBit-containernThe måsteqBittorrent secontainer filernamust see the files at the sammasame sökvägpath somthe .fastresume pekarpoints på.to. LäggAdd tillthe NAS-mountenNAS imounts to docker-compose.yml:

  qbittorrent:
    volumes:
      - ./config/qbittorrent:/config
      - /mnt/media/movies:/mnt/media/movies
      - /mnt/media/tv:/mnt/media/tv
      # ...osvand förso varjeon for each share

StegStep 3 SkrivRewrite omthe sökvägarnapaths iin .fastresume

.fastresume äris bencode-kodatencoded (binärt,binary, medwith längd-prefix)length prefixes). EnA enkelplain sed funkarwill INTENOT work man måsteyou avkoda,have bytato fältendecode, ochswap the fields, and re-koda.encode. TvåTwo fältfields innehållerhold sökvägar:paths:

  • save_path (libtorrentslibtorrent's denthe somone faktisktthat räknas)actually counts)
  • qBt-savePath (qBittorrentsqBittorrent's egna)own)

MappningsregelMapping rule (Windows → Linux), prefix-bevarande:preserving:

Windows save_path Linux
//nas01/Movies (filmmovie iin undermapp)a subfolder) /mnt/media/movies
//nas01/Movies/<filmmovie> (filfile direkt)directly) /mnt/media/movies/<filmmovie>
//nas02/Anime/<x> /mnt/media/anime/<x>
//nas02/TV/<x> /mnt/media/tv/<x>

Viktigt:Important: don't blanket-bytswap inteeverything alltto tillthe sammasame mapp.folder. OmIf the save_path inkluderarincludes filmnamnetthe betydermovie detname, attthat innehålletmeans ärthe filencontent direktis the file måstedirectly undermappen bevaras.in which case the subfolder has to be preserved.

Python-scriptetThe använderPython enscript egenuses its own bencode decode/encode medwith ena säkerhetsspärrsafety check: encode(decode(fil)file)) == filfile måstemust varabe byte-identisktidentical innanbefore någotanything skrivsis written (annarsotherwise ärthe kodarenencoder inteisn't kanoniskcanonicalavbryt)abort). StoppaStop qBitqBittorrent innanbefore filernaediting redigerasthe files (qBitit skriver överoverwrites .fastresume vidon avstängning)shutdown).

StegStep 4 LaddaLoad them in ochand recheck

  1. KopieraCopy the .torrent files + omskrivnathe rewritten .fastresume tillfiles Linux-qBitsinto the Linux qBittorrent's BT_backup.
  2. docker compose up -d qbittorrent (recreate omif volymervolumes ändrats)changed).
  3. qBitqBittorrent recheckerrechecks ochand börjarstarts seeda.seeding. Torrents somthat hittarfind sinatheir filerfiles gårgo tillto stalledUP/uploading.

VanligaCommon fel:errors:

  • missingFiles = qBitqBittorrent hittarcan't intefind filernathe filesfelwrong sökväg,path, saknada docker-volym,missing ellerdocker mappnamnvolume, somor intea matcharfolder name that doesn't match (t.ex.e.g. a dedup somthat döptrenamed om)it).
  • Trailing space iin mappnamn:a folder name: Windows tillåter/stripparallows/strips efterföljandetrailing mellanslagspaces annorlundadifferently änfrom Linux. FixaFix qBit-it qBittorrent-native medwith the torrents/renameFolder-API:t API (döpdo INTENOT omrename disk-mappenthe folder on disk — Radarr/Jellyfin förväntarexpect utanit mellanslag)without the space).

StegStep 5 StängTurn avoff seeding-könthe seeding queue

FörFor ena seedbox somthat skashould seedaseed allteverything förforever: alltid:turn stängoff avqueueing köandet såso allaall torrents announcerarannounce samtidigt.at once.

POST /api/v2/app/setPreferences   json={"queueing_enabled":false}

Annars begränsarOtherwise max_active_uploads/max_active_torrents hurlimit mångahow sommany faktisktactually seedar.seed.

StegStep 6 GörMake detit reboot-säkertsafe (kritiskt!critical!)

An fstab medentry with _netdev överleversurvives a reboot menbut Docker väntardoesn't intewait for NFS-mountsenthe somNFS standard.mounts by default. OmIf Docker startarstarts qBitqBittorrent innanbefore NFS äris klartready, empty folders get bind-monteras tomma mapparmountedallaevery torrentstorrent blirbecomes missingFiles.

Fix — a systemd drop-in at /etc/systemd/system/docker.service.d/wait-for-nfs.conf:

[Unit]
After=remote-fs.target
Wants=remote-fs.target

SenThen systemctl daemon-reload. DettaThis ordnarorders Docker efterafter att allaall _netdev- mounts ärare klara.ready.

VerifieraVerify medwith enan faktiskactual reboot: efterafter omstartrestarting, ska allaall mounts varashould aktiva,be qBitactive, uppe,qBittorrent ochup, allaand torrentsevery seedatorrent seeding (0 missingFiles).

VerifieringskommandonVerification commands

# Mounts aktiva?active?
findmnt -t nfs4 -o TARGET,SOURCE

# fstab giltig?valid?
sudo findmnt --verify

# qBitCan serqBittorrent filerna?see the files?
docker exec qbittorrent ls /mnt/media/movies

# Torrent-Torrent states (via the API, efterafter login-getting a login cookie)
curl -s -b cookie 'http://localhost:8080/api/v2/torrents/info' \
  | grep -o '"state":"[^"]*"' | sort | uniq -c

# Tracker announcerar?announcing? (status 2 = working)
curl -s -b cookie 'http://localhost:8080/api/v2/torrents/trackers?hash=<HASH>'