Export setup
The bundle allows manual and automatic execution of exports. The export can be setup in different ways. For all ways, there are two export modes:
- Full Export: Does a full export regardless of items that might be in the queue.
- Only Queue Items: Only exports items that are in the queue (populated via the Delivery Trigger settings).
Manual execution directly in Configuration
The export can be executed directly by the user in the configuration dialog. For the two export modes, two different buttons exist. When clicking the corresponding button, the export is executed asynchronously via Symfony messenger queue.
The progress of the export is also visualized directly in the configuration dialog, the Export Logs
tab shows all log
messages from the export.
Please make sure to set up following thing:
- Setup of Symfony messenger queue and the transport
pimcore_datahub_fileexport
is processed.
Automatic execution via Cron Definition
In addition to the manual execution, a recurring export based on cron definitions can be configured directly in the configuration. Thus, it is possible to easily configure exports e.g. every 10 Minutes, once a day, etc.
See for example Crontab Guru for possibilities and a generator for generating cron definitions.
For the two export modes, two cron definitions can be configured. If cron definition is empty, export is not executed. The actual export then is processed via Symfony messenger queue.
Please make sure to set up following things:
- Execution of
datahub:export:file:execute-cron
on regular basis, e.g. every minute. It checks, if any cron definitions require execution of an export. - Setup of Symfony messenger queue and the transport
pimcore_datahub_fileexport
is processed.
Execution via Process Manager
To setup execution via ProcessManager, add a Pimcore Command datahub:export:file
.
- If you only want to export the queue items (Trigger for delivery ==
Populate to queue
) you have to add the parameter--only-queue-items
. For example:--config-id="test-json --only-queue-items
. - In the
Command options
field you have to provide the DataHub configuration name/id asconfig-id
parameter of the export, for example--config-id="test-json"
In the Loggers tab you can define the logging parameters. Settings like this should be enough most of the time...
After the configuration you can run the command manually with the Execute
button, or the cronjob is executing it if you
have defined it in the configuration.
For this execution option, no Symfony messenger queue is necessary.
Execution via CLI Command
The export command also can be setup and executed directly as cronjob by just executing the datahub:export:file
command (for details
see --help
option). This might be useful, when more custom execution definitions are necessary or special infrastructure
requirements exist.
For this execution option, no Symfony messenger queue is necessary.