Android scoped storage, backup huge amount data

Viewed 362

As we all know starting Android Q (API=29) introduced new Scoped Storage concept, which basically prevents access to external files/dirs, except media files. Namely:

  1. Programmer can use internal/app specific storage (no limits) - getFilesDir()
  2. The only external storage can be accessed is via getExternalFilesDir(), but during app uninstall data will be deleted
  3. There's option to access external storage via MediaStore, but it works only for media files
  4. App still can read any external file via: getContentResolver().openInputStream(uri)

In my case I have app, which stores user data in SQLite database in app specific directory, database size can be up-to several gigs.

In all previous versions of my app users used to backup data to external storage/SD/USB and transfer those data to their new device, so they could continue to use data (it's encrypted database containing any kind of private data, including audio/video/documents and so on).

Question: how can I backup this database? I couldn't manage to find appropriate way to save/backup data to any external storage...

P.S. Android autobackup service is unworkable due to the size of database.

0 Answers
Related