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

Q: how to move collection to new hard drive?

Tags: None
(comma "," separated)
N7DR
Registered Member
Posts
20
Karma
0
This is probably embarrassingly simple, but nothing I've tried works (including searching for answers).

I have a collection of music and Amarok files on disk A, which until a few days ago was my boot disk and contained dapper.

I have now added a drive B, which is my new boot disk, containing gutsy.

I want to transfer my collection and all the Amarok settings to drive B, so that I can overwrite drive A and use it for something else (probably in another computer), while maintaining access to my music ratings, etc.

I have moved all the music files and installed Amarok. I thought that if I simply copied the collection.db file from drive A t drive B that would do the trick, or at least most of it. But no. It looks like Amarok is smart enough to realise that I have changed the disk on which the collection resides, and refers back to the music files on drive A instead of the new ones on drive B.

Is there a simple explanation of how to perform this transfer? (It seems like something that people must do quite often, so I can't imagine that it's hard.)
N7DR
Registered Member
Posts
20
Karma
0
OK, so I didn't receive any replies to my question.

I figured out a really ugly way to do this. There has to be a much better way (in fact, it's hard to imagine a worse way than this), but for the record the following seems to have worked:

1. save the old collection.db file in collection.dapper.db
2. start amarok on the new OS.
3. quit amarok (i.e., don't actually do anything).
4. save the new collection.db in collection.gutsy.db.
5. sqlite3 .dump collection.dapper.db > collection.dapper.dump
6. sqlite3 .dump collection.gutsy.db > collection.gutsy.dump
7. With an editor open collection.dapper.dump and collection.gutsy.dump
8. locate the line in collection.dapper.dump where the device corresponding to the old hard drive is entered into the "devices" table
  (in my case:
    INSERT INTO "devices" VALUES(3,'uuid',NULL,'/home','/org/freedesktop/Hal/devices/volume_uuid_b264f788_5fbd_411d_a10f_bc98c90f60ae',NULL,NULL);
  )
9. locate the line in collection.gutsy.dump where the device corresponding to the new hard drive is entered into the "devices" table
  (in my case:
  INSERT INTO "devices" VALUES(3,'uuid',NULL,'/home','/org/freedesktop/Hal/devices/volume_uuid_4e4c317e_e1ad_46b3_9bab_8a70b3735483',NULL,NULL);
  )
10. replace the device UUID from step 8 with the device UUID from step 9
11. save the (now edited) file collection dapper.dump as collection.new-gutsy.dump
12. rm collection.db
13. sqlite3 collection.db
14. .read collection.new-gutsy.dump
15. .quit

At this point, running amarok on the new system should work (it did here)

I make no apology for the painfulness of this process. There simply HAS to be something much easier, but it was much less time-consuming for me to reverse-engineer the above procedure than to guess the "correct" way.

  Doc Evans
User avatar
dangle_wtf
Moderator
Posts
1252
Karma
0
Actually, you've probably done it the only way you can.
You could possibly simplify the process (as long as you're using the same version of amarok in each case) by just backing up the collection.db then editing the device UUID.
Have a look for some of the other threads here covering moving collections, as well as fixing problems after a collection has been moved without taking precautions. Sorry I can't point you to anything in particular at the moment.


"There are two theories to arguing with women. Neither one works."
.
If men could get pregnant, we'd learn the true meaning of "screaming nancyboy wuss"
WPhyer
Registered Member
Posts
3
Karma
0
N7DR wrote:OK, so I didn't receive any replies to my question.

I figured out a really ugly way to do this. There has to be a much better way (in fact, it's hard to imagine a worse way than this), but for the record the following seems to have worked:


Your way may have been ugly, but it worked like a charm. I was able to successfully move my collection from my local drive to a NAS drive using your method. All ratings and statistics were preserved. Thanks!

-William


Bookmarks



Who is online

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