Support the ongoing development of Laravel.io →
Laravel Database Forge

Hello,

I want to migrate my app from a server to another one and keep the users logged in. I am using passport for authentication.

I tried to copy the database to the new server as the auth_access_tokens are stored in the database.

I tested that by:

  1. Login to the old server.
  2. Copy the database to the new server
  3. Use the old server token in the new server APIs.

but i got Unauthenticated.

Does anyone has a clue how to migrate my app to another server with keeping my users logged in?

Thanks

Last updated 2 years ago.
0

You need to move the private and public key to the new server, so the encryption token become the same in the old server.

mostafakram liked this reply

1

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.