Hi, Is there an efficient way to migrate data betw...
# support-questions-legacy
i
Hi, Is there an efficient way to migrate data between one supertons instance to another (assuming they are in different versions)?
r
Hey.
Do you have access to the dbs of both the instances?
i
they are both managed instances
but I think supertokens prod instance doesn't let me access the DB
r
Yea. That’s right. Only dev env
i
so I guess the answer for the original question is no 🙂
r
Right.
So first, it would be best if the two versions of the core are made the same.
i
I'm willing to try and build an API migration
but I can't find a "create User" API
r
So for API migration, there is a migration section in our recipe docs
That has the create user api
You can loop through one instance’s users, and call the create user api on the other instance followed by a user ID mapping call (if you need user ids to be the same)
i
yea that what the plan
I just couldn't find the call to create the user
will take a look
thanks
r
Which recipe are you using? I can send you a link
i
passwordlessThiredParty
i
thanks
I see in the guide that we use the
recipe/signinup/code
endpoint, will it means those users I migrate get an email? if they do, is there a way to disable it for the migration?
r
users wont get an email from this API call
i
👍 and if I wish to copy over also the roles I need to do additinal two calls right? to read the user roles and assign them
r
yea.
i
while calling the endpoints in my dashboard from a node script using https built in lib I get ENOTFOUND
anything i'm missing?
r
whats the connection uri you are hitting?
and whats the request like in code?
i
'https://573f32c3d1ec11ed9dfc296e2ade3dbb-us-east-1.aws.supertokens.io:3570'
path is
/${tenantId}/users?${queryString}
but I don't think my error is related to the path
it is more about the address
this address works perfectly with the sdk
r
hmm. Can i see trhe node code for how you are querying it?
i
very vanila
r
seems fine on a quick glance
im not sure whats wrong,.
try using a lib like axios maybe
i
I can just wanted to avoid that
dig: ;; ANSWER SECTION: 573f32c3d1ec11ed9dfc296e2ade3dbb-us-east-1.aws.supertokens.io. 60 IN A 44.213.71.25
ns lookup Server: 2a0d:6fc0:9c3:d00::1 Address: 2a0d:6fc0:9c3:d00::1#53 Non-authoritative answer: Name: 573f32c3d1ec11ed9dfc296e2ade3dbb-us-east-1.aws.supertokens.io Address: 44.213.71.25
r
really not sure why this is not working. Im not familiar with the node's https API
i
ok with Axious i'm getting 401
r
right. this means the api key is invalid
so double check that
i
yea got that
I will
4 Views