title: SQLite database update in app for iPhone
body: <p>I see there is a lot of similar questions but passing through them not find answer to my question.</p>
  
  <p>Have an app for iPhone that uses sqlite database. Need to update app and everything went good.
  When I install app on iPhone it works fine, but when I update already installed app on some device it mixed me with old database and not functioning until i delete and again install app.</p>
  
  <p>My code for checking data on device is:</p>
  
  <pre><code>   /*
   This method checks is rawdata has been copied to Documents directory. 
   If not, copies and returns YES, to start conversion.
   Else, if already copied, reply NO.
  */
  - (void) checkImportIsNeededFrom: (NSString*) bundledRawFilePath toDestination:(NSString*) documentSavedRawFilePath 
  {
      NSLog(@"Checking rawdata file into Documents folder..");
      if ([[NSFileManager defaultManager] fileExistsAtPath:documentSavedRawFilePath]) {
          importIsNeeded = NO; // SET YES TO FORCE IMPORT ON EACH STARTUP
          NSLog(@"copy already existing in %@", documentSavedRawFilePath);
      } else {
          [[NSFileManager defaultManager] copyItemAtPath:bundledRawFilePath toPath:documentSavedRawFilePath error:NULL];
          importIsNeeded = YES;
          NSLog(@"copy %@ to %@ done...", bundledRawFilePath, documentSavedRawFilePath);
      }
  }
  
  - (BOOL) importIsNeeded {
      return importIsNeeded;
  }
  </code></pre>
  
  <p>So I just need some help with deleting old one on device and replace it with new one. Is there any easy solution.</p>
  
  <p>Thanks. </p>