1

Is it possible to move users along with their passwords? I can see the mapping option, but how do I output password in a template (I'm moving data between craft installations).

The below code does not work.

{% for user in craft.users().status(null).all() %}
    <password>{{user.password}}</password>
{% endfor %}
0

Password hashes aren't included in the default user query for security reasons, but if you want to force them to get added, you could use:

{% for user in craft.users().status(null).addSelect(['users.password']).all() %}
| improve this answer | |
  • I also need to migrate 800+ users and passwords from C2 to C3. I've got the following but password is blank each time. {% for user in craft.users.group('publicUsers').addSelect(['users.password']) %} <password>{{ user.password }}</password> {% endfor %} – CreateSean Feb 13 at 19:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.