Skip to the content
Documentation
Help Start
Reading in:
  • German: 9,059 of 9,059 pages
About the help in other languages
All help pages

exp:expuserimport

Import accounts from a CSV or JSON file, each created as exp:user:create creates it, with the activation mail or disabled; never a password from the file (a dry run that checks every row unless --apply).

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/examples/commands/expuserimport.md

On this page

exp:expuserimport

Import accounts from a CSV or JSON file, each created as exp:user:create creates it, with the activation mail or disabled; never a password from the file (a dry run that checks every row unless --apply).

Script bin/php/expuserimport.php, code in kernel/private/classes/commands/expuserimport.php. Run it from the installation root, as the user the web server runs as:

./console exp:expuserimport --help
./console exp:user:import --help
php bin/php/expuserimport.php --help

Help text

Import accounts
Reads a CSV file (a header line with the columns login, email, first_name, last_name, groups) or a
JSON file (an array of objects with the same keys); groups are node ids or names separated by |,
and a row without groups goes to --group. Each account is created exactly as exp:user:create
creates it. Choose --send-activation (every person gets the activation mail and sets a password
with "Forgot password") or --disabled (the accounts start disabled; reset their passwords later).
A file with a password column is refused: an import never takes passwords. A login that exists
already is skipped; a login twice in the file is refused. Without --apply every row is checked
and nothing is created.

./console exp:user:import members.csv --group=Members --send-activation
./console exp:user:import members.csv --group=Members --send-activation --apply
./console exp:user:import staff.json --disabled --apply --format=json

Options

OptionValueHelp
--typerequiredThe file type: csv (default) or json; import reads it from the file name when not given
--grouprequiredA user group by node id or name: list, export and bulk take only its members (below it, at any depth); create and import: the group of the new accounts (repeat for more, the first is the main group; default [UserSettings] DefaultUserPlacement)
--send-activationCreate the account disabled and send the activation mail; the person sets a password with "Forgot password"
--disabledCreate the account disabled (enable it later with exp:user:enable)
--applyMake the change; without it the command only lists what it would change (a dry run)
--dry-runThe default, kept for scripts that pass it: list what would change, change nothing
--asrequiredAct as this user (login, e-mail or id; default the user of [UserSettings] UserCreatorID); the audit records it as who did it
--formatrequiredtext (default) or json (the machine output exp-user/1)

Read from the option definitions in the code (startup(), getOptions(), options() or ezcConsoleOption). Every script also takes the standard options of the script framework (--help, --siteaccess, --debug, --quiet, --allow-root-user ...).

Arguments: [file].


Generated by ./console exp:help:examples from bin/php/expuserimport.php, kernel/private/classes/commands/expuserimport.php. Do not edit this page: change the source and generate again (how). Free documentation: GFDL 1.3 or later.

Something wrong on this page? Report an error

Documentation license

This documentation is free documentation, licensed under the GNU Free Documentation License 1.3 or later.

Exponential Copyright © 1998-2026 Exponential Foundation and 7x