How to change path for a lot of torrents

Linux specific questions, problems.
Post Reply
MarkLE

How to change path for a lot of torrents

Post by MarkLE »

I am using qBittirrent v4.4.1 on Ubuntu 22.04

I have a few hundred torrents that are shared with a number of others. All of these torrents are located in several different sub-folders in a mounted NAS share as such:
/home/user/OLDFOLDERNAME/here/there/multiplefoldernames

I had to change the name of OLDFOLDERNAME to NEWFOLDERNAME in order to allow other programs to access the files downloaded by these torrents.
The only part of the pathname that changed is in caps.

qBittorrent can not access these torrents/files until I change the 'Save at' pathname in the Torrent Options dialog. Once I change the pathname, all is well.

My question is, is there an easier way to change the pathname from:
/home/user/OLDFOLDERNAME/here/there/multiplefoldernames
to:
/home/user/NEWFOLDERNAME/here/there/multiplefoldernames
for several hundred files in a batch or am I stuck with changing each one separately?

My guess would be that the pathname to these torrents has to be stored in a database somewhere that qBittorrent loads during startup. Can anyone tell me where this data is stored and if I can access the database file(s) in which the data is stored so I can change the pathname there?

This is a terrible explanation and I apologize for that. If anyone can help with this I would appreciate it greatly.
unseen19
Veteran
Veteran
Posts: 188
Joined: Mon Mar 15, 2021 1:36 pm

Re: How to change path for a lot of torrents

Post by unseen19 »

Not sure this is achievable this way, but if you find the files concerned (should be in the profile path) the "sed" commande will work.
As a less dangerous alternative please consider the usage of symbolic link (command "ln"). without any change the old folder will be redirected to the correct final location.

https://manpages.ubuntu.com/manpages/xe ... /ln.1.html
You will find example on the Web, make some test and you should be good to go :).
User avatar
Peter
Administrator
Administrator
Posts: 2693
Joined: Wed Jul 07, 2010 6:14 pm

Re: How to change path for a lot of torrents

Post by Peter »

The data is in:
~/.local/share/qBittorrent
~/.config/qBittorrent

But it's not so straightforward.
See: viewtopic.php?t=5889
https://github.com/rumanzo/bt2qbt

Basically the config/data files are not plaintext. But this project, by rumanzo might offer some help.
Post Reply