Ionic StorageModule no data after update

Viewed 27

for the update of an ionic app from 5.3.4 to 6.1.13, also the ionic storage package changed from @ionic/storage (version 2) to @ionic/storage-angular (version 3). The whole app works fine, however I am unable to get already saved data with the new storage-module:

Old App (Ionic 5)

package.json:

"@angular/core": "~9.1.6",
"@ionic/angular": "^5.3.4",
"@ionic/storage": "^2.3.1",

app.module:

import { IonicStorageModule } from '@ionic/storage';

@NgModule({
 ...
 imports: [
    IonicModule.forRoot(),
    IonicStorageModule.forRoot({
      name: '__mydb',
      driverOrder: ['sqlite', 'websql', 'indexeddb'],
    }),
    ...

New App (Ionic 6, new angular-storage module)

package.json:

"@angular/core": "^14.0.5",
"@ionic/angular": "^6.1.13",
"@ionic/storage-angular": "^3.0.6",

app.module:

import { Drivers } from '@ionic/storage';
import { IonicStorageModule } from '@ionic/storage-angular';

@NgModule({
    ...
    imports: [
     IonicStorageModule.forRoot({
       name: '__mydb',
       driverOrder: [CordovaSQLiteDriver._driver, Drivers.IndexedDB, Drivers.LocalStorage],
     }),
     ...

I even tried to downgrade to the old storage package (same version as in old app), still I am unable to retrieve the already saved data:

New App (Ionic 6, old storage module)

package.json:

"@angular/core": "^14.0.5",
"@ionic/angular": "^6.1.13",
"@ionic/storage": "2.3.1",

app.module:

import { IonicStorageModule } from '@ionic/storage';

 @NgModule({
   ...
   imports: [
    IonicStorageModule.forRoot({
      name: '__mydb',
      driverOrder: ['sqlite', 'websql', 'indexeddb'],
    }),
   ...

I would appreciate any insights / tips, the database name did not change and the data is still there, because if I install the old version again all data is retrieved successfully. But If I try to get the data (same key) with the updated ionic app, regardless of old or new storage package, I can't retrieve the data

Saving / retrieving new data with the new storage module works fine as well!

Testes with both IOS and Android

0 Answers
Related