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

user (migration step)

Creates, updates, ensures or deletes a user account with its groups, password and fields.

Download as PDF

Address: https://doc.exponential.earth/learninminutes/exphelp/viewer/examples/migration-steps/user.md

On this page

user

Creates, updates, ensures or deletes a user account with its groups, password and fields.

A step of a YAML migration with type: user. The class expMigrationStepUser (kernel/classes/migration/steps/expmigrationstepuser.php) is registered in settings/migration.ini [StepSettings] StepTypeList[user].

Modes

mode: is one of create, update, ensure, delete; every step names one.

Keys

KeyTypeModesDefaultWhat it is
loginstringcreate, ensurethe login of a new user; ensure finds the user by it
useridentifier (user)update, deletethe user to update or delete: login, id or remote:<remote id>
emailstringcreate, update, ensurethe e-mail address of the account
passwordstringcreate, update, ensurethe password, hashed as eZUser hashes it (ensure: only for a new user); use a placeholder, never the password in the file
password_hashstringcreate, update, ensurea password hash to store as it is (instead of password:)
password_hash_typestringcreate, update, ensurethe type of password_hash: (md5_password, md5_user, md5_site, plaintext, password_hash ...)
secretsmapcreate, update, ensurelogin, email or password => the name of a secret (Setup > Secrets, or env:<variable>) the value is read from when the step runs, instead of login:, email: or password:
enabledboolcreate, update, ensurewhether the account can sign in (default for a new user: true)
groupslistcreate, update, ensurethe nodes of the user groups the user is in (the first is its main location); update and ensure add the user to those it is not in
remove_groupslistupdatethe nodes of user groups the user leaves (not the main one)
classidentifier (class)create, ensure"user"the class of a new user (default: user)
remote_idstringcreate, ensurethe remote id of a new user's object
languagestringcreate, update, ensurethe language of fields: (default: the default language of content)
fieldsmapcreate, update, ensureattribute identifier => value (first_name, last_name ...); the account is set by login:, email: and password:
missingstring: fail, skipupdate, delete"fail"what happens when the user is not there: fail (the default) or skip
workflowsboolcreate, update, ensurefalsetrue: the workflows of the operation's triggers run, as in the administration (default: they do not)
notifyboolcreate, update, ensurefalsetrue: the publish makes a notification event (default: published without notification)

Besides these, every step takes the keys of the engine: type, mode, if, references, environments, engines and comment (the file format). A key of type identifier names a node, an object or another part of the installation by id, remote id, path or name (identifiers).

Values for references

references: { <name>: <value> } keeps a value of the step's result as ${ref.<name>} for the steps and migrations after it:

ValueWhat it is
object_idthe id of the user's object (the user id)
node_idthe id of its main node
remote_idits remote id
loginthe login
emailthe e-mail address
createdtrue when the step created the user
changedtrue when the step changed it (created, updated or deleted)

Undoing

Some steps of this type undo themselves when their migration is rolled back without down: (the class says which); a migration with any other step of it needs down: or a rollback to its caption.

Caches it touches (cleared after the run): content, user_info_cache.

Example

- type: user
  mode: ensure
  login: editor
  email: [email protected]
  password: "${ref.editor_password}"
  groups: [ "remote:news-editors" ]
  fields: { first_name: News, last_name: Editor }
  references: { editor: object_id }

Generated by ./console exp:help:examples from settings/migration.ini, kernel/classes/migration/steps/expmigrationstepuser.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