file
Attaches a file of the migrations folder to a file attribute (ezbinaryfile, ezmedia) of an object.
A step of a YAML migration with type: file. The class expMigrationStepFile (kernel/classes/migration/steps/expmigrationstepfile.php) is registered in settings/migration.ini [StepSettings] StepTypeList[file].
Keys
| Key | Type | Default | What it is |
|---|---|---|---|
object | identifier (object) | the object (or node:) | |
node | identifier (node) | a node of the object (or object:) | |
field | string | required | the identifier of the attribute (ezbinaryfile, ezmedia) |
file | string | required | the file: a path below the folder of the migration file (files/report.pdf) |
name | string | the file name visitors get (default: the name of the file) | |
language | string | the translation that gets the file (default: the default language of content) | |
in_place | bool | false | true: the published version is changed in place, without a new version |
missing | string: fail, skip | "fail" | what happens when the object is not there: fail (the default) or skip |
workflows | bool | false | true: the workflows of the operation's triggers run, as in the administration (default: they do not) |
notify | bool | false | true: 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:
| Value | What it is |
|---|---|
object_id | the id of the object |
node_id | the id of its main node |
remote_id | its remote id |
version | its current version |
name | its name |
path | the url path of its main node |
changed | true when the step changed the object |
Undoing
A step of this type does not undo itself: a migration with it needs down: or a rollback to its caption.
Caches it touches (cleared after the run): content.
Example
- type: file
object: remote:annual-report
field: file
file: files/annual-report-2026.pdf
name: Annual report 2026.pdfRelated
Generated by ./console exp:help:examples from settings/migration.ini, kernel/classes/migration/steps/expmigrationstepfile.php. Do not edit this page: change the source and generate again (how). Free documentation: GFDL 1.3 or later.