Skip to the content
Documentation

exp:expuserexport

No ratings yet

Available since Exponential 6.0.15 (in development, not in a release yet).

Summary

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)

Usage

./console exp:expuserexport [options]
php bin/php/expuserexport.php [options]
./console exp:user:export [options]

Aliases

exp:user:export

Help

The output of ./console help exp:expuserexport (the script run with --help), without the standard options:

Usage: bin/php/expuserexport.php [OPTION]...
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.json


Options:
  --state=VALUE   Only accounts in this state: all (default), enabled, disabled, unactivated, pending, locked, never, inactive, orphaned, duplicate_login or duplicate_email
  --group=VALUE   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=VALUE  Only accounts whose login, name or e-mail address contains this text
  --days=VALUE    With --state=inactive: not signed in for this many days (default 180)
  --type=VALUE    The file type: csv (default) or json; import reads it from the file name when not given
  --output=VALUE  Write the export to this file (new, mode 0600) instead of standard output
  --format=VALUE  text (default) or json (the machine output exp-user/1)

Options

Option Value Description
--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)

Standard options

Every script also takes the standard options of the script framework: --help, --quiet, --siteaccess, --debug, --colors, --no-colors, --logfiles, --no-logfiles, --verbose and --allow-root-user.

Source

bin/php/expuserexport.php, kernel/private/classes/commands/expuserexport.php

See also

Generated example: exp:expuserexport

Added to the reference for Exponential 6.0.15.

Contributors

Comments

Add a comment

Comments are read by a moderator before they appear.