Skip to main content

qBt Migrate

This tool changes the root paths of existing torrents in qBittorrent. It can also convert slashes when migrating between Windows and Linux/Mac.

Usage

Install from PyPi using pip, or jump to Examples for Docker

pip install qbt-migrate

Run the script and follow prompts or use CLI arguments with command qbt_migrate

usage: qbt_migrate [-h] [-e EXISTING_PATH] [-n NEW_PATH] [-t {Windows,Linux,Mac}]
          [-b BT_BACKUP_PATH] [-l {DEBUG,INFO}]

optional arguments:
  -h, --help            show this help message and exit
  -e EXISTING_PATH, --existing-path EXISTING_PATH
                        Existing root of path to look for.
  -n NEW_PATH, --new-path NEW_PATH
                        New root path to replace existing root path with.
  -t {Windows,Linux,Mac}, --target-os {Windows,Linux,Mac}
                        Target OS (converts slashes). Default will auto-detect if conversion is needed based on existing vs new.
  -b BT_BACKUP_PATH, --bt-backup-path BT_BACKUP_PATH
                        BT_Backup Path Override. 
  -s, --skip-bad-files  Skips bad .fastresume files instead of exiting. Default behavior is to exit.
  -l {DEBUG,INFO}, --log-level {DEBUG,INFO}
                        Log Level, Default is INFO.

By default, everything happens in the BT_Backup directory defined by the OS the script is running on. Override BT_Backup path if needed.

Default BT_Backup paths:

  • Windows: %LOCALAPPDATA%/qBittorrent/BT_Backup
  • Linux/Mac: $HOME/.local/share/data/qBittorrent/BT_backup

A backup zip archive is automatically created in the directory that contains the BT_Backup directory. Default, for instance, would be the qBittorrent directory mentioned above.

Examples

Assuming all of our torrents are in X:\Torrents when coming from Windows, or /torrents when coming from Linux/Mac

qbt_migrate -e X:\ -n Z:\ -t Windows  # Windows to Windows (Drive letter change)
qbt_migrate -e X:\Torrents -n X:\NewDir\Torrents -t Windows  # Windows to Windows (Directory Change)
qbt_migrate -e X:\Torrents -n Z:\NewDir\Torrents -t Windows  # Windows to Windows (Drive letter change with directory change)
qbt_migrate -e X:\Torrents -n /torrents -t Linux  # Windows to Linux/Mac (converts slashes)

qbt_migrate -e /torrents -n /new/path/for/torrents  # Changes torrent root path on Linux/Mac
qbt_migrate -e /torrents -n Z:\Torrents -t Windows  # Linux/Mac to Windows (converts slashes)

Docker

You can also run this tool with Docker if you don't have Python, or don't want to install the package to your system directly. The BT_Backup path is automatically overridden to /tmp/BT_Backup, so mount your BT_Backup there.

The Docker image has all functionality as the pip install, following the same arguments/patterns listed in the above examples.

For example, mounting in the default BT_Backup path on a Windows machine running Docker

docker run -v %LOCALAPPDATA%/qBittorrent/BT_Backup:/tmp/BT_Backup jslay88/qbt_migrate -e X:\ -n Z:\  # Windows to Windows (Drive letter change)
docker run -v %LOCALAPPDATA%/qBittorrent/BT_Backup:/tmp/BT_Backup jslay88/qbt_migrate -e X:\Torrents -n X:\NewDir\Torrents -t Windows  # Windows to Windows (Directory Change)
...

Mounting in the default BT_Backup path on a Linux/Mac machine running Docker

docker run -v $HOME/.local/share/data/qBittorrent/BT_backup:/tmp/BT_Backup jslay88/qbt_migrate -e X:\ -n Z:\  # Windows to Windows (Drive letter change)
docker run -v $HOME/.local/share/data/qBittorrent/BT_backup:/tmp/BT_Backup jslay88/qbt_migrate -e X:\Torrents -n X:\NewDir\Torrents -t Windows  # Windows to Windows (Directory Change)
...

If for some reason you wanted to override BT_Backup path from /tmp/BT_Backup within the container, simply set environment variable BT_BACKUP_PATH on the container to where you will be mounting in.

The -e for environment variable override must go before the image jslay88/qbt_migrate as the -e after the image is for --existing-path

docker run -v %LOCALAPPDATA%/qBittorrent/BT_Backup:/opt/qbt_migrate/fastresume -e BT_BACKUP_PATH=/opt/qbt_migrate/fastresume jslay88/qbt_migrate -e X:\ -n Z:\  # Windows to Windows (Drive letter change)
...

You can also clone this repository, build the image, and run your own built image

docker build . -t qbt_migrate
docker run -v %LOCALAPPDATA%/qBittorrent/BT_Backup:/tmp/BT_Backup qbt_migrate -e X:\ -n Z:\  # Windows to Windows (Drive letter change)
...

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

qbt_migrate-2.1.0.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

qbt_migrate-2.1.0-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

Details for the file qbt_migrate-2.1.0.tar.gz.

File metadata

  • Download URL: qbt_migrate-2.1.0.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

File hashes

Hashes for qbt_migrate-2.1.0.tar.gz
Algorithm Hash digest
SHA256 f6d3bcddb2231fd9fbbdd4a89db3d392edd7e0272f2af683d3ed2f49eaab1df1
MD5 f4b1a138733cd1ee58cc3d4b45e1a15e
BLAKE2b-256 8f034f0c2e23361d6729f378cd902c2ba096403bfe47a3a9f798fca8d23bc00c

See more details on using hashes here.

File details

Details for the file qbt_migrate-2.1.0-py3-none-any.whl.

File metadata

  • Download URL: qbt_migrate-2.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

File hashes

Hashes for qbt_migrate-2.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e62cd7c23b4fbaafbfe6a3eee4b49be9b2b626f87ba0387496d1ffe643e498a3
MD5 3a31f659495a22be733b5d331b0b0869
BLAKE2b-256 7075a1e59e0f3230cdcc0fd56a341ceb681a03fe9e957cb95650fcff4202e5ec

See more details on using hashes here.

Release history Release notifications | RSS feed

3.3.0

2 files

3.2.0

2 files

3.1.0

2 files

3.0.0

2 files

2.3.2

2 files

2.3.1

2 files

2.3.0

2 files

2.2.1

2 files

2.2.0

2 files

2.1.6

2 files

2.1.5

2 files

2.1.4

2 files

2.1.3

2 files

2.1.2

2 files

This release

2.1.0 This release

2 files

2.0.1

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page