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', 'female', or 'not_to_say'.
"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, orsha256.If no salt is used, the algorithm value must be set as
unsalted_sha256instead ofsha256.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.
Checking Migration Errors
If the error_count value in the progress response is greater than 0, the details of the failed records can be retrieved with the following request:
If there are no errors, the response is returned as follows:
Otherwise, the errors list contains an entry for each failed record, explaining the reason for the failure.
Migrating Users Without a Phone Number
By default, the phone field is required: a record whose phone value is null is rejected and reported as an error. Two optional parameters change this behaviour, and they are sent together with the file as a params form field in JSON format:
allow_empty_phone: Whentrue, records with no phone number are migrated with an emptyphonevalue.default_phone: A phone number that is written to every record that has no phone number of its own. Records that already contain a phone number are not affected.
How the two parameters interact:
allow_empty_phone takes precedence over default_phone. For a record with no phone number, the outcome is as follows:
allow_empty_phone
default_phone
Result
true
any
The user is migrated with an empty phone.
not sent / false
provided
The user is migrated with default_phone as their phone number.
not sent / false
not sent
The record is rejected and counted as an error.
Choose allow_empty_phone when the old system genuinely has no phone data and the empty value should be preserved, so that users can add their own number later. Choose default_phone when a phone number is required downstream and a shared placeholder value is acceptable; keep in mind that this placeholder is stored on every such user, so it should be a value that is clearly not a real customer number.
Last updated
Was this helpful?

