View Issue Details

IDProjectCategoryView StatusLast Update
0013585MMW 5DB / Backuppublic2022-07-25 20:53
ReporterLudek Assigned To 
PriorityurgentSeverityminorReproducibilityhave not tried
Status closedResolutionfixed 
Summary0013585: Auto-backup of MM.DB
DescriptionSometimes (due to addons or for other reason) the MediaMonkey database can become corrupted (e.g. missing indexes and triggers). I guess we could add an option of auto-backup MM.DB on a regular basic (i.e. keep MM.DB.backup file) that could be used as a restore point.

We just need to define the rules what should trigger the backup, when and what should trigger the restore.

We have already added a feature to rebuild the database and restore the indexes, triggers, artist, albums etc. as #13414

Additional InformationWWG-212-31073
HLF-979-27012
TagsNo tags attached.
Fixed in build2045

Relationships

related to 0016176 newLudek DB Backup Improvements 

Activities

rusty

2016-10-11 17:37

administrator   ~0045900

I would suggest:
Backup:
- automatically once a month, but only if the DB has changed. File should be saved with date to??
- if any risky operations are being performed (e.g. rebuild/DB upgrade/restore/etc.?)
- maximum of 12 backups

Restore: should be user initiated manually via 'restore...' button

--------------------------------
Restore from backup
--------------------------------
Select the backup file to restore. It will replace the current library.



---------------------------------
 . . . . . . . . . . [OK] [Cancel]

jiri

2016-12-06 16:38

administrator   ~0046419

Last edited: 2016-12-06 16:41

Since this functionality is quite closely related to the Maintenance DB dialog, I'd suggest to modify it as follows:

1. Add a checkbox to the first position
[x] Backup database

2. Add a checkbox to the bottom (probably somehow separated from the others)
[x] Backup database monthly

Note that I think that this shouldn't be done silently, since it can affect performance. For this reason, it probably could show a dialog when MM is about to be closed (but just once a month), asking: 'Do you want to backup database now? [Yes] [Not Now]'

3. Add 'Restore...' to the bottom left corner of this dialog?

4. We probably should perform backup _always_ (silently) on MM start when DB is about to be updated (which happens often, but not always, when a new MM version is installed).

rusty

2016-12-07 20:50

administrator   ~0046431

Re. 1/2/3

Under the 'File' menu, we currently have 'Maintain Library...' and 'Clear Database...'. As suggested by Peke, these two should be combined, along with the backup and restore functionality being discussed here.

This could result in the following layout:

Manage Database
=========================================
Maintenance
-----------
[ ] Create multi-artist Albums...
[ ] Rebuild Full-Text Search index
[x] Optimize database
[ ] Rebuild database


Backup and Restore
-------------------
[x] Scheduled backup: _Daily, Weekly, [Monthly]_v_

( ) Backup database now...
( ) Restore from backup...
( ) Clear database...

 . . . . . . . . . [OK] [Cancel]

Note: Backup now, restore, clear db are all mutually exclusive. And selecting any one of them causes all of the maintenance options to be greyed out.

Also, I agree with you re. presenting the scheduled backup prompt on closing MM.
 
The only thing I'm not sure about is whether it would make more sense to move the Scheduled backup to somewhere in the config panel.

4) Agreed

jiri

2016-12-08 10:43

administrator   ~0046438

1-3) Sounds good, just the presentation of the mutually exclusive options (Backup, Restore and Clear) doesn't seem to be too friendly, and if implemented this way would also require 4th option 'None'. Therefore I'd prefer them as a column of buttons, like

[Backup database now]
[Restore from backup]
[Clear database]

or probably even better (nicer) as clickable hyperlinks (so that there aren't too many buttons, together with OK and Cancel).

rusty

2016-12-08 18:10

administrator   ~0046442

Sure--hyperlinks sound good.

peke

2016-12-09 03:00

developer   ~0046449

5) would Clear Database work as proposed in #13703 or as currently?

6) if clear database will be implemented as #13703 would Restore count .BAK as Restore point?

jiri

2016-12-09 07:32

administrator   ~0046451

Last edited: 2016-12-09 12:17

5) To be handled in the separate issue #13703

6) Yes, makes sense to me.

petr

2016-12-11 16:01

developer   ~0046472

Fixed

peke

2016-12-17 00:13

developer   ~0046600

Verified 2048

rusty

2016-12-23 15:10

administrator   ~0046749

Setting to resolved for additional testing.

peke

2016-12-29 13:28

developer   ~0046807

Verified 2056
Backups are correctly created for past few versions and correctly restored if selected.

Can you specify test cases for the future testing.

rusty

2017-09-15 11:34

administrator   ~0048769

You'll need to come up with the specific test cases, but what is expected out of this feature is that:
- Backing up the DB should back up the DB and all MM settings, allowing the user to choose a filename/location.
- Restore from backup should restore the DB and all MM settings for normal and portable installs. This would overwrite the existing DB.
- Scheduled backup should work according to specified timeframes, and giving the user the option to choose backup location, and provide feedback as to whether it occurred.

peke

2019-12-09 22:49

developer   ~0055619

Verified 2218

All options are functioning as designed and Auto backups are created.

Remarks and additional features are put into 0016176 for future versions.