Restore/Synchronize Database
- MediaMonkey Add-on -
(former Restore PlayHistory/Playlists/Metadata)
Version 3.0.2

by Zvezdan Dimitrijevic

This add-on could be used with MediaMonkey v3.0 or higher. It could restore or synchronize (merge) the following data from/to some backup database file:
- playing history (the Played table and Playcount + LastTimePlayed fields in the Songs table),
- playlists (auto-playlists and/or static ones in Playlists and PlaylistSongs tables),
- filters [MM3 db] / collections [MM4 db] and views (Filters, Views and NodeViews tables), and/or
- specified fields from the Songs table (e.g. Artist, Title or DateAdded field, however for some fields some another tables would be updated as well, e.g. Genres and GenresSongs if you specify Genre for restore).

This add-on could restore/synchronize data for all tracks in the current database or just filtered or selected ones. It could import/export data even from/to the backup file which is not a copy of the current database, i.e. the current database could be created from the ground after the last backup, as soon as they contain the same tracks. The track from the backup file is considered as matched with the track from the current database file if they have the same:
1. full path (folders\filename.extension) OR
2. checksum (made after click on Files To Edit / Duplicate Content) OR
3. filename with extension AND FileLength AND Album AND Year AND TrackNumber OR
4. path without drive letter, first folder & extension AND SongLength OR
5. filename without extension AND SongLength AND AlbumArtist AND Album AND Year AND TrackNumber.

The 2-5. criteria cover situations with modified track locations after backup. The 4-5. criteria further cover situations with different audio formats in the backup and current databases, e.g. if the backup database contains .flac tracks and the current one contains .mp3 tracks instead, but with the same filename, song length and other mentioned tags. The 2-5. criteria have the true condition only if there are exactly two matched tracks - if there are three or more tracks matched with those criteria, they would return the false condition and such tracks should have same full paths to be considered as matched. The data for tracks that are not matched between current and backup database files would not be restored.

If you have adequate backup file, this add-on could be used as Undo tool as well. Let say that you have edited some tag/field in bunch of tracks and after that you have changed your mind. Nothing to worry: just select files that are affected, specify which tags you want to restore and the add-on would import that data from the specified backup file into the current database.

For a discussion about this add-on, you could visit the related MediaMonkey forum thread.

Download:

Latest version of the add-on

You could also take a look on my other add-ons for MediaMonkey.
Visitors since
2009-08-19
free counters

Donation:

These add-ons are donationware. Their development took considerable amount of time, so if you found these add-ons useful and want to help their further development, it would be nice if you send some small donation. You could donate as much as you think that is appropriate, any amount would be really appreciated. NEW! Now with the PayPal option!.

What is new:

v3.0.2 - 2012-01-25

v3.0.1 - 2012-01-12

v3.0 - 2012-01-09

v2.1.3 - 2011-12-09

v2.1.2 - 2011-11-15

v2.1.1 - 2011-08-04

v2.1 - 2011-07-19

v2.0 - 2011-07-17

v1.4.2 - 2010-09-03

v1.4.1 - 2009-11-16

v1.4 - 2009-08-28

v1.3 - 2009-08-26

v1.2 - 2009-08-23

v1.1.2 - 2009-08-21

v1.1.1 - 2009-08-21

v1.1 - 2009-08-21

v1.0 - 2009-08-19

Installation:

Just double-click on the RestorePlayHistory-xx.mmip file; if you are on Vista or Win7 and you got "Product installation error", make sure you have MM set to "Run as Administrator"; if you downloaded the installation package with IE and it changed its extension to a .zip, you should first change it back to a .mmip.

Usage:

Choose the Tools > Scripts > Restore/Synchronize Database option, specify the external (backup) database file with which you want to restore data, turn on the Clear Played/Playlists table... options if you want to restore data or turn them off if you want to merge data, adjust other options, click the Export button if you want to restore data in the external file or click Import if you want to restore data in the current database, and wait for the add-on to finish. It is rather slow and needs several minutes with larger databases.

If you have Clear ... table option turned off, i.e. if you want to merge data, and if you run this add-on twice with the same backup file, it will not add the playhistory/playlists twice - the add-on will compare those data from the backup and current database files and if they are same it will skip them. Same state for filters data, but that option has not a possibility to clear related tables anyway.

This add-on used in MM3 has two possible methods of restoring static playlists. The default method is very slow, but it is more reliable when the backup file contains corrupted database. The another method could cause the missing tracks from playlists and even could crush during the execution in MM4 with the corrupted databases, but it is a way faster. For example, with one test database the faster method in MM3 lasted approx. 150 seconds instead of 1600 with the default method (by the way, the playlists was restored in approx. 40 seconds from the same database in MM4 using the default method). There is no GUI control for choosing the restoring method, so if you want to turn the faster method on, you should open MediaMonkey.ini file into Notepad and enter the line PlistAltMethod = 1 into the [RestorePlayHistory] section; if you want to turn it back to the slower, more reliable method, enter PlistAltMethod = 0 or just remove that line from the .ini file.

There is also one more ini key in the [RestorePlayHistory] section which could be used to speed up the comparison of databases - it is called ExtraMatchTests and could take a value from 0 to 4, which represents the number of additional tests, beside of the base one which compares full paths. Its default value is 4, so all 5 tests mentioned in the Description section are performed. You need to exit the program before you change some value in .ini file.

Important:

This add-on could only restore data from/to some backup file, it cannot restore the current database with itself. You need to have already made the backup file before you get some problem with the current database - nothing can be done if you don't have it.

If you choose the Clear Played table... option, the Played table and playstat fields would be overwritten after applying the Export/Import command! Same state for playlists and Clear Playlists... option. If you want to merge data, you should leave those options unchecked.

This add-on is relatively dangerous and could cause some corrupted data in the current database, especially if you forcibly terminate the program during its execution! Please make one more backup of the current database before you apply this add-on. Well, maybe you should make a copy of the backup file itself, because if you mistakenly choose the [i]Export[/i] command, this add-on would modify the backup file as well.

Disclaimer:

This software is provided 'as-is', without any express or implied warranty. In no event will the author be held liable for any damages arising from the use of this software.