Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New target folder for backups #4963

Closed
rsudev opened this issue May 22, 2015 · 14 comments
Closed

New target folder for backups #4963

rsudev opened this issue May 22, 2015 · 14 comments
Labels
Feedback required Issue requires feedback of the author or another user Prio - High A significant malfunction of a feature/function. High user impact. Refactoring Issues requires code refactoring

Comments

@rsudev
Copy link
Contributor

rsudev commented May 22, 2015

In order to disentangle the relatively important database backup from the less relevant cache file storage in .cgeo, it should be stored in a new location.
The location should still be the external storage (which is sdcard on old Android versions and internal storage on modern ones).
Suggestion:

  • (external storage)/cgeo/backup
@rsudev rsudev added Feature Request A request for a new feature/function Feedback required Issue requires feedback of the author or another user labels May 22, 2015
@marco-dev
Copy link
Contributor

@rsudev
Let me ask you to clarify that "external storage" is the emulated sdcard

  • (external storage)/.cgeo for cache directory
  • (external storage)/cgeo/backup for database backup files

Correct?

@rsudev
Copy link
Contributor Author

rsudev commented May 22, 2015

@marco-dev
Yes and no. As I said, on older devices there is no emulated sdcard and even no internal one (which also was a design option at one time.
Here I refer to the Android Api term, the directory returned by getExternalStorageDirectory()

@Lineflyer
Copy link
Member

Yes, we have to do that before doing any approachs of migrating the cache directory to other (possibly not user accessible locations which are potentially deleted upon uninstallation).
The suggestion of getExternalStorageDirectory()/cgeo/backup sounds like a good starting point, where we could add other files there later on (e.g. GPX export, Field note export) but that another issue.

@Lineflyer Lineflyer added Refactoring Issues requires code refactoring Prio - High A significant malfunction of a feature/function. High user impact. and removed Feature Request A request for a new feature/function labels May 26, 2015
@marco-dev
Copy link
Contributor

We have to keep in mind to move existing backup files on migration.

@Lineflyer
Copy link
Member

Just to inform that now we released and thus are at the beginning of a new phase on master. Might be the right time to do some preparation work.

@marco-dev
Maybe we should create a Wiki to draft a new directory structure for all non-system filed (like Backup, GPX Exports/imports,...)?

@marco-dev
Copy link
Contributor

@Lineflyer
Copy link
Member

@marco-dev

Good idea.
We started something similar already in the Wiki:
https://github.com/cgeo/cgeo/wiki/Data-storage-structure-of-c%3Ageo

Maybe we just continue there...you could move the last paragraph of the wiki page to there.

You should add GPX import/export directories into the RFC as well.
IMHO those should also go below /cgeo/ then.

@marco-dev
Copy link
Contributor

I removed RFC and wrote the content of page

https://github.com/cgeo/cgeo/wiki/Target-disk-usage-structure

I'm not familiar with the current thoughts about GPX import / export so maybe someone else can add this?

@marco-dev
Copy link
Contributor

Do we prefer to change the structure step by step? `

First move backup from <externalStorageDirectory>/.cgeo to <externalStorageDirectory>/cego/backup,
then move dbOnSd file to <externalStorageDirectroy>/cgeo/database, then moving cache directory?

@SammysHP
Copy link
Member

Do you mean if it should happen in different releases? A user might skip a release, so there is no benefit.

@marco-dev
Copy link
Contributor

I guess it is best to move .cgeo to cgeo. But I don't know where to put it best for update.
It is not a database migration and no setting migration.

Where should this change from .cgeo to cgeo go to?
The next step IMO would be to move backup and db file to subdirectories.

@Lineflyer
Copy link
Member

@marco-dev
Sadly I was offline when you sent the question on IRC.

I am unsure if moving will be a fast operation on all devices (i.e. only a renaming) or a long running copy process. IMHO we need to test, or does anyone know?

Additionally if /.cgeo is renamed to /cgeo we should in any case put a .nomedia file into that new base directory as otherwise media scanners will be triggered and all the media data (log pictures) will show up in the users gallery. That should be avoided.

I don't fully understand your question "where to put it best for update". What do you mean with that?

@marco-dev
Copy link
Contributor

@Lineflyer My question is where to put the rename code to. We have a DataStorage for db update and settings for settings update. I suggest to add an update function to LocalStorage. But where should I call that update from?

@Lineflyer
Copy link
Member

This has been implicitly implemented meanwhile during the latest data storage strategy cleanup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feedback required Issue requires feedback of the author or another user Prio - High A significant malfunction of a feature/function. High user impact. Refactoring Issues requires code refactoring
Projects
None yet
Development

No branches or pull requests

4 participants