• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
New tablet, migrate database
#1
I've got a new tablet with Android 11. This version of Android no longer allows access of general tools to the application data folders, so I wanted to move my data storage from Android/data/com.zubersoft.mobilesheets/files to Android/media/MSPro. All files are currently under Android/data/com.zubersoft.mobilesheets/files.

I did expect the following to work:
  • Make a full backup on the old tablet
  • Clear library
  • Set library storage path to Android/media/MSPro
  • Restore backup (everything to original locations)

Now the exposed database is in Android/media/MSPro, but all song files are again in Android/data/com.zubersoft.mobilesheets/files.

This data path is only registered in the default.xml preference file. So I also tried:
  • Clear library
  • Set library storage path to Android/media/MSPro
  • Restore backup (everything to original locations)
  • Clear library
  • Set library storage path to Android/media/MSPro
  • Restore backup (everything to original locations, exclude preferences)

With the same result.

I have my ways to solve this so its not a big deal for me, but I wonder why it doesn't work. What am I overlooking?
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).
Reply
#2
it' SO annoying that Android changes access to the SD card all the time
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
If you select the option to restore to the original file locations, this can result in one of two things happening:

1) If the files are stored relative to the storage location, then when they are restored they should be restored to the new storage location
2) If the files are stored with an absolute path, MobileSheetsPro first checks to see if it can write to the original path, and if it can't, it falls back to writing the file to the storage location

Based on what you've written, I would think your second approach should have worked. Let me ask this: if you import a new file into your library, does the file get correctly copied into the storage location? Or is it also being redirected to the default storage location? If you restore the library to the default storage location and then switch the storage location to the folder you want and MobileSheetsPro moves the files, does that work? I'm guessing there is definitely some kind of write permissions issue here. I will say that MobileSheetsPro only uses the storage access framework for accessing removable SD cards. It is not used for internal storage, but it is possible with Android 11 that it will be necessary to use the SAF even for internal storage when files are being written to a location outside the default storage location. I don't have an Android 11 device yet, so there is a lot I'm not sure of.

Mike
Reply
#4
All files in the existing library are user-managed and relative to the library root.

When I change the storage location to media (/storage/emulated/0/Android/media/MSPro) and I create a new song, it is put in the media folder, so this works.

Back...

Empty library in the default location data (/storage/emulated/0/Android/data/com.zubersoft.mobilesheetspro/files).

Create a couple of songs, they appear in the data folder. The data folder now contains the songs, the database, stamps and user_filters.

Change the storage location to media. The data folder now contains the songs, and the media folder contains the database, stamps and user_filters. This is regardless whether the songs are user-managed.

After some experimenting I ran into the following situation (see screenshot) where I had a database in both locations, songs in both locations... Making a backup from this situation resulted in a msb that only contained song1 and not song2, probably because it choose the wrong database...

Note that I'm doing things that noone should do, but there may be room for improvement. For example, when changing the storage location offer the possibility to move all files to the new location.

BTW: A library clear does not seem to remove annotation_favorites.xml, stamplists.json and the stamps folder. This may be intentional, but it is at least confusing since these are also restored from the msb.


Attached Files Thumbnail(s)
   
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).
Reply
#5
I'm definitely not sure how you ended up with a database in both locations and songs split between the two. I'd need to know what steps to reproduce that to have any idea what led to that situation. 

If you want to share the library backup file with me at mike@zubersoft.com, I can do some debugging and see what is causing the files to be extracted to the default storage location (assuming I can reproduce the problem on my Samsung Tab S4 running Android 10). 

As far as the library clear, I intentionally do not remove those files because the library clear does not remove user settings. For example, you might want to clear out your library, but you may not want to lose all of the favorites you've set up in the annotation editor, or any of the custom stamps. So I preserve those.

Mike
Reply




Users browsing this thread:
2 Guest(s)


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