Posts: 933
Threads: 84
Joined: Feb 2017
Reputation:
28
I copied all songs in a collection into a set list and then removed several songs.
Unfortunately, I meant to remove them from the set list and not the collection!
As it happens, I did make a backup with the Companion this morning so I wouldn't lose much restoring the database.
I tried selecting all the songs in the copied set list and created a collection. However, this loses all the song modification dates; probably not the end of the world but I do sometimes sort by modified date. It looks like the file creation data is preserved.
So should the modified date be changed when one adds a file to a list ? (the file hasn't changed but the list has)
To retain the modified dates, I'm guessing I could just extract the .db file from the backup and replace the one on the tablet - would that work and is that sufficient?
If I choose to restore the full backup, do I need to do anything first (like delete existing files and restart MSP to create an empty database). If I do restore, will the modified dates be maintained or will they be set to the date of the restoration (if the restoration date is used then there isn't much point doing a restore).
Cheers
Geoff
Samsung Galaxy Tab A6
Posts: 13,391
Threads: 302
Joined: Apr 2012
Reputation:
238
Geoff,
Last modified timestamps for songs are preserved after performing a restore. On Android, MobileSheetsPro tries to also set the last modified timestamps of files to what is stored in the database but this is not guaranteed to work on every device. I have no control over this - it's an OS file thing. On Windows 10, I have no ability to control the last modified timestamp - Microsoft does not allow it to be changed. If the file timestamp changes, then when you load a song, it will scan for changes, which can result in the song updating the last modified timestamp for itself as well.
You can certainly replace the database file from one in the backup, but the same problem may occur - if the last modified timestamp for a file in the database does not match the last modified timestamp on the actual file system, the song will scan for changes and the last modified timestamp will be changed as a result of this. I'm not sure I have a good answer for this. I think what I will have to do is make the logic used when scanning for changes more intelligent. If no change occurs to the song, then I won't update the last modified timestamp. One thing I could do to make this logic a lot faster is to add a crc calculation field to the files table in the database. I could then just calculate a CRC on the new version of the file, and if it matches the old version then I know nothing has changed. Until that is implemented though, I'll have to check to make sure the file type matches, the number of pages matches, and the size of each page matches.
Mike
Posts: 933
Threads: 84
Joined: Feb 2017
Reputation:
28
Thanks for the explanation Mike
Do I need to clear the data folder before doing the restore (I suppose I could just rename the folder and then give it a go)
Geoff
Samsung Galaxy Tab A6
Posts: 13,391
Threads: 302
Joined: Apr 2012
Reputation:
238
No, you don't need to clear the folder, the restore will overwrite the files and delete them if necessary.
MIke
Posts: 933
Threads: 84
Joined: Feb 2017
Reputation:
28
Thanks for the advice Mike.
Although all the files were still in place, I opted to do a full restore via the companion.
Very easy and quick.
It all looks ok
I was lucky this time because I don't normally backup the database; I only backed up because I was upgrading MSP.
Moral: Back up the database whenever it contains changes you don't want to lose!
Cheers
Geoff
Samsung Galaxy Tab A6
Posts: 1,231
Threads: 194
Joined: May 2015
Reputation:
13
(03-22-2019, 02:58 AM)Geoff Bacon Wrote: Moral: Back up the database whenever it contains changes you don't want to lose!
Backup the database whenever always.
It's not just that I hate losing things. Sometimes it is just not possible to recover from a backup and remember all (yes, I mean
all) changes that you applied after the backup.
I have a nightly daemon on my (Linux) PC that copies the database from the tablet and stores it aways in a safe place. It allows me to do off-tablet checks on the database as well as emergency recovery.
If I could teach MSPro to perform a "Sync Library to Cloud" automatically I would definitely do that as well.
Johan
johanvromans.nl — hetgeluidvanseptember.nl — mojore.nl -- howsagoin.nl
Samsung Galaxy Note S7FE (T733) 12.4", Android 13.0, AirTurn Duo & Digit (Gigs).
Samsung Galaxy Note S4 (T830) 10.5", Android 10.0 (maintenance and backup).
Samsung A3 (A320FL), Android 8.0.0 (emergency).
Posts: 1,878
Threads: 290
Joined: Sep 2014
Reputation:
32
I use FolderSync (Android) to copy mobilesheets.db automatically to GoogleDrive.
Posts: 933
Threads: 84
Joined: Feb 2017
Reputation:
28
@scirius and itsme
Thanks for your suggestions
Geoff
Samsung Galaxy Tab A6