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

Retaining scores and ratings from an older collection

Tags: None
(comma "," separated)
hazica
Registered Member
Posts
3
Karma
0
Hello there.

(This is definitely not a Kubuntu related problem)

First, the background info: I'm using Amarok 1.4.7 under Kubuntu 7.10 in conjunction with a MySQL database. On a different partition, I still have Kubuntu 7.04, which I've used for about half a year, with some late version (I can't exactly remember which one) of Amarok. I used to do regular backups of the Amarok MySQL database so after migrating to the 7.10 on a different partition, I thought I might trick Amarok into using the old collection info, so that I could keep my scores and ratings. It might also be worth mentioning that I keep all of my music on 2 different partitions... full of nothing but music.

So, after restoring the old database, I used phpMyAdmin to update the device ids for each partition and... voila... it worked! Ratings and everything else. Then, after a while, adding albums to the collection started going wrong: every newly added album name would be "Nice 'n' Easy" (a Sinatra album) in spite of the songs having correct tags. (I am sort of a tag Nazi)

Not knowing what had caused the problem, I decided to delete the whole Amarok database, create a new one and restore the old collection again. But then, I figured, I would probably run into the same problem again, some time later on.

So I figured I'd just let Amarok scan the collection from scratch (after having recreated an empty database "amarok") and then just replace the "statistics" table with the old statistics table, and possibly correct some inconsistencies that might have arisen.

First I compared the uniqueid columns in both the old statistics table and the uniqueid table(statistics.uniqueid with uniqueid.uniqueid) to see how many entries from the old statistics table had correspondents in the new collection.(I assumed that the unique ids of the songs are hashes of the path and filename, so they would remain unchanged. I was right :biggrin:) The answer: about 7420 entries from a total of 7480 statistic entries. I deleted the ~60 entries that didn't match any new collection entries, I updated the statistics.deviceid column with the correct device ids found in the table deviceid, crossed my fingers and ran Amarok. Or, I should say, attempted to run Amarok but failed miserably.

After having spent about 4 hours fooling around with the tables, trying to find all sorts of inconsistencies in order to eradicate them, and swearing like a sailor I threw in the towel.

So, this is where you guys and gals come in.

Have any suggestions? What are the consistency conditions for the tables of the database? Might the two "date" columns (in statistics) be responsible for the problem?

If you need any more infos, just ask?

Thanks.
lordxale
Registered Member
Posts
3
Karma
0
Not to bump an ancient thread, but I'm going through a similar experience.

I run Amarok 1.4.7 on Kubuntu 7.10 64-bit on my desktop with a MySQL 5.0.45 database that is stored on another server (Also Kubuntu 7.10).  The music mounts (samba shares) are also stored on this second computer (Keeps me from wiping the database when the music mounts aren't available...because the database won't be either!).

I'm trying to upgrade to K/Ubuntu 8.04 32-bit and before I do I'm testing my most important applications on my laptop which is already running 8.04 32-bit.  What I normally do (have done since, oh, 6.06, maybe even 5.10) is use mysqldump to make a copy of the database, copy the amarokrc from my desktop to my laptop, and import the mysql backup to a second database and have my laptop connect to it.  It has always worked, files, ratings, scores, and all, but I do it just for reassurance. 

This time, my collection is being imported alright, but I'm missing scores and ratings.  I've tried rescanning the database, but obviously to no avail. I don't have any playlists that pick songs by rating or score, but both "use scores" and "use ratings" are checked.  The mount points on the desktop and the laptop are the same.  The usernames for the database are the same.  The only thing that is different is the database name and the computer they run on.

I have about 8000 songs and probably at least 90% of them have been played and the majority of them are even rated.  I've been hanging on to this same database for a long time and really don't want to have to start over, though I suppose I might have to when Amarok 2 comes out.

Has anybody else been carrying their same database around this long? By the way, the laptop is running 1.4.9.1 .  I can keep getting new copies of my working amarokrc and dumps of the "production" version of my database if I need to.  The original poster (probably long gone) brought up the idea of exporting/importing individual tables, but my MySQL experience is basically strictly limited to this application and so I don't know how to do that.

If anybody has any ideas or if you need any more information, let me know!
lordxale
Registered Member
Posts
3
Karma
0
Woohoo! I figured it out.  I imported my statistics table from my working database in to the test one using phpmyadmin.  I've never used that before, but wow it was pretty simple, after all.

Upon further inspection, I have to do the same thing for the lyrics table and a couple of other ones...But when I copied the mysqldump over, it never rescanned the database...I tried using the amarokrc from my desktop like usual, but after awhile i decided to delete it and see where it got me starting from scratch.  If I'm feeling ambitious, maybe I'll copy the dump over to the test database and then look at them before and after I start amarok the first time.  Maybe amarok is arbitrarily deleting tables the first time it fires up? Maybe a mod/developer can shed some light on this.  All I know is that I managed to make it work!

After all this, I'm not sure which copy of my amarokrc I'm actually using on my test installation anymore.  Even still, with lots of backups and stuff when I actually go to upgrade my desktop I'm now at least reasonably confident that I'll be able to carry things over!
User avatar
Ramblurr
Registered Member
Posts
28
Karma
0
OS
Huzzah!

Good job :D


Amarok Developer


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], kde-naveen, Sogou [Bot]