# Handling user passwords when importing from another forum software?

**URL:** <https://meta.discourse.org/t/handling-user-passwords-when-importing-from-another-forum-software/29324>\
**Category:** Support\
**Created:** [Maio 27, 2015, 7:37pm UTC](https://meta.discourse.org/t/handling-user-passwords-when-importing-from-another-forum-software/29324 "2015-05-27T19:37:55Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![jeffwidman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jeffwidman/32/105515_2.png) [@jeffwidman](https://meta.discourse.org/u/jeffwidman)\
**Post date:** [Maio 27, 2015, 7:37pm UTC](https://meta.discourse.org/t/handling-user-passwords-when-importing-from-another-forum-software/29324/1 "2015-05-27T19:37:55Z")

</div>

Continuing the discussion from [phpbb3 import script - users cannot login - password error](https://meta.discourse.org/t/phpbb3-import-script-users-cannot-login-password-error/29320/2):

> [@Phpbb3 import script - users cannot login - password error](https://meta.discourse.org/t/phpbb3-import-script-users-cannot-login-password-error/29320/2):
>
> For security reason, we can’t import passwords. All your users will have to reset their password.

Curious on this.

How hard is it to add a function that checks the password using the hashing scheme of the old forum and then re-encrypts using the new Discourse scheme?

For example, for a user-entered password, first try bcrypt (assuming Discourse uses this), then if that fails try MD5 (assuming phpbb uses that), and if that fails return an error. If MD5 returns successful, then re-encrypt the password using bcrypt and overwrite the old md5 hash.

Could this be implemented at the Postgres level without even needing to add anything to the Rails app?

I know Xenforo handles this in their imports automatically and it’s a very handy thing to have for an older forum where many users aren’t using valid email addresses. I’ve been amazed how many times people give up in frustration when their old password isn’t working and just create a new account. Makes me think there’s a good number who just give up and never re-register.

---

_[View the full topic](https://meta.discourse.org/t/handling-user-passwords-when-importing-from-another-forum-software/29324)._
