Learn how to migrate from NextAuth.js to Nile Auth
Migrating NextAuth data to Nile Auth
nextauth
schema. Modify the queries below to match your schema.sessions
and verification_tokens
tables.uuid
type for the id
column, while NextAuth.js uses serial
type (which is actually an integer).
Since there is no automatic conversion between these types, we recommend adding a new column to store the NextAuth.js user id,
allowing you to keep existing references to these IDs intact.auth.credentials
table to store account information instead of the accounts
table.
The query below will migrate the data from the accounts
table to the credentials
table.Linking users to tenants
tenants
table, and your data is in tenant-aware tables with tenant isolation.
Migrating data from existing database into Nile’s virtual tenant databases is out of scope for this guide, but you can reach out to us for help.In order to link users to tenants, you’ll need to populate the users.user_tenants
table with the relationships between users and tenants.
You’ll need to convert the current mapping of NextAuth.js users to tenants to the new Nile Auth user_tenants table.For example, if you have a memberships
table with this mapping, you can use the following query to migrate the data:Social Providers
Passwordless Authentication
Application Migration