exp:expuserexport
Export the accounts the list filters select as CSV or JSON: login, e-mail, names, state, groups, last visit (never a password or its hash).
Script bin/php/expuserexport.php, code in kernel/private/classes/commands/expuserexport.php. Run it from the installation root, as the user the web server runs as:
./console exp:expuserexport --help
./console exp:user:export --help
php bin/php/expuserexport.php --helpHelp text
Export accounts
Writes the accounts the filters of exp:user:list select, as CSV (a header line, cells that a
spreadsheet would run as formulas made safe) or JSON (an array of objects): id, login, email,
first_name, last_name, name, enabled, states, groups (node ids separated by |), main_group,
last_visit, login_count. Never a password or a password hash. To standard output, or with --output
to a new file of mode 0600 (then the command prints a report). The file holds personal data:
keep it as such. exp:user:import reads the same columns.
./console exp:user:export > users.csv
./console exp:user:export --group=Members --state=enabled --output=var/members.csv
./console exp:user:export --state=inactive --days=365 --type=json --output=var/inactive.jsonOptions
| Option | Value | Help |
|---|---|---|
--state | required | Only accounts in this state: all (default), enabled, disabled, unactivated, pending, locked, never, inactive, orphaned, duplicate_login or duplicate_email |
--group | required | A 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) |
--search | required | Only accounts whose login, name or e-mail address contains this text |
--days | required | With --state=inactive: not signed in for this many days (default 180) |
--type | required | The file type: csv (default) or json; import reads it from the file name when not given |
--output | required | Write the export to this file (new, mode 0600) instead of standard output |
--format | required | text (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 ...).
Related
Generated by ./console exp:help:examples from bin/php/expuserexport.php, kernel/private/classes/commands/expuserexport.php. Do not edit this page: change the source and generate again (how). Free documentation: GFDL 1.3 or later.