0

In a small app I'm making, the user can making multiple entries, they can edit them, delete them, and so on, all of this is using an SQLite database.

Now, I want the user to be able to backup this data online and restore it at any time in the project, I thought of backing it up to a MySQL database online, but it felt too complicated for me, I have very little knowledge in PHP and web programming in general, and even ignoring that, I felt the process I had in mind wouldn't make much sense as the data would all be lumped together and backing up and restoring then would be a huge hassle (At least in the schema I had in mind).

I tried looking at BackupManager from Google to store the data in the cloud, but it didn't work for me for some reason, and I read that this tool is not suitable for backing up files and restoring them immediately.

Is there any other method I can use? All I need is for the user to backup the database he made, restore his and only his, and that's it.

thinkereer
  • 117
  • 2
  • 8
  • 1
    The best way is really dependent on a lot of factors. How frequent will you be backing up? How much does it change? How big is the db? Is a single device going to be the only place the user uses it, or will they be accessing the app from multiple devices that need to stay synchronized? The simplest method for no synchronization and rare backup would be to just transfer the db file to a server occasionally, and read it from the server if you need to restore from backup. But that way has issues for large frequently synched dbs, and huge issues for synchronizing multiple sources. – Gabe Sechan Dec 17 '15 at 00:33
  • Backup is as frequent as the user desires, as it triggers manually, as for change rate, the content of the DB changes as the user desires and changes the entries, the db is just text, only a couple of tables, the biggest piece of data inside it is a long text field but even that won't exceed 4000 characters, he could use it from multiple devices, but there is no need to stay synchronized. I thought of a simple db file transfer like you said, but I don't want the databases to be publicly available on the server, I need the user to access it only through the app, but I didn't know how to do that – thinkereer Dec 17 '15 at 07:59
  • My web development skills are very basic, so that might be why I can't think of a good way to do this. – thinkereer Dec 17 '15 at 08:01
  • Do you think storing files online, then limiting the access only through the server itself, is a good method for that? I read online about this htacess command order deny,allow allow from [SERVER_ADDRESS] deny from all Then my server can get the data only through itself, I will store the user's db file under a directory only for the user, or by naming the file something identifiable, and pull it using a php script on the server that will take the user's ID as a key to which file to take. – thinkereer Dec 17 '15 at 08:05
  • 1
    For what you said, just storing the file is fine. Putting it behind a web service call would probably be sufficient. Require the user to authenticate with a password and you'll be good from any attacker except the user himself. The user could reverse engineer your app and grab it, but he could always root his device and copy it anyway, so it's not worth worrying about – Gabe Sechan Dec 17 '15 at 08:10
  • Thank you, I will try that, for now I managed to make the code to upload the backup to a private directory, I'm now looking on how to download this file through php, I will make another question for that if needed. – thinkereer Dec 17 '15 at 09:14

0 Answers0