Data lost with RN project to Expo project with AsyncStorage

Please provide the following:

  1. SDK Version: 37.0.12
  2. Platforms(Android/iOS/web/all): Android and IOS

I have an application that running with native code for Android and IOS

“react-native”: “0.51.0”, “redux-persist”: “4.8.2”

With the newer version I wanted to use expo :

“redux-persist”: “4.8.2”, “react-native”: “~0.61.5”, “expo”: “^37.0.12”,

Everything works fine expect than when I updating the application with the new one inside store I lost all data stored inside SQLlite with AsyncStorage from the RN older app.

It seems that the problem is that RN use RCTAsyncLocalStorage_V1 folder and expo RCTAsyncLocalStorage.

How I can fix that with the easiest way for IOS and Android ?

Is it better to eject expo app or to add migration code and migrata DB files to the right folder ? Is it not to update this name on expo with RCTAsyncLocalStorage_V1 ?

Hey @_valentinb,

We don’t have any official resources for how to handle this yet but here is how one user handled it within their application: FileSystem.documentDirectory changed between SDK 32 and 35 · Issue #5942 · expo/expo · GitHub and here’s another slightly older issue detailing it Migrate AsyncStorage to ReactNative (iOS), losing old data · Issue #5651 · expo/expo · GitHub

Cheers,
Adam

Thx for the reply

If I understand right on these two tickets they want to do exactly the contrary than what I want to do.

I have upgraded expo with the latest version (38.0). Following this ticket and if I understand right on more time AsyncStorage state is lost when ejecting · Issue #8220 · expo/expo · GitHub now the version 38 is able to do the migration of data if you switch from expo to RN application.

Why not do the contrary ? Is it because it doesn’t meet the standards?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.