Logging in to Sitecore XP with some external user (AzureAD, for example) might fail with an unhandled exception after moving the security database. The error occurs due to the missing UserLogins table. The following message can appear in the log:
Exception: System.Exception Message: Invalid object name 'UserLogins'. Source: Sitecore.Kernel at Sitecore.Data.DataProviders.Sql.DataProviderCommand.ExecuteReader() at Sitecore.Data.DataProviders.Sql.DataProviderReader..ctor(DataProviderCommand command) at Sitecore.Data.DataProviders.Sql.SqlDataApi.<>c__DisplayClass29_0.<CreateReader>b__0() at Sitecore.Data.DataProviders.NullRetryer.Execute[T](Func`1 action, Action recover) at Sitecore.Data.DataProviders.Sql.SqlDataApi.CreateReader(String sql, Object[] parameters)
To resolve the issue, consider the following workaround: