Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrating AsyncStorage to Redux-Persist-Filesystem-Storage #7

Closed
JonnyLinja opened this issue Jan 22, 2018 · 5 comments
Closed

Migrating AsyncStorage to Redux-Persist-Filesystem-Storage #7

JonnyLinja opened this issue Jan 22, 2018 · 5 comments

Comments

@JonnyLinja
Copy link

JonnyLinja commented Jan 22, 2018

I have an existing app in production with the Android storage issue. I want to migrate to Redux-Persist-Filesystem-Storage without losing the previous store. How would I go about this?

Would it be possible to look through the keys of AsyncStorage and duplicate what I can? I am on V4 of redux-persist, so supposedly there is https://github.com/rt2zz/redux-persist/blob/master/src/integration/getStoredStateMigrateV4.js

@sospedra
Copy link

I'm running in the same problem. Specially for mantaining the user logged in and the current route.
We cannot swap to this (btw awesome) project if migrations are not possible 😞

@maxkomarychev
Copy link
Contributor

I've got similar issue. This is how I tackled it (note there are couple questions I'm asking, so I am still not 100% sure this is the right way).

It is supposed to safely fallback to previous data in AsyncStorage if there is nothing stored before in fs storage.

I'd appreciate if you can check it out and share your opinion if it works for you or no, thanks!

@maxkomarychev
Copy link
Contributor

As far as I understand the migration mentioned above is to migrate state shape between v4 and v5 and doesn't work if you want to hot-replace the storage engine itself.

@robwalkerco
Copy link
Owner

I haven’t tried migrating between different storage engine myself, but am keen to hear what works for you, as I think I will need to do this myself soon an a project.

@robwalkerco
Copy link
Owner

@maxkomarychev Just tried your solution at rt2zz/redux-persist#679 and it worked great 👏

I'm going to close this task, as it seems there is a working solution now.

maxkomarychev added a commit to maxkomarychev/redux-persist-filesystem-storage that referenced this issue Jan 26, 2018
maxkomarychev added a commit to maxkomarychev/redux-persist-filesystem-storage that referenced this issue Jan 26, 2018
maxkomarychev added a commit to maxkomarychev/redux-persist-filesystem-storage that referenced this issue Jan 26, 2018
Provide sample snippet which lets app migrate data previously stored in
`AsyncStorage` to `redux-persist-filesystem-storage`

Original issues:
rt2zz/redux-persist#199
rt2zz/redux-persist#284

Converastions related to provided snippet:
rt2zz/redux-persist#679
robwalkerco#7
maxkomarychev added a commit to maxkomarychev/redux-persist-filesystem-storage that referenced this issue Jan 26, 2018
Provide sample snippet which lets app migrate data previously stored in
`AsyncStorage` to `redux-persist-filesystem-storage`

Original issues:
rt2zz/redux-persist#199
rt2zz/redux-persist#284

Converastions related to provided snippet:
rt2zz/redux-persist#679
robwalkerco#7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants