Deluge lost all configs and torrent after upgrade to version 2.0.3

General support for problems installing or using Deluge
c1331886
New User
New User
Posts: 1
Joined: Sun Nov 10, 2019 4:16 pm

Deluge lost all configs and torrent after upgrade to version 2.0.3

Post by c1331886 »

I've recently upgrade my deluge to 2.x version (it was done automatically by apt-get, and I was unaware of it).
However, it lost all of the configs and torrents I had before.

I've checked it, and the config folder is still there at `~/.config/deluge`.
It still has the `state` folder with several torrents inside.
However, they are not loaded when I start the program.

I tried to rename the folder to confirm if it was the correct location, and when I run it again the folder was created at the same place, so I'm sure it is the correct location.

Is there any way to import them again automatically?
JoeDalton
New User
New User
Posts: 9
Joined: Mon Aug 17, 2015 9:20 pm

Re: Deluge lost all configs and torrent after upgrade to version 2.0.3

Post by JoeDalton »

It's a shame.
Behaving in such a way is not only disrespectful for the users, but also likely to discredit Open Source.
Please, urgently publish a transformation routine, so I can use my backup.
I've just lost 7 years of sharing ... in one update.
Joe.
User avatar
Alexey104
Member
Member
Posts: 10
Joined: Wed Jun 19, 2019 5:39 am

Re: Deluge lost all configs and torrent after upgrade to version 2.0.3

Post by Alexey104 »

I had the same problem when updated to 2.0.3 on Arch. I had to manually re-add hundreds of torrents stored on separate partitions of separate hard drives(fortunately, i keep backups of torrent files). That was really painful. Furthermore, sometimes it happens that deluge clears 'torrents.state' file after restart without any reason, so i regularly do a backup of 'state' folder.
mhertz
Moderator
Moderator
Posts: 2215
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: Deluge lost all configs and torrent after upgrade to version 2.0.3

Post by mhertz »

It's likely an issue with non-ascii filenames, which has been fixed in git-develop branch recently, which will be available from v2.0.4, or now in git development builds.

In meantime, tobbez posted some python code to translate your state file:

Code: Select all

import pickle
with open('torrents.state', 'rb') as f:
    d = pickle.load(f, encoding='latin1')

with open('torrents.state', 'wb') as f2:
    pickle.dump(d, f2)
I haven't tried it myself though.

Btw, i'm pretty sure deluge2 backup's your old config when running deluge2 the first time, so if reverting back to deluge1, or a fix comming later for deluge2, then you would be able to make due anyways, but always keep backups nonetheless of everything important as usual.
User avatar
Alexey104
Member
Member
Posts: 10
Joined: Wed Jun 19, 2019 5:39 am

Re: Deluge lost all configs and torrent after upgrade to version 2.0.3

Post by Alexey104 »

mhertz wrote:It's likely an issue with non-ascii filenames, which has been fixed in git-develop branch recently, which will be available from v2.0.4, or now in git development builds.
I'm actually using build from git dev branch (2.0.4.dev20) and it happened several times that all my seeding torrents was gone after restarting deluge and no archive with state backup was created in 'archive' directory. I've created a bug ticket, but there is no any respond yet.
JoeDalton
New User
New User
Posts: 9
Joined: Mon Aug 17, 2015 9:20 pm

Re: Deluge lost all configs and torrent after upgrade to version 2.0.3

Post by JoeDalton »

Hello everybody,

While looking forward to a solution that may come some day (who knows ?), I've created a virtual machine with Fedora 28 (deluge V1 !) and restored config files and torrents.
Everything rolls fine.
spookymulder84
New User
New User
Posts: 7
Joined: Thu Aug 31, 2017 11:40 am

Re: Deluge lost all configs and torrent after upgrade to version 2.0.3

Post by spookymulder84 »

mhertz wrote:It's likely an issue with non-ascii filenames, which has been fixed in git-develop branch recently, which will be available from v2.0.4, or now in git development builds.

In meantime, tobbez posted some python code to translate your state file:

Code: Select all

import pickle
with open('torrents.state', 'rb') as f:
    d = pickle.load(f, encoding='latin1')

with open('torrents.state', 'wb') as f2:
    pickle.dump(d, f2)
I haven't tried it myself though.

Btw, i'm pretty sure deluge2 backup's your old config when running deluge2 the first time, so if reverting back to deluge1, or a fix comming later for deluge2, then you would be able to make due anyways, but always keep backups nonetheless of everything important as usual.
I wanted to say thank you very much for this python code! It really worked for me!! Much love!!!
None of the torrents would show up for me but now it's all here!
mhertz
Moderator
Moderator
Posts: 2215
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: Deluge lost all configs and torrent after upgrade to version 2.0.3

Post by mhertz »

Im glad to hear it and thanks for reporting back mate! All credits for the fix is of tobbez which was extremely helpful when I asked for help in deluge bugtracker and he posted this fix + 3 other fixes I needed initially when wanting to make an unofficial Windows installer(+ a 4th fix also I hadn't noticed myself).
cbrace
Member
Member
Posts: 35
Joined: Thu Jan 31, 2019 4:09 pm
Location: Amsterdam

Re: Deluge lost all configs and torrent after upgrade to version 2.0.3

Post by cbrace »

Hi all,

First, my thanks to mherz for referring me to this thread.

I currently have two instances of Deluge running resp. v1 and v2, on separate systems. The v1 instance has around 1600 active torrents.

How do migrate the v1 torrents to the v2 system using the python code above? Do I run this as a standalone python script?

Presumably it reads the v1 torrents.state file and outputs a v2 friendly version.

How would I then merge this into the v2 instance? Can the two torrents.state files be concatenated in some way?

Hope my questions are clear.

TIA
mhertz
Moderator
Moderator
Posts: 2215
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: Deluge lost all configs and torrent after upgrade to version 2.0.3

Post by mhertz »

Hmm, sorry didn't think off that, yeah that is a problem unfortunetly. I did quick search and old posts stated by devs the torrents.state files cannot be merged unfortunetly, and yes, the fix python code only updates v1 to v2 compatible version. One tried update it with Perl but deluge crashed when 500 torrents and with more than about 10 this issue persisted.

Honestly I don't know sorry, maybe others have any suggestions?
Post Reply