Sanket
Sanket

Reputation: 452

I want to take backup and restore of SQLite Database file using xamarin Azure SDK for My Xamarin App

I am using xamarin Azure SDK to download and manage the local database for my Xamarin . Forms App.

We are facing downloading time issues because we have a lot of data, so I am thinking of taking backup once of the SQLite File from one device and use it to restore on different devices as restoring the same SQLite File.

Planned to use Azure Blob storage to store backup of SQLite files and for different device planning to download that blob of SQLite file and thinking of restore it on different devices.

Any Help will be appreciated.

Thanks :)

Upvotes: 3

Views: 1021

Answers (3)

user6021938
user6021938

Reputation:

An approach I have used in the past is to create a controller method on the azure end which the client app can call that generates a pre-filled sqlite database or 'snapshot' on the server (making sure you include all the extra azure tables and columns) and then return a download url for the file to the client. We also zip-up the snapshot database to reduce the download times. You could store this 'snapshot' in azure blob if you desired.

Upvotes: 1

Ivan I
Ivan I

Reputation: 9990

Those are the links that provide you with the code / knowledge required to use Azure Blob Storage on Xamarin:

As this question is very general I can provide you only with those general links. There are many details on how to implement that in your case, if you face some specific problem I recommend to ask another question with the exact description of that specific problem.

EDIT: According to your comment you have some problems in replacing the local file. The only thing is that you must replace it before you initialize SQLite, otherwise it is a simple file operation.

Upvotes: 0

Vikas Surve
Vikas Surve

Reputation: 1

Please refer given link. SQLite is not supporting only relationship like Foreign Key.

Memory Stream as DB

you can upload back up file on Blob with respective user details. and when there is any call with same user details you can download it from blob.

Upvotes: 0

Related Questions