Staff Import and Export

The Import/Export add-on is for bulk Staff account maintenance. Magento administrators can export selected representatives from the Staff grid, while imports can be run through Magento's standard import interface or the supplied CLI command.

Install

composer require mageb2b/staff-importexport:*
php bin/magento module:enable MageB2B_StaffImportExport
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento cache:flush

Export selected representatives

Open Staff > All Staff, select the rows and use the Export mass action. Magento generates a CSV from the selected Staff records. Password hashes and plain passwords are not exported.

Use an export from the same installed version as the safest starting template. Optional add-ons can add Staff fields, so a CSV from another store or release may not have the same columns.

Import a CSV

The package ships a sample file at:

vendor/mageb2b/staff-importexport/Files/Sample/staff.csv

Run an add/update import with:

php bin/magento staff:import-staff var/import/staff.csv --behavior=add_update --delete_file_after_import=0

Supported behaviors:

Behavior Use it for
append Creating rows without intentionally replacing existing Staff data
add_update Creating new representatives and updating matched records
replace Replacing matched Staff records; validate assignments and add-on fields carefully
delete Deleting the Staff records identified by the import

The command also accepts --field_separator, --field_multiple_value_separator and --fields_enclosure.

Important file-deletion default

--delete_file_after_import defaults to 1. A successful CLI import therefore deletes the source CSV unless you pass --delete_file_after_import=0.

Keep the explicit 0 while developing and validating a feed. Once automation is stable, decide deliberately whether a processed file should be deleted, archived elsewhere or retained by the upstream system.

Account emails

Stores > Configuration > MageB2B > Staff > Import settings > Send new staff account email on import is disabled by default. Enable it only when the CSV contains real, ready-to-activate accounts and the Staff email templates have been tested.

For a staged migration, leave email disabled, import into a non-production website, review permissions and customer assignments, then activate and notify representatives through the agreed onboarding process.

Validate before a large import

  1. Export two current Staff accounts and compare the headers with the planned feed.
  2. Import two fictional accounts into staging with --delete_file_after_import=0.
  3. Check website, status, group, customer access and operational permissions.
  4. Test an update to one account and confirm an unrelated account is unchanged.
  5. Test replace or delete only on disposable data.
  6. Review Magento's import output and logs before scheduling the job.

Related: Customer Assignment and REST and SOAP API.