MobileSheets Forums

Full Version: New tablet, migrate database
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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?
it' SO annoying that Android changes access to the SD card all the time
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.

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.


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.
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, 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.