User Migration

  • If user passwords in the old system are encrypted using MD5, SHA1, or SHA256, you can migrate users using these algorithms.

  • Otherwise, after users are migrated, they must create a new password using the Forgot Password option during their first login. In this case, get in touch with the Akinon team to receive assistance regarding the password_algorithm value to be used in the upcoming steps.

  • Migrated users can be checked in the omnitron panel under Sales Channel > Users section.

  • Unencrypted credentials of the test user undergoing migration will be needed for future checks.

  • The user being imported must not have a record in Omnitron. The email field must be unique.

Commerce ENV Settings

If the encryption algorithm is "md5," then the PASSWORD_HASHERS list in the ENV should be updated as follows:


PASSWORD_HASHERS='django.contrib.auth.hashers.PBKDF2PasswordHasher','django.contrib.auth.hashers.PBKDF2SHA1PasswordHasher','django.contrib.auth.hashers.Argon2PasswordHasher','django.contrib.auth.hashers.BCryptSHA256PasswordHasher','django.contrib.auth.hashers.BCryptPasswordHasher','django.contrib.auth.hashers.MD5PasswordHasher','django.contrib.auth.hashers.UnsaltedMD5PasswordHasher'

If the encryption algorithm is "sha1," then the PASSWORD_HASHERS list in the ENV should be updated as follows:


PASSWORD_HASHERS='django.contrib.auth.hashers.PBKDF2PasswordHasher','django.contrib.auth.hashers.PBKDF2SHA1PasswordHasher','django.contrib.auth.hashers.Argon2PasswordHasher','django.contrib.auth.hashers.BCryptSHA256PasswordHasher','django.contrib.auth.hashers.BCryptPasswordHasher','omnishop.users.helpers.SHA1MD5PasswordHasher','django.contrib.auth.hashers.SHA1PasswordHasher', ‘django.contrib.auth.hashers.UnsaltedSHA1PasswordHasher'

If the encryption algorithm is "sha256," then the PASSWORD_HASHERS list in the ENV should be updated as follows:


PASSWORD_HASHERS='django.contrib.auth.hashers.PBKDF2PasswordHasher','django.contrib.auth.hashers.PBKDF2SHA1PasswordHasher','django.contrib.auth.hashers.Argon2PasswordHasher','django.contrib.auth.hashers.BCryptSHA256PasswordHasher','django.contrib.auth.hashers.BCryptPasswordHasher','omnishop.users.helpers.SHA256PasswordHasher', ‘omnishop.users.helpers.SHA256UnsaltedPasswordHasher'

Example Request

Test User File Format (test_user.json)

Description:

The data format requirements for each field are as follows:

  • "first_name": Should be in String format and is mandatory.

  • "last_name": Should be in String format and is mandatory.

  • "email": Should be in Email format and is mandatory.

  • "gender": Should be in String format, can be null or an empty string. Acceptable values are 'male' or 'female'.

  • "sms_allowed": Should be in Boolean format and is mandatory.

  • "email_allowed": Should be in Boolean format and is mandatory.

  • "phone": Should be in the format "5XXXXXXXXX" as a string. Can be null. For foreign numbers, please seek assistance from the Akinon team.

  • "date_of_birth": Format is detailed in the date_format section. Can be null.

  • "date_joined": Format is detailed in the datetime_format section and is mandatory.

  • "password": Format is detailed in the password section and is mandatory.

  • "password_algorithm": Should be in String format. Acceptable values are 'sha1', 'md5', or 'sha256'. Mandatory.

  • "customer_code": Should be in String format and is mandatory. After migration, this information will be stored in user.attributes.migration_customer_code.

  • "verified": Should be in Boolean format and is mandatory.

  • "facebook_uuid": Should be in String format, can be null or an empty string.

  • "attributes": Should be in Dictionary format and is mandatory. If empty, it should be provided as {}.

  • "call_allowed": Should be in Boolean format.

  • "user_type": Should be in String format and is mandatory. Acceptable values are 'guest' or 'registered'.

Date Format:

The following formats are accepted as date_format:

  • '%Y-%m-%d'

  • '%Y/%m/%d'

  • '%d.%m.%Y'

  • '%d-%m-%Y'

  • '%d/%m/%Y'

Password Format:

It should be provided in the following format: {algorithm}${salt}${hash_value}

  • algorithm: Can be sha1, md5, or sha256.

    • If no salt is used, the algorithm value must be set as unsalted_sha256 instead of sha256.

    • Example:

  • salt: If unsalted, should be left empty.

  • hash_value: The hash value.

Example Response

When a request is made using cURL, the response received will be as follows:

Control

For verification, the following request is sent:

If the response received is as follows:

The response means that the user has been successfully migrated.

Last updated

Was this helpful?