Restore/Synchronize Database 3.1.2 (2013-08-31) [MM3+]

Download and get help for different MediaMonkey for Windows 4 Addons.

Moderators: Peke, Gurus

nynaevelan
Posts: 5559
Joined: Wed Feb 07, 2007 11:07 pm
Location: New Jersey, USA
Contact:

Re: Restore PlayHistory/DateAdded/Playlists 1.4 (2009-11-16)

Post by nynaevelan »

Unfortunately Z I think the number of users who want to retain their data from db to db is in the minority, but rest assured this script is still a part of my must have list. It is used regularly when rebuilding my db on my laptop and work computers.
3.2x - Win7 Ultimate (Zen Touch 2 16 GB/Zen 8GB)
Link to Favorite Scripts/Skins

Join Dropbox, the online site to share your files
MattTown
Posts: 251
Joined: Sun Mar 15, 2009 5:09 pm
Location: Australia

Re: Restore PlayHistory/DateAdded/Playlists 1.4 (2009-11-16)

Post by MattTown »

Hi, just wanted to add my vote for the value of this script. I have moved my MM installation through several PC upgrades and have managed to lose the playhistory/dateadded/playlists data in each move, probably because "TURN OFF FILE MONITOR" isn't written in large letters in the "move database" wiki and the monitor process at first start on the new machine overwrote the original values before I understood what was happening. So, I will be using this script to recover the original values from old DB copies.

Thanks in advance.
MM 2024.3003 (WEF 9 Mar 2024, Portable Mode), Gold lifetime license, user since 2009.
Currently 25K files. Library and music files are on a separate partition (E:\) on external USB drive.
Windows Surface Book (Original), i5, 8GB RAM, 250GB SSD.
Win10 Home 64 bit, update: 22H2 19045.3570
MMA 2.0.0.1103, Android 13 on Nokia XR20, music files on SD card.
martialartsguy
Posts: 312
Joined: Mon Apr 03, 2006 9:11 am
Location: Denver, CO

Re: Restore PlayHistory/DateAdded/Playlists 1.4 (2009-11-16)

Post by martialartsguy »

Just re-used this script again after a computer crash and new MM3 install. Great job, but I have one comment.

After re-adding all my tracks to MM, I used this script to restore my play history, date added and playlists, but noticed an odd problem. Some of my playlists were mislabeled, pointing to the wrong artist or album. I've since gone through and manually changed these playlists, but was just wondering if that was an error anyone else has had?

Other than this, no problems whatsoever, great script!
MM Gold since 2006
ZvezdanD
Posts: 3257
Joined: Thu Jun 08, 2006 7:40 pm

Re: Restore PlayHistory/DateAdded/Playlists 1.4 (2009-11-16)

Post by ZvezdanD »

martialartsguy wrote:Some of my playlists were mislabeled, pointing to the wrong artist or album.
I am not sure how this is possible. I think it could happen only if you have tracks before and after the backup with same path or checksum, but changed artist or album. Here is the precedence of checking if some track from the backup database is matched with tracks from the new database:

1. full paths (folder\filename.extension)
2. checksums (made after click on Files To Edit / Duplicate Content)
3. filename with extension AND FileLength AND Album AND Year AND TrackNumber
4. filename without extension AND SongLength AND Artist AND Album AND Year AND TrackNumber.

As you could see, if some track from the backup has same path as some track from the new database, it is considered as matched even if they have different artist, album, tracknumber...

If you think this is not the case, it could be helpful if you send me your backup and new (right after adding tracks) database files, so I could try to reproduce this problem. Please, send me PM and I would describe you how to send me files.
Magic Nodes 4.3.3 / 5.2 RegExp Find & Replace 4.4.9 / 5.2  Invert Selection/Select None 1.5.1  Export/Create Playlists for Child Nodes 4.1.1 / 5.4.1  Expand Child Nodes/Expand All 1.1.2  Event Logger 2.7  Filtered Statistics Report 1.6  Track Redirection & Synchronization 3.4.2  Restore/Synchronize Database 3.1.8 / 4.0.1  Find Currently Playing Track 1.3.2  Queue List 1.2.1  Add to Library on Play 1.0.1  Tree Report for Child Nodes 1.1.1  Update Location of Files in Database 1.4.5 / 2.3  Inherit Child Playlists 1.0.3  Add Currently Playing/Selected Track(s) to Playlist 1.2
Saiyavenger
Posts: 29
Joined: Mon Apr 13, 2009 7:41 pm

Re: Restore PlayHistory/DateAdded/Playlists 1.4 (2009-11-16)

Post by Saiyavenger »

This is really gonna come in handy if I do decide to redo my library. Major props.
martialartsguy
Posts: 312
Joined: Mon Apr 03, 2006 9:11 am
Location: Denver, CO

Re: Restore PlayHistory/DateAdded/Playlists 1.4 (2009-11-16)

Post by martialartsguy »

ZvezdanD wrote:
martialartsguy wrote:If you think this is not the case, it could be helpful if you send me your backup and new (right after adding tracks) database files, so I could try to reproduce this problem. Please, send me PM and I would describe you how to send me files.
PM Sent.
MM Gold since 2006
ZvezdanD
Posts: 3257
Joined: Thu Jun 08, 2006 7:40 pm

Re: Restore PlayHistory/DateAdded/Playlists 1.4 (2009-11-16)

Post by ZvezdanD »

martialartsguy wrote:PM Sent.
Thanks for sending me your databases. You are right, there is a problem with autoplaylists. Unfortunately, this problem is too complicated to resolve and I am not sure if I would do anything about it. If you are interested about technical details, you could read my further explanation.

Each autoplaylist is represented with one record in Playlists table of database. That table has QueryData field which contains hex encoded settings of particular autoplaylists that is originally in some kind of ini form, something like this:

[AdvCond1]
DBField=Artists.Artist
DBFieldPerType=1
Condition=301
Value=295

So, instead of your autoplaylist condition "Artist" "is" "H.P. Lovecraft", the database has stored something like Artists.Artist = 295. That number is ID of that artist in the old (backup) database and that artist have another ID in the new (current) database because of different adding order. Also, I suppose that Condition=301 is replacement for "is" condition that you have in Autolaylist dialog box. As you could see, this is all undocumented with so many unknown variables, since each autoplaylist could contain many conditions with different fields and because of that it is hard to resolve.
Magic Nodes 4.3.3 / 5.2 RegExp Find & Replace 4.4.9 / 5.2  Invert Selection/Select None 1.5.1  Export/Create Playlists for Child Nodes 4.1.1 / 5.4.1  Expand Child Nodes/Expand All 1.1.2  Event Logger 2.7  Filtered Statistics Report 1.6  Track Redirection & Synchronization 3.4.2  Restore/Synchronize Database 3.1.8 / 4.0.1  Find Currently Playing Track 1.3.2  Queue List 1.2.1  Add to Library on Play 1.0.1  Tree Report for Child Nodes 1.1.1  Update Location of Files in Database 1.4.5 / 2.3  Inherit Child Playlists 1.0.3  Add Currently Playing/Selected Track(s) to Playlist 1.2
martialartsguy
Posts: 312
Joined: Mon Apr 03, 2006 9:11 am
Location: Denver, CO

Re: Restore PlayHistory/DateAdded/Playlists 1.4 (2009-11-16)

Post by martialartsguy »

Wow, I think I get it. So basically when a new DB is created, it also creates the new numbering for the artist, etc., correct?

I guess I'll have to figure out another way to organize my playlists, or another way to back them up. Still, this script is awesome for the playhistory & date added! :D
MM Gold since 2006
Lowlander
Posts: 56491
Joined: Sat Sep 06, 2003 5:53 pm
Location: MediaMonkey 5

Re: Restore PlayHistory/DateAdded/Playlists 1.4 (2009-11-16)

Post by Lowlander »

ZvezdanD
Posts: 3257
Joined: Thu Jun 08, 2006 7:40 pm

Re: Restore PlayHistory/DateAdded/Playlists 1.4 (2009-11-16)

Post by ZvezdanD »

martialartsguy wrote:So basically when a new DB is created, it also creates the new numbering for the artist, etc., correct?
Yes, exactly.
Magic Nodes 4.3.3 / 5.2 RegExp Find & Replace 4.4.9 / 5.2  Invert Selection/Select None 1.5.1  Export/Create Playlists for Child Nodes 4.1.1 / 5.4.1  Expand Child Nodes/Expand All 1.1.2  Event Logger 2.7  Filtered Statistics Report 1.6  Track Redirection & Synchronization 3.4.2  Restore/Synchronize Database 3.1.8 / 4.0.1  Find Currently Playing Track 1.3.2  Queue List 1.2.1  Add to Library on Play 1.0.1  Tree Report for Child Nodes 1.1.1  Update Location of Files in Database 1.4.5 / 2.3  Inherit Child Playlists 1.0.3  Add Currently Playing/Selected Track(s) to Playlist 1.2
ZvezdanD
Posts: 3257
Joined: Thu Jun 08, 2006 7:40 pm

Re: Restore PlayHistory/DateAdded/Playlists 1.4 (2009-11-16)

Post by ZvezdanD »

Lowlander wrote:Try Backup Playlist: http://mediamonkey.com/forum/viewtopic. ... p+playlist
It has the same problem, just tried and looked at its source code.
Magic Nodes 4.3.3 / 5.2 RegExp Find & Replace 4.4.9 / 5.2  Invert Selection/Select None 1.5.1  Export/Create Playlists for Child Nodes 4.1.1 / 5.4.1  Expand Child Nodes/Expand All 1.1.2  Event Logger 2.7  Filtered Statistics Report 1.6  Track Redirection & Synchronization 3.4.2  Restore/Synchronize Database 3.1.8 / 4.0.1  Find Currently Playing Track 1.3.2  Queue List 1.2.1  Add to Library on Play 1.0.1  Tree Report for Child Nodes 1.1.1  Update Location of Files in Database 1.4.5 / 2.3  Inherit Child Playlists 1.0.3  Add Currently Playing/Selected Track(s) to Playlist 1.2
martialartsguy
Posts: 312
Joined: Mon Apr 03, 2006 9:11 am
Location: Denver, CO

Re: Restore PlayHistory/DateAdded/Playlists 1.4 (2009-11-16)

Post by martialartsguy »

Bummer that...if I remember rightly, that's why I quit using that script a while ago.

Going to have to rethink my backup plan. Thanks for your help Lowlander, and a special thanks to Zvezdan!
MM Gold since 2006
ZvezdanD
Posts: 3257
Joined: Thu Jun 08, 2006 7:40 pm

Re: Restore PlayHistory/DateAdded/Playlists 1.4 (2009-11-16)

Post by ZvezdanD »

martialartsguy wrote:Going to have to rethink my backup plan.
Actually, only auto-playlists with Tempo/Mood/Occasion/Quality "is" and Genre/Artist/Album Artist/Composer/Conductor/Lyricist "equal/not equal" conditions are (was) affected. Anyway, there is the new release with resolved that problem: v1.4.2 - 2010-09-03
* Fixed: problem with some auto-playlists.
Magic Nodes 4.3.3 / 5.2 RegExp Find & Replace 4.4.9 / 5.2  Invert Selection/Select None 1.5.1  Export/Create Playlists for Child Nodes 4.1.1 / 5.4.1  Expand Child Nodes/Expand All 1.1.2  Event Logger 2.7  Filtered Statistics Report 1.6  Track Redirection & Synchronization 3.4.2  Restore/Synchronize Database 3.1.8 / 4.0.1  Find Currently Playing Track 1.3.2  Queue List 1.2.1  Add to Library on Play 1.0.1  Tree Report for Child Nodes 1.1.1  Update Location of Files in Database 1.4.5 / 2.3  Inherit Child Playlists 1.0.3  Add Currently Playing/Selected Track(s) to Playlist 1.2
Dreadlau
Posts: 1967
Joined: Sun Nov 25, 2007 6:49 am

Re: Restore PlayHistory/DateAdded/Playlists 1.4 (2010-09-03

Post by Dreadlau »

Hello.

I just wanted to thank you for the script.
It worked perfectly and it's very handy.

Just a little inconvenience. After the script finished his work.
It showed the confirmation message hidden behind the main Mediamonkey window.
At first I thought my Mediamonkey was frozen until I clicked on the MM taskbar icon to show the message.
Seven Ultimate X64 SP1 / Sansa Clip 2go (with RockBox)
ZvezdanD
Posts: 3257
Joined: Thu Jun 08, 2006 7:40 pm

Re: Restore PlayHistory/DateAdded/Playlists 1.4 (2010-09-03

Post by ZvezdanD »

Dreadlau wrote:I just wanted to thank you for the script.
It worked perfectly and it's very handy.

Just a little inconvenience. After the script finished his work.
It showed the confirmation message hidden behind the main Mediamonkey window.
At first I thought my Mediamonkey was frozen until I clicked on the MM taskbar icon to show the message.
I am glad that you found it useful. Yes, I am aware about the mentioned behavior. Unfortunately, it is not up to my add-on, but because of some bug in MM with its window's focus. I reported many times about these irregularities, but MM developers haven't done anything about it. I hope that MM 4.0 would be better in regard with that, but don't count on it too much.
Magic Nodes 4.3.3 / 5.2 RegExp Find & Replace 4.4.9 / 5.2  Invert Selection/Select None 1.5.1  Export/Create Playlists for Child Nodes 4.1.1 / 5.4.1  Expand Child Nodes/Expand All 1.1.2  Event Logger 2.7  Filtered Statistics Report 1.6  Track Redirection & Synchronization 3.4.2  Restore/Synchronize Database 3.1.8 / 4.0.1  Find Currently Playing Track 1.3.2  Queue List 1.2.1  Add to Library on Play 1.0.1  Tree Report for Child Nodes 1.1.1  Update Location of Files in Database 1.4.5 / 2.3  Inherit Child Playlists 1.0.3  Add Currently Playing/Selected Track(s) to Playlist 1.2
Post Reply