Hi team, We are trying to migrate the existing users from Development Environment to Production env...
j
Hi team, We are trying to migrate the existing users from Development Environment to Production environment such that the user does not have to signup again after the migration. From my understanding of Migration section, I need to do following: 1. Get all the user data from Devlopment instance 2. Iterate over each user and make curl request to import the user email id and password hash in Production environment 3. Make request to map userIds of Production instance with the userIds of the Development instance Is this approach correct? Also, I understand we nee to upgrade the instance to the latest version, currently its version 3.14. Are there any breaking changes that might happen because of the upgrade?
n
Hi @jimgambit, Do you store the userids in your own database?
j
Hi @nkshah2 , Yes, we have one user table in our own database which uses same userIds as Supertokens
n
Right so to make sure I understand correctly, currently your user table has entries for users using the user ids from a supertokens dev instance. You want to move users over while maintaining information in your user tables correct?
j
Yes, exactly.
n
Right so your approach is fine in that case
To upgrade to the latest version the changelog explains the changes, but since you are using the Managed Service we can do it for you
j
Okay, I haven't seen the changelogs yet, but does that upgrade requires any code changes from our side?
n
No code changes are required from your end
If you are using the managed service and want us to upgrade the version for you feel free to email us at
team@supertokens.com
and we'd be happy to help
j
Awesome!
Will do that
One more doubt regarding the above approach. For user with an ongoing sessions, how do we handle the migration?
Will it throw error for them?
n
Actually that probably wont help
j
Okay, I have referred to this document. But I have faced issue implementing it because in my case I don't have another provider, its another supertokens instance and I don't know how to connect two different supertokens instance in the same application.
n
So users with an active session will still be able to use the app, since session verification is stateless the backend would consider the old session details as valid. The problem would occur when the session needs to be refreshed because the refresh token will be invalid
About this, what backend SDK (and version) are you using?
j
supertokens-python 0.7.0
Any idea on how to fix the refresh token?
n
One thing I can think of is to check if a session exists and if the session was created before a specific date (the date you move to the production instance for example) and then revoke that session + create a new session
The downside is that users with sessions that have expired will be logged out because refreshing will fail
Ill double check if theres another way we can make this happen that covers all our bases so give me a bit and ill get back to you
@jimgambit So we can move data from the dev to production instance for you (this will include everything including refresh tokens so active sessions would continue to work). In order for us to do this however you would need to create a production instance from our dashboard and then let us know. Keep in mind that you wont be able to use the production instance while we are migrating the data (otherwise youd lose any data you create in the production instance) so there will be a period of un-usability from your perspective (a couple hours or so)
2 Views