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. Rehearse it 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
Open the wizard through Sublogin > Sublogin Transform in Admin. The flow has four steps: select the source customer and the target parent customer, review a preview of the affected data, execute, then confirm the result page.
The preview also offers Additional Sublogin Settings for the new record — Active, Expire Date and Send Emails — so the resulting account state is chosen deliberately rather than inherited blindly.
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. It is available from two places:
- the Transfer to Customer mass action on the Admin sublogin grids;
- the Transform to Customer button on the Admin sublogin edit page.
Both paths execute immediately after the browser confirmation — there is no preview step for this direction. The record is deleted at the end, so verify the sublogin's addresses and orders before triggering it.
Parent-customer addresses merely assigned to the sublogin are not the same as sublogin-owned addresses. Check the sublogin record and its orders in Admin so the new customer receives the intended data.
Safe procedure
- Stop integrations that might update either account during the change.
- Take a database backup.
- Reproduce the accounts in staging.
- For customer to sublogin, open the wizard and review its preview; for sublogin to customer, review the record in Admin because the action runs without a preview.
- Record the source, target and affected orders for internal change control.
- Execute once.
- Test login or password reset for the resulting account.
- Verify addresses, newsletter state, order history and website scope.
- 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.