Neo-Backup icon indicating copy to clipboard operation
Neo-Backup copied to clipboard

External storage (physical sdcard)

Open benoiton opened this issue 3 years ago • 7 comments

Hello,

Is it possible to save data from external sdcard (/storage/NNNN-NNNN/Android/*)? What is the recommendation about it?

Thanks, Benoit

benoiton avatar Jan 25 '23 13:01 benoiton

from my POV, this is kind of open...

First, I somehow hate the confusing nomenclature, even if it has some logic. The "internal data" is not on the "internal storage", but usually on the same flash device (/data/...). The "external data" is usually on the "internal storage". There is also an "external storage" or on open number of them, identified by a storage id code (e.g. USB also has such a code). "external data" can also be located on "external storage".

Because there is no official way (as far as I know) to get the external data directories for another app, NB uses its own external data directory to find the path for those (basically replacing NBs package name by the other).

I am not sure, in which cases an app uses the external storage. Neither do I know, if it's possible/allowed/meant/recommended to use both (or even more).

In case we would add this, and assuming there can be as much external data directories as there are storages, we get some new problems:

  • we need to handle a variable number of storages
  • we need to identify which backup belongs to which storage
  • the storage id code may be an obvious way, but another device may have different codes or storages
  • the backup should not be bound to a specific storage id code
  • though apps should have the same problem
  • but each app might have a different solution to the problem

hg42 avatar Jan 25 '23 16:01 hg42

Ouch. Not that simple!

I suppose there is only a very few number of Android devices with more than 1 external storage (physical sdcard). I've never used external USB storage, but I think it would only be temporary, and one would not want to backup such storage.

My use case is that the internal storage of my old smartphone is not enough for my needs, and I added an sdcard. I moved OSMAnd maps and podcasts on it. Not sure it would be a good idea to tar+gz such data. There may be other UC.

I took me some time to understand why OSMAnd backups were so small. Some hints on the FAQ may be useful.

benoiton avatar Jan 25 '23 17:01 benoiton

Actually for apps that keep their data on external storage, the current structure should work, as the backup function uses the system's API to get the directory, but this would require that NB is using the same storage.

machiav3lli avatar Jan 25 '23 17:01 machiav3lli

Content of external_files.tar.gz for OSMAnd~ and AntennaPod are an empty "files" directory. That's what is in /sdcard/Android/data/.

benoiton avatar Jan 25 '23 17:01 benoiton

would require that NB is using the same storage

exactly, and I think an app can choose, which one it uses, or there is a way to place it (Titanium could move that), not sure how it is today.

I think the assumed relation from NB to any app isn't set in stone.

hg42 avatar Jan 25 '23 18:01 hg42

I moved OSMAnd maps and podcasts on it [=external storage]

how did you move it?

hg42 avatar Jan 25 '23 18:01 hg42

Is OsmAnd: settings > Osmand settings > Storage folder. I can choose:

  • internal storage (hidden for user),
  • external storage 1 (/storage/emulated/0/Android/data/net.osmand.plus/files),
  • external storage 2 (/storage/NNNN-NNNN/Android/data/net.osmand.plus/files),
  • multi-user storage 1 (emulated ... obb directory),
  • multi-user storage 2 (NNNN-NNNN ... obb directory),
  • manual

In AntennaPod: settings > Storage > Choose directory. I can choose:

  • /storage/emulated/0
  • /storage/NNNN-NNNN/

benoiton avatar Jan 25 '23 18:01 benoiton