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 påclient on Windows tillto qBittorrent iin Docker på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,PCOS-ISO)games,migreradeOSfrånISOs)enmigratedWindows-from a Windows servertilltoDocker-qBitDockerpåqBittorrent on the arr-servern.server.AllaAll 193seedar,areverifieratseeding,reboot-säkert.verified to survive a reboot.
FörutsättningarPrerequisites
KällfilernaTheliggersourceredanfilespåalready live on the NAS (sammathefysiskasamefilerphysicalsomfilesLinux-kliententheskaLinuxseeda)client will seed).BådeBothWindows-theochWindowsLinux-qBitandkörLinuxenqBittorrent run astandard-standard release (ejnotbeta/forkad)a–betaannarsorkanfork)trackern—bannaotherwiseklienten.the tracker may ban the client. qBittorrent 5.2.2ärisOKfineförforTL.TorrentLeech.TorrentsThehartorrentsredanhaveuppfylltalreadytrackernsmetminstatheseed-tidtracker's minimum seed time (annars:ifmigreranot:ändå,migratemenanyway,varbutmedvetenbeomawareHnR)of the Hit-and-Run risk).
NAS-NAS layout (NFS påon the arr-server)
| NAS | Export | |
|---|---|---|
| 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 |
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 påtemp folder on the NAS.
Obs:Note:taalwaysALLTIDkeepenanorörduntouchedkopiacopysomas a "pristine source"–—rörneverdentouchaldrig,it,återskapaalwaysalltidrecreatefrånfromden.it.
StegStep 2 –— Docker-volymDocker volumes
qBit-containernThe måsteqBittorrent secontainer filernamust på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–—denthesomonefaktisktthaträknas)actually counts)qBt-savePath(qBittorrentsqBittorrent'segna)own)
MappningsregelMapping rule (Windows → Linux), prefix-bevarande:preserving:
| Windows save_path | Linux |
|---|---|
//nas01/Movies ( |
/mnt/media/movies |
//nas01/Movies/< ( |
/mnt/media/movies/< |
//nas02/Anime/<x> |
/mnt/media/anime/<x> |
//nas02/TV/<x> |
/mnt/media/tv/<x> |
Viktigt:Important: don't blanket-bytswapinteeverythingallttotillthesammasamemapp.folder.OmIf thesave_pathinkluderarincludesfilmnamnetthebetydermoviedetname,attthatinnehålletmeansärthefilencontentdirektis–thedåfilemåstedirectlyundermappen—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)) == filfilemåstemust varabe byte-identisktidentical innanbefore någotanything skrivsis written (annarsotherwise ärthe kodarenencoder inteisn't kanoniskcanonical → avbryt)abort). StoppaStop qBitqBittorrent innanbefore filernaediting redigerasthe files (qBitit skriver överoverwrites .fastresume vidon avstängning)shutdown).
StegStep 4 –— LaddaLoad them in ochand recheck
KopieraCopy the.torrentfiles +omskrivnathe rewritten.fastresumetillfilesLinux-qBitsinto the Linux qBittorrent'sBT_backup.docker compose up -d qbittorrent(recreateomifvolymervolumesändrats)changed).qBitqBittorrentrecheckerrechecksochandbörjarstartsseeda.seeding. TorrentssomthathittarfindsinatheirfilerfilesgårgotilltostalledUP/uploading.
VanligaCommon fel:errors:
missingFiles=qBitqBittorrenthittarcan'tintefindfilernathe files →felwrongsökväg,path,saknadadocker-volym,missingellerdockermappnamnvolume,somorinteamatcharfolder name that doesn't match (t.ex.e.g. a dedupsomthatdöptrenamedom)it).- Trailing space
iinmappnamn:a folder name: Windowstillåter/stripparallows/stripsefterföljandetrailingmellanslagspacesannorlundadifferentlyänfrom Linux.FixaFixqBit-it qBittorrent-nativemedwith thetorrents/renameFolder-API:tAPI (döpdoINTENOTomrenamedisk-mappenthe–folder on disk — Radarr/Jellyfinförväntarexpectutanitmellanslag)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 påfor NFS-mountsenthe somNFS standard.mounts by default. OmIf Docker startarstarts qBitqBittorrent innanbefore NFS äris klartready, empty folders get bind-monteras tomma mapparmounted → allaevery 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>'