# Migrated password hashes support

**URL:** https://meta.discourse.org/t/migrated-password-hashes-support/19512
**Category:** Plugin
**Created:** [1 september 2014 om 17:51 UTC](https://meta.discourse.org/t/migrated-password-hashes-support/19512 "2014-09-01T17:51:25Z")
**Posts on this page:** 1
**Showing post:** 1

<div class="post-metadata">

### Author: ![michaeld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/michaeld/32/1594_2.png) [@michaeld](https://meta.discourse.org/u/michaeld)
#### Post date: [1 september 2014 om 17:51 UTC](https://meta.discourse.org/t/migrated-password-hashes-support/19512/1 "2014-09-01T17:51:25Z")

</div>

Here is the password migration support plugin:

[https://github.com/communiteq/discourse-migratepassword/](https://github.com/communiteq/discourse-migratepassword/)

### The original thread follows.

* * *

We do regular forum conversions (yes, we’ll open source the converter once it’s stable enough) and one of the big quirks when migrating to Discourse is the fact that all users have to set a new password, because the password in the original forum is encrypted.

So we thought of the following mechanism.

- when creating users in the conversion step, we store the original password hash in a custom field
- when a user logs in for the first time and the password that was entered is incorrect, the login mechanism uses the original hash method of the former forum and calculates and compares the hash with the stored value
- if there is a match, the password is set to the entered password and the user is logged in. The original hash can now be cleared.

This sounds like a neat plugin 😄

Two questions:

- Any comments, objections (security?) and maybe even something that is even better?
- Can someone give us any pointers about which places to hook and how to store such a custom field?

---

_[View the full topic](https://meta.discourse.org/t/migrated-password-hashes-support/19512)._
