This forum has been archived. All content is frozen. Please use KDE Discuss instead.

how to recover database info after update to 2.4.3

Tags: None
(comma "," separated)
N7DR
Registered Member
Posts
20
Karma
0
A few days ago I applied an ordinary vanilla Kubuntu update to my vanilla 64-bit Kubuntu 11.10 system. The update included a large number of KDE-related updates.

After applying the update, my amarok database seems to be completely inaccessible to amarok. Amarok no longer seems to have any idea of ratings, dates played, etc.

I have a backup of the .kde directory taken shortly before the update was applied.

I tried replacing the post-update version of the .../mysqle directory with the pre-update version, but amarok still doesn't know anything about my several years' worth of data in the database.

There are several combinations:
old amarok, old mysqle : works
new amarok, new mysqle : no info from database seems to be accessible
new amarok, old mysqle : returns a lot of errors when amarok starts. These errors begin with:

'/home/n7dr/.kde/share/apps/amarok/mysqle/amarok/directories.frm' on INSERT INTO directories(deviceid,changedate,dir) VALUES (-1,1205182025,'./home/n7dr/mp3/regular/alison.krauss.and.union.station/lonely.runs.both.ways/');
GREPME MySQLe query failed! (1033) Incorrect information in file: '/home/n7dr/.kde/share/apps/amarok/mysqle/amarok/directories.frm' on SELECT id, changedate FROM directories WHERE deviceid = -1 AND dir = './home/n7dr/mp3/regular/queen/greatest.hits.3/';
GREPME MySQLe query failed! (1033) Incorrect information in file: '/home/n7dr/.kde/share/apps/amarok/mysqle/amarok/directories.frm' on INSERT INTO directories(deviceid,changedate,dir) VALUES (-1,1306170667,'./home/n7dr/mp3/regular/queen/greatest.hits.3/');
GREPME MySQLe query failed! (1033) Incorrect information in file: '/home/n7dr/.kde/share/apps/amarok/mysqle/amarok/directories.frm' on SELECT id, changedate FROM directories WHERE deviceid = -1 AND dir = './home/n7dr/mp3/regular/cliff.richard/1970s/';
GREPME MySQLe query failed! (1033) Incorrect information in file: '/home/n7dr/.kde/share/apps/amarok/mysqle/amarok/directories.frm' on INSERT INTO directories(deviceid,changedate,dir) VALUES (-1,1156304229,'./home/n7dr/mp3/regular/cliff.richard/1970s/');


What can I do to get all my old amarok data into a format that the new amarok can use?

Thanks
Doc
User avatar
Mamarok
Manager
Posts
6071
Karma
16
OS
Did you try just creating a new database, then import ratings and statistics from the old database?


Running Kubuntu 22.10 with Plasma 5.26.3, Frameworks 5.100.0, Qt 5.15.6, kernel 5.19.0-23 on Ryzen 5 4600H, AMD Renoir, X11
FWIW: it's always useful to state the exact Plasma version (+ distribution) when asking questions, makes it easier to help ...
N7DR
Registered Member
Posts
20
Karma
0
Mamarok wrote:Did you try just creating a new database, then import ratings and statistics from the old database?


How does one do that? I looked (hard) for a way to do that and couldn't find anything.

(I'm relieved to hear that there is supposed to be a way to do that, since it seems like it should work.)

The Help doesn't seem to be searchable :-( But I looked at the section called "The Music Collection" but that just seemed to be about how to add music to the collection, not how to fix missing information.

I looked at the "Import" tool, and thought that maybe "Amarok collection scanner" would do the trick, but it needed a file called ~/result.xml, which doesn't exist.

Anyway, you don't want to hear about my failed attempts. So what's the right way to import the old information?
User avatar
Mamarok
Manager
Posts
6071
Karma
16
OS
Ouch, I never had a closer look at this. The usability is disastrous, sorry for that, I pinged the developer ho made that.

AFAIUI you have to enter in that line the actual xml file from the previous database which is most likely called amarokcollectionscanner_batchscan.xml, located in your old $HOME/.kde/share/apps/amarok/ folder. But maybe I just misunderstood that function as well.


Running Kubuntu 22.10 with Plasma 5.26.3, Frameworks 5.100.0, Qt 5.15.6, kernel 5.19.0-23 on Ryzen 5 4600H, AMD Renoir, X11
FWIW: it's always useful to state the exact Plasma version (+ distribution) when asking questions, makes it easier to help ...
N7DR
Registered Member
Posts
20
Karma
0
Hmmm... pointed the "import" function at the .xml file from the earlier version of amarok I had been running, and then received a hopeful-looking popup that said:

Found directories
Got directory "" from scanner.
Got directory "" from scanner.
...with lots more similar entries

Eventually, the Finish button lit up and I clicked it.

To be safe, I then closed amarok and restarted it.

I was quite optimistic at that point, but unfortunately the exercise doesn't seem to have actually accomplished anything. Double-clicking on any of my dynamic playlists (including, for example, the "Random" one that's provided) won't even populate the playlist at all.

If I click on repopulate, I get entries in the playlist... but they still don't have any of the information from the old database (i.e., they all show up as never having been played or rated).
N7DR
Registered Member
Posts
20
Karma
0
I assume from the silence that no one has any more suggestions as to how I can recover from this database loss :-(

Speaking as a user, if simply applying a vanilla update to a vanilla system can result in a non-recoverable failure like this, something seems awfully wrong somewhere.

After the better part of a decade with amarok, it seems like it's time to look elsewhere. Not an easy decision, but if this has happened once then I can only assume that there are no safeguards in the code to stop it from happening again.
User avatar
Mamarok
Manager
Posts
6071
Karma
16
OS
JFYI: if we don't answer your requests immediately then this simply means that we are busy with real life, we all work on Amarok as volunteers and nobody is payed to do so, be this for coding or for support.

All I can say as an unpaid volunteers is the following: I have not a clue what happened on your system and it definitely should not have happened but I doubt that Amarok is at fault here, since it usually doesn't remove a database that easily. And as you said yourself: you updated your KDE which also uses MySQL through Akonadi.

Are you sure you actually use MySQL and not MariaDB or any other sql flavor which is incompatible with Amarok? I know that a few people had the same problem in another distribution caused by MariaDB and the distribution is clearly to blame in this.


Running Kubuntu 22.10 with Plasma 5.26.3, Frameworks 5.100.0, Qt 5.15.6, kernel 5.19.0-23 on Ryzen 5 4600H, AMD Renoir, X11
FWIW: it's always useful to state the exact Plasma version (+ distribution) when asking questions, makes it easier to help ...
N7DR
Registered Member
Posts
20
Karma
0
I appreciate that people have real lives. I wasn't intending to suggest otherwise. I work on open source code myself, and understand that sometimes support questions go unanswered for a while.

It's hard for me to agree that amarok isn't at fault. I simply applied a vanilla update to a vanilla system. The database didn't disappear... the files are still there following the update; it's just that following the update amarok doesn't display any data from the database.

I thought that amarok used mysqle these days. I'm just using the default, and it sure *looks* like it's using mysqle. I don't know of any tools that allow me to dump mysqle databases into an ASCII format, so I don't know how to investigate this whole issue any better than by posting the symptoms here, as I have done.
User avatar
Oceanwaves
Registered Member
Posts
64
Karma
0
OS
Hi,

I had (or better "still have") a similar problem, it's just a few threads below this one. I'm running Gentoo Linux and Amarok 2.4.3. Gentoo recently updated KDE from 4.6.5 to 4.7.3 (Amarok didn't change, I'm using 2.4.3 since September).

After the update Amarok forgot about all lyrics. Fortunately it remembered everything else like ratings etc. (I lost all my ratings when I switch from Amarok 1.x to 2.x 2 years ago. Since then I'm working on rating all tracks (13,000+) again, I'm currently at 83% with 11,075 rated tracks).

I also have a backup of the complete .kde4 folder from before the KDE update, so I can also do some experiments with old and new mysqle folder.

However it seems what I have now is the best I could get. When I restore my old mysqle folder and start Amarok, it will scan the collection for a long time and will just return with albums, tracks and artists. No scores, no ratings, no lyrics.

I think all the lyrics are still there, as the lyrics file is 14 MB in size. But I have no idea how to force Amarok to see them. Currently I think I have to forget about all the time I spent on the lyrics and start from scratch. At least lyrics are not as important to me as the ratings. If I should loose the ratings again that would be the day that I uninstall Amarok...

Using an internal mysql database was probably a good idea. But it seems we have to rely on Amarok being able to access the database. If something goes wrong with it, we're lost. I have no idea of how one can maintain, export or repair this database...

Oliver
User avatar
Sentynel
KDE Developer
Posts
285
Karma
1
OS
Oceanwaves wrote:Using an internal mysql database was probably a good idea. But it seems we have to rely on Amarok being able to access the database. If something goes wrong with it, we're lost. I have no idea of how one can maintain, export or repair this database...

There's instructions for starting a MySQL daemon on the Amarok embedded database here.
http://amarok.kde.org/wiki/Development/ ... edded#Tips


User avatar
Oceanwaves
Registered Member
Posts
64
Karma
0
OS
Sentynel wrote:There's instructions for starting a MySQL daemon on the Amarok embedded database here.
http://amarok.kde.org/wiki/Development/ ... edded#Tips

Thanks! I was able to start the mysql daemon and connect to the Amarok DB. I think I still have somewhere a book an SQL language and MySQL. Will start to learn how to work with SQL now...

Oliver


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], rockscient