Linux tool for migration from Bittorrent/uTorrent/Deluge to qBittorrent

Linux specific questions, problems.
rumanzo
VIP
VIP
Posts: 141
Joined: Fri Dec 29, 2017 6:46 pm

Re: Linux tool for migration from Bittorrent/uTorrent/Deluge to qBittorrent

Post by rumanzo »

rumanzo wrote: Sun Feb 16, 2020 2:44 pm Original topic viewtopic.php?f=14&t=5889

Disappointed in the existing application on the ruby, which could not handle all my torrents, I wrote my own application on golang.
I tested it on my own torrent database (3k+) and test torrents on Bittorrent/uTorrent clients (version 3+).
Features:
  • Processing all torrents
  • Processing torrents with subdirectories and without subdirectories
  • Processing torrents with renamed files
  • Processing torrents with non-standard encodings (for example, cp1251)
  • Processing of torrents in the not ready state *
  • Save date, metrics, status. **
  • Import of tags and labels
  • Multithreading
  • Path replace mechanism
* This torrents will not be done (0%) and will need force rehash
* If you migrate from windows to linux and use replace function attention that multiple flags -r processing one by one
* If you migrate from windows to linux and yours torrent files saves to some place you must use flag --search with actual paths in yours system
* If you migrate from windows to linux you may need to define path separathor with --sep flag
** The calculation of the completed parts is based only on the priority of the files in torrent
*** Partially downloaded torrents will be visible as 100% completed, but in fact you will need to do a rehash. Without rehash torrents not will be valid. This is due to the fact that conversion of .dat files in which parts of objects are stored is not implemented.

Don't forget before use make backup bittorrent\utorrent, qbittorrent folder. and config %APPDATA%/Roaming/qBittorrent/qBittorrent.ini. Close all this program before.

Usage:
If you MacOs user or Linux user don't forget to make the file executable:

Code: Select all

$ chmod +x bt2qbt_v1.3_amd64_macos
1.) Help (from cmd or powerwhell)

Code: Select all

 C:\Users\user\Downloads\bt2qbt_v1.3_amd64.exe [OPTIONS]

Application Options:
  -s, --source=         Source directory that contains resume.dat and torrents
                        files (default:
                        C:\Users\user\AppData\Roaming\uTorrent\)
  -d, --destination=    Destination directory BT_backup (as default) (default:
                        C:\Users\user\AppData\Local\qBittorrent\BT_backup\)
  -c, --config=         Source directory that contains resume.dat and torrents
                        files (default:
                        C:\Users\user\AppData\Roaming\qBittorrent\qBittorren-

                        t.ini)
      --without-labels  Do not export/import labels
      --without-tags    Do not export/import tags
  -t, --search=         Additional search path for torrents files
                        Example: --search='/mnt/olddisk/savedtorrents'
                        --search='/mnt/olddisk/workstorrents'
  -r, --replace=        Replace paths.
                        Delimiter for from/to is comma - ,
                        Example: -r "D:\films,/home/user/films" -r
                        "D:\music,/home/user/music"

      --sep=            Default path separator that will use in all paths. You
                        may need use this flag if you migrating from windows to
                        linux in some cases (default: \)

Help Options:
  -h, --help            Show this help message
2.) If you just run application, it will processing torrents from %APPDATA%\uTorrent\ to %LOCALAPPDATA%\qBittorrent\BT_BACKUP\
Example:

Code: Select all

It will be performed processing from directory C:\Users\user\AppData\Roaming\uTorrent\ to directory C:\Users\user\AppData\Local\qBittorrent\BT_backup\
Check that the qBittorrent is turned off and the directory C:\Users\user\AppData\Local\qBittorrent\BT_backup\ and config C:\Users\user\AppData\Roaming\qBittorrent\qBittorrent.ini is backed up.


Press Enter to start

Started
1/2 Sucessfully imported 1.torrent
2/2 Sucessfully imported 2.torrent

Press Enter to exit
3.) Run application from cmd or powershell with keys, if you want change source dir or destination dir, or export/import behavior
Example:

Code: Select all

C:\Users\user\Downloads> .\bt2qbt_v1.3_amd64.exe -s C:\Users\user\AppData\Roaming\BitTorrent\
It will be performed processing from directory C:\Users\user\AppData\Roaming\BitTorrent\ to directory C:\Users\user\AppData\Local\qBittorrent\BT_backup\
Check that the qBittorrent is turned off and the directory C:\Users\user\AppData\Local\qBittorrent\BT_backup\ is backed up.

Press Enter to start
Started
1/3233 Sucessfully imported 1.torrent
2/3233 Sucessfully imported 2.torrent
3/3233 Sucessfully imported 3.torrent
...
3231/3233 Sucessfully imported 3231.torrent
3232/3233 Sucessfully imported 3232.torrent
3233/3233 Sucessfully imported 3233.torrent

Press Enter to exit
Known issuses:
  • Unknown
Here's the project: https://github.com/rumanzo/bt2qbt
Code:  https://github.com/rumanzo/bt2qbt/blob/master/bt2qbt.go
Releases: https://github.com/rumanzo/bt2qbt/releases

Deluge branch:
Here's the project: https://github.com/rumanzo/deluge2qbt
code: https://github.com/rumanzo/deluge2qbt/b ... uge2qbt.go
Releases: https://github.com/rumanzo/deluge2qbt/releases

If there are any errors or if it help you - write there
lordrak

Re: Linux tool for migration from Bittorrent/uTorrent/Deluge to qBittorrent

Post by lordrak »

Hi,
i have same problem as this topic title.
I have uTorrent in some folder like d:\uTorr but uTorrent configured to store torrent files to e:\torrents\...
Can't decode torrent file d:\uTorr\e:\torrents\file.torrent for e:\torrents\file.torrent
using --replace "d:\uTorr\," des not take an effect. I have tried --replace "d:\uTorr\,something" also to test replace with not blak replace.
How i can migrate that?
Thank you
rumanzo
VIP
VIP
Posts: 141
Joined: Fri Dec 29, 2017 6:46 pm

Re: Linux tool for migration from Bittorrent/uTorrent/Deluge to qBittorrent

Post by rumanzo »

lordrak wrote: Sat Jan 09, 2021 7:28 am Hi,
i have same problem as this topic title.
I have uTorrent in some folder like d:\uTorr but uTorrent configured to store torrent files to e:\torrents\...
Can't decode torrent file d:\uTorr\e:\torrents\file.torrent for e:\torrents\file.torrent
using --replace "d:\uTorr\," des not take an effect. I have tried --replace "d:\uTorr\,something" also to test replace with not blak replace.
How i can migrate that?
Thank you
Hi! You need use -s flag
lordrak

Re: Linux tool for migration from Bittorrent/uTorrent/Deluge to qBittorrent

Post by lordrak »

Hi,
i am using -s parameter. Without it i got Cannot find utorrent...
this is my complete cmd
bt2qbt_v1.8_amd64.exe -s "d:\uTorr" -d "d:\qbittorren\profile\qBittorrent\data\BT_backup\" -c "d:\qbittorren\profile\qBittorrent\config\qBittorrent.ini" --replace "d:\uTorr\,"
Then i got for all files error: Can't decode torrent file d:\uTorr\e:\torrents\file.torrent for e:\torrents\file.torrent
lordrak

Re: Linux tool for migration from Bittorrent/uTorrent/Deluge to qBittorrent

Post by lordrak »

I have forgot wriote i am trying migrate from uTorrent to qB on Windows.
rumanzo
VIP
VIP
Posts: 141
Joined: Fri Dec 29, 2017 6:46 pm

Re: Linux tool for migration from Bittorrent/uTorrent/Deluge to qBittorrent

Post by rumanzo »

lordrak wrote: Sat Jan 09, 2021 1:05 pm I have forgot wriote i am trying migrate from uTorrent to qB on Windows.
Why you use replace flag? Probably you don't need them
lordrak

Re: Linux tool for migration from Bittorrent/uTorrent/Deluge to qBittorrent

Post by lordrak »

Probably misunderstood how to use it.
But i have use it because i am trying to solve my problem where bt2qbt contactenate absolute path of source and absolute path of torrent file which mialy not when it contains full path (ex starting like d:\)
I am not sure, hot i can solve it by me.
rumanzo
VIP
VIP
Posts: 141
Joined: Fri Dec 29, 2017 6:46 pm

Re: Linux tool for migration from Bittorrent/uTorrent/Deluge to qBittorrent

Post by rumanzo »

lordrak wrote: Sat Jan 09, 2021 2:34 pm Probably misunderstood how to use it.
But i have use it because i am trying to solve my problem where bt2qbt contactenate absolute path of source and absolute path of torrent file which mialy not when it contains full path (ex starting like d:\)
I am not sure, hot i can solve it by me.
Tell me, where you utorrent/qbittirrent profile and do you change torrent save paths (files i mean)
lordrak

Re: Linux tool for migration from Bittorrent/uTorrent/Deluge to qBittorrent

Post by lordrak »

uTorrent path where resume.dat is also is d:\uTorr
Location of torrents files are located in different path: e:\torrents\


Then i got for all files error: Can't decode torrent file d:\uTorr\e:\torrents\file.torrent for e:\torrents\file.torrent
rumanzo
VIP
VIP
Posts: 141
Joined: Fri Dec 29, 2017 6:46 pm

Re: Linux tool for migration from Bittorrent/uTorrent/Deluge to qBittorrent

Post by rumanzo »

lordrak wrote: Sat Jan 09, 2021 2:56 pm uTorrent path where resume.dat is also is d:\uTorr
Location of torrents files are located in different path: e:\torrents\


Then i got for all files error: Can't decode torrent file d:\uTorr\e:\torrents\file.torrent for e:\torrents\file.torrent
May be it's a bug, I need to check it.
lordrak

Re: Linux tool for migration from Bittorrent/uTorrent/Deluge to qBittorrent

Post by lordrak »

Ok, how i can assist to you?
rumanzo
VIP
VIP
Posts: 141
Joined: Fri Dec 29, 2017 6:46 pm

Re: Linux tool for migration from Bittorrent/uTorrent/Deluge to qBittorrent

Post by rumanzo »

lordrak wrote: Sun Jan 10, 2021 10:22 am Ok, how i can assist to you?
I build new version, if I clearly understand your problem it must help, try it. And don't use replace flag if you don't change any torrents paths.
lordrak

Re: Linux tool for migration from Bittorrent/uTorrent/Deluge to qBittorrent

Post by lordrak »

Perfect, not it is working. Thank you for very quick support.
May be i have one enhacement. Whe i use -d flag with path ends with back slash (like that: "d:\qbittorren\profile\qBittorrent\data\BT_backup\") your convertor shows error "Can't create qBittorrent fastresume file d:\qbittorren\profile\qBittorrent\data\BT_backup"
When i use without backslash (like that: "d:\qbittorren\profile\qBittorrent\data\BT_backup") it is works.
Can you add in future some fix to thet? Sometimes it is confusing because where user back slas at the end of path and where do not.
Thank you
Lordrak
rumanzo
VIP
VIP
Posts: 141
Joined: Fri Dec 29, 2017 6:46 pm

Re: Linux tool for migration from Bittorrent/uTorrent/Deluge to qBittorrent

Post by rumanzo »

lordrak wrote: Sun Jan 10, 2021 8:58 pm Perfect, not it is working. Thank you for very quick support.
May be i have one enhacement. Whe i use -d flag with path ends with back slash (like that: "d:\qbittorren\profile\qBittorrent\data\BT_backup\") your convertor shows error "Can't create qBittorrent fastresume file d:\qbittorren\profile\qBittorrent\data\BT_backup"
When i use without backslash (like that: "d:\qbittorren\profile\qBittorrent\data\BT_backup") it is works.
Can you add in future some fix to thet? Sometimes it is confusing because where user back slas at the end of path and where do not.
Thank you
Lordrak
It's very strange https://github.com/rumanzo/bt2qbt/blob/ ... #L309-L311 , I don't know what I must fix
rumanzo
VIP
VIP
Posts: 141
Joined: Fri Dec 29, 2017 6:46 pm

Re: Linux tool for migration from Bittorrent/uTorrent/Deluge to qBittorrent

Post by rumanzo »

carolynperry wrote: Fri Apr 02, 2021 3:03 pm but access to the torrent file is needed, and in the case of a system migrated to Linux, it is impossible to determine whether the former paths were mounted and where they were mounted.
Hi. You need use --search flag and replace flag for paths if you migrate
Post Reply