• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Paths not restored from backup on Win10 [fixed in 3.7.2]
#1
On Win10 restoring a backup fails badly:
All the files are copied directly to the MSP storage location, all the subfolders of the stored folder structure are lost!

I manage my song files myself. All files are stored in a folder structure within the MSP storage location:
Code:
D:.
...
+---HerbertsGoogleDrive
...
|  +---_MobileSheets <= this is my MSP storage location
|  |  +---Fkbk0 Fakebooks, one folder per book, on Android in the local storage SD0
...
|  |  |  +---KinderWollenSingen
|  |  |  |      kinder-wollen-singen.txt
|  |  |  |      kinder-wollen-singen.xls
|  |  |  |      _kinder-wollen-singen-A4.csv
|  |  |  |      _kinder-wollen-singen-A4.pdf
|  |  |  |     
...
|  |  +---Fkbk1 Fakebooks, one folder per book, on Android in the local storage SD1, will be copied during import
...
|  |  |  +---VanillaBook
|  |  |  +---VanillaBook
|  |  |  |      VanillaBook.txt
|  |  |  |      VanillaBook_RalphPatt.csv
|  |  |  |      VanillaBook_RalphPatt.pdf
|  |  |  |      VanillaBook_RalphPatt.xls
|  |  |  |     
...
|  |  \---Songs one file per song, mostly .PRO  .PDF, original files in the same folder
|  |      +---#
|  |      +---A
|  |  |  |      AdeZurGutenNacht.mscz
|  |  |  |      AdeZurGutenNacht.mxl
|  |  |  |      AdeZurGutenNacht_D_MSCZ.pdf
|  |  |  |      AllForMeGrog_TA.pro
|  |      +---B
|  |  |  |      BeaumontRag.pro
|  |      +---C
|  |  |  |      CarelessLove.pro
|  |      +---D
...

So all paths are stored as relative paths in the MSP database. This works really great. Using the same subfolder structure on Win10 and Android (with the Win10 rootfolder d:\HerbertsGoogleDrive\_MobileSheets\ replaced by /storage/emulated/0/_MobileSheets as MSP storage location on Android) I can easily copy the MSP database from one device to the other and everything works like a charm.

When a backup is restored there's a small difference depending on "Restore settings (if found in backup file)", but the paths are gone anyway.
For the test I used a new empty database with the MSP storage location set to d:\_MSPTest.

"Restore settings (if found in backup file)": ON

=> MSP folder is changed
    from  d:\_MSPTest (previous setting)
    to d:\HerbertsGoogleDrive\_MobileSheets\ (from backup file)
=> database names from the backup are preserved: PathTest / pathtest.db
=> relative Paths are lost
 
    d:\HerbertsGoogleDrive\_MobileSheets\Songs\A\AdeZurGutenNacht_D_MSCZ.pdf
    becomes
    d:\HerbertsGoogleDrive\_MobileSheets\AdeZurGutenNacht_D_MSCZ.pdf
 
    d:\HerbertsGoogleDrive\_MobileSheets\Fkbk0\KinderWollenSingen\_kinder-wollen-singen-A4.pdf
    becomes
    d:\HerbertsGoogleDrive\_MobileSheets\_kinder-wollen-singen-A4.pdf

"Restore settings (if found in backup file)": OFF

=> MSP folder is NOT changed, d:\_MSPTest is preserved
=> database names from the backup are preserved: PathTest / pathtest.db
=> relative Paths are lost

    d:\HerbertsGoogleDrive\_MobileSheets\Songs\A\AdeZurGutenNacht_D_MSCZ.pdf
    becomes
    d:\_MSPTest\AdeZurGutenNacht_D_MSCZ.pdf

    d:\HerbertsGoogleDrive\_MobileSheets\Fkbk0\KinderWollenSingen\_kinder-wollen-singen-A4.pdf
    becomes
    d:\_MSPTest\_kinder-wollen-singen-A4.pdf

Relative paths seem to be available in the backup file because restoring the same backup file to an Android device works nicely, the relative paths are taken over correctly
There are some small gaps caused by differences of the file system (and the according differences of the MSP versions), but they can be accepted:
In case of "Restore Settings (if found in backup file): ON"
=> relative Paths persist (adapted to Android)
=> MSP storage location stays unchanged
=> original base folder is NOT taken into account
Settings "Let MobileSheets manage my files" and "Expose database file" keep their default values and have to be set manually as they are not available in Win10.

My test database is available in my GoogleDrive. Even after reducing it to only a few files it is more than 5  MB so that I cannot attach it to this post.
first language: German
Acer A1-830, Android 4.4.2 - HP x2 210 G2 Detachable, Win 10 22H2 - Huawei Media Pad T5, Android 8.0 - Boox Tab Ultra C, Android 11
www.moonlightcrisis.de - www.basdjo.de - www.frankenbaend.de


Reply
#2
Hello Mike,
Did you find the time to take a look at this bug?
It came up again as https://zubersoft.com/mobilesheets/forum...-9056.html
first language: German
Acer A1-830, Android 4.4.2 - HP x2 210 G2 Detachable, Win 10 22H2 - Huawei Media Pad T5, Android 8.0 - Boox Tab Ultra C, Android 11
www.moonlightcrisis.de - www.basdjo.de - www.frankenbaend.de


Reply
#3
I have not had time to look into it, but I can certainly carve out some time now that the iOS version is complete. I'm just wrapping up the new website which will be published in a few days, and then I can try to include any fixes with the next major update.

Thanks,
Mike
Reply
#4
Thank you Mike.
The pending iOS version was the reason why I did not remind you earlier.
If you need any support to test or investigate, let me know.
first language: German
Acer A1-830, Android 4.4.2 - HP x2 210 G2 Detachable, Win 10 22H2 - Huawei Media Pad T5, Android 8.0 - Boox Tab Ultra C, Android 11
www.moonlightcrisis.de - www.basdjo.de - www.frankenbaend.de


Reply
#5
The problem appears to be with the "Create Subdirectories per Song" option being disabled. The directories are not correctly maintained when that setting is off. There is a bug where the value used for the "Create Subdirectories per Song" is not set properly when extracting the backup. So it won't use the settings in the backup correctly for that setting - this can be avoided by changing the setting first, then restoring the backup with the option to "Restore Settings" off. This will be fixed with the next update. 

As far as the logic, I think the way it is behaving is mostly correct. If you uncheck the option to "Create Subdirectory per Song", that means MobileSheets will want to put everything in the root directory of the storage location. That effectively strips the directory structure. I'm going to change the logic a little bit to improve it though. If I detect that the subdirectories that were used were multiple levels deep, then that means the user had a custom folder structure and it should be maintained. If it is only one level deep, the directory will be removed. I can't detect scenarios where MobileSheets used its own subdirectory versus one that the user selected because multiple songs can share the same file, so there is no guarantee that the folder name matches the song title. That is why I think it would be incorrect to preserve the directory when "Create Subdirectories per Song" is unchecked.

As far as why it works on Android, that's due to some differences in how Android processes a library backup containing Windows file paths. There is some special handling that preserves directory structures for that. If you restored an Android backup file containing custom folders and then unchecked "Create Subdirectories per Song", I think you would see that the directories would be removed (that's my assumption based on looking at the code at least). In either case, I'm going to add the same code to both versions to ensure that if a custom directory structure was used with multiple levels of depth, that it will be maintained even when "Create Subdirectories per Song" is unchecked.

Thanks,
Mike
Reply
#6
Fixed and successfully retested with V3.7.2.
The folder structure is correctly restored, both on Android and Win10.
Great job, Mike. Thank you.
first language: German
Acer A1-830, Android 4.4.2 - HP x2 210 G2 Detachable, Win 10 22H2 - Huawei Media Pad T5, Android 8.0 - Boox Tab Ultra C, Android 11
www.moonlightcrisis.de - www.basdjo.de - www.frankenbaend.de


Reply
#7
Thanks for verifying that the fixes worked. I appreciate your help in tracking down the problems.

Mike
Reply




Users browsing this thread:
3 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2024 MyBB Group.