Resetting an Umbraco Backoffice Password at the Database Level

Are you locked out of your Umbraco account?

If you're running an Umbraco site locally, or are using a test email address, you won't be able to reset your password using the "forgot password" function, which means your only option to reset the password is to update the database directly.

Fortunately, this is a simple task, let's go through it.

STEP 1: Open SSMS, navigate to your database and find the umbracoUser table, right click and select the top 1000 rows. Then find the userId of the email login you are attempting to login with.

STEP 2: Go to dotnetfiddle.net in your web browser and run the following code, changing "YourNewPassword" to the new password you want to set. This will create a password hash, which we then want to save in the database for your user.

using System;
using Microsoft.AspNetCore.Identity;

namespace GenerateHash
{
    class Program
    {
        static void Main(string[] args)
        {
            var password = "YourNewPassword"; // Replace with your new password
            var passwordHasher = new PasswordHasher<object>();
            var hashedPassword = passwordHasher.HashPassword(null, password);
            Console.WriteLine(hashedPassword);
        }
    }
}

STEP 3: Back in SSMS, write an UPDATE statement to set your new password. While you're here, set lastLockoutDate to NULL, and userNoConsole and failedLoginAttempts to zero, to ensure you're not locked out of your account.

(Copy and paste the hash you generated earlier into the userPassword field and update the id to the id of the user whose password you want to reset from step 1)

UPDATE [yourdatabasename].[dbo].[umbracoUser]
SET userPassword = 'yourHash', 
    userNoConsole = 0, 
    failedLoginAttempts = 0
WHERE id = -1

Click Execute or press F5.

That's it! You can now login to the Umbraco Backoffice using your new password.