Auth0 Home Blog Docs

How to turn off custom user database and use Auth0 user database after migration?




I have a single database connection, which was the original default “Username-Password-Authentication”, and that connection has now been configured with both “Import Users to Auth0” and “Custom database” enabled.

![alt text][1]

The idea was that as users authenticated to the custom database their details would be migrated to Auth0 then at some point I could disable “Custom database” and from that point the Auth0 internal database would be used. So I tried to turn off the custom database just now and I got this error…

![alt text][2]

So I’m wondering now why I’m getting this error “This database contains 66 users. You cannot change “options.enabledDatabaseCustomization” setting.” What do I need to do now to disable my custom database connection and just use the internal Auth0 user database?



If the migration is finished or you want to stop the migration now, you should edit the action scripts as mentioned in the following document, instead of turning off the toggle in screenshot:


@thameera thx for your response. I’m still a little bit confused as the migration instructions included a step to create a new database connection but we didn’t do that, we just modified the existing default “Username-Password-Authentication” to “Use a custom database” and “Import users to Auth0”. At the end of the “migrating#4-complete-the-migration” it says “At this point, you can disconnect your legacy database (not the Auth0 database)” but because we didn’t create a new database connection I’m not sure how we can do this.

So because we didn’t create a new custom database did the migration happen at all or it has happened and the statement about disconnecting the custom database is not correct? thx


@chris2 No need to create a new DB connection, “Username-Password-Authentication” would work just fine.

You don’t really have to do anything about “disconnect your legacy database (not the Auth0 database)”, as long as you change the Login and Get User scripts to what’s in the link I posted above.


@thameera thx, testing it now. The Auth0 documentation on migration is certainly confusing


@chris2 Glad to hear it’s working! And your feedback about docs is much appreciated; we’ll see how we can improve the related documentation.