0

I have an app (say version 1.0) which is using Core data and now i have updated the app using sqlite and for the new update i am not using core data at all (we will call it version 1.1), however i have kept the name of my database and all the column names of the table similar to the previous core data app.

My query is that what major or minor effects will it have if the user updates to the new version (1.1) which is using sqlite. Will it have some kind of dataloss or any crashes if yes then please guide me out by providing any links or suggestions

To avoid dataloss i am planning to transfer data in chunk from core data to sqlite app as read in this post, so am i doing this right do let me know if i have missed any valuable steps.

Migrating user data stored in sqlite to core data in app upgrade

Thank you

Community
  • 1
  • 1
user2538944
  • 305
  • 4
  • 12

1 Answers1

-1

If your actions will correct and grammar, users willn't lose any data. How I understand, in your next version of app you will managing data by any sqlite framework, then you just need .sqlite data file. To get it .sqlite file path you can:

NSString *dataFilePath = [[[self applicationDocumentsDirectory] path]
                           stringByAppendingPathComponent: @"YourAppName.sqlite"];
    NSURL *dataFileUrl = [NSURL fileURLWithPath:storePath];

When applicationDocumentsDirectory method implement like this:

- (NSURL *)applicationDocumentsDirectory
{
return [[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask] lastObject];
}

If I understand something incorrect, write it in comments.

Kepler
  • 705
  • 1
  • 5
  • 19
  • Thanks for the reply, so the old data will migrate to the new sqlite file automatically or do i need to add the code for migrating data from the previous version to the new version? – user2538944 Aug 20 '13 at 08:51
  • You need to add the code to migrating. May be I don't understand you exactly. I write, how you can get path to yur old .sqlite file. You can copy this file where you want and use it. The fact if you use core data you just manage data of this file with core data methods, and if you have the .sqlite file, you can manage of its' data with other framework methods (not core data framework). If my answer help you, check it please. – Kepler Aug 20 '13 at 09:48
  • For Example:once I develop one app, I need create something data. I create a sqllite file with core data frame work, after for managing data of this .sqlite file I use SQLiteAccess class of any sqlite Framework. – Kepler Aug 20 '13 at 09:52