Transform Customers and Sublogins

mageb2b/sublogin-transform changes account ownership. It can turn a Magento customer into a sublogin of another customer, or turn a sublogin into an independent Magento customer.

This is a structural, destructive operation. Use the preview in staging, take a database backup and verify orders and addresses before running it in production.

Install

composer require mageb2b/sublogin-transform
php bin/magento module:enable MageB2B_SubloginTransform
php bin/magento setup:upgrade

Only administrator roles with MageB2B_SubloginTransform::transform_manage may use the tool.

Customer to sublogin

This direction can:

  • create a sublogin under the chosen parent customer;
  • preserve the source account's password hash and newsletter state;
  • move addresses into the new ownership model;
  • reassign historic orders;
  • reparent sublogins that belonged to the source customer;
  • delete the original Magento customer record after the transformation.

The source customer ceases to be an independent account. Review website scope, duplicate email rules, address ownership and every nested sublogin shown in the preview.

Sublogin to customer

This direction creates an independent Magento customer, transfers sublogin-owned addresses, reassigns orders and deletes the original sublogin record.

Parent-customer addresses merely assigned to the sublogin are not the same as sublogin-owned addresses. Check the preview so the new customer receives the intended records.

Safe procedure

  1. Stop integrations that might update either account during the change.
  2. Take a database backup.
  3. Reproduce the accounts in staging.
  4. Open the transform tool and review its preview.
  5. Record the source, target and affected orders for internal change control.
  6. Execute once.
  7. Test login or password reset for the resulting account.
  8. Verify addresses, newsletter state, order history and website scope.
  9. Resume integrations only after their external identifiers still resolve correctly.

Do not use transform to merge duplicates casually

The tool changes one account type into another; it is not a general customer deduplication engine. If two independent customers already contain overlapping orders, addresses or external IDs, define the desired surviving identity before transforming either record.

Related: Multi-Account Management and Sublogin Web API.