Following tools are provided by Pimcore to support deployment processes.
All Pimcore configurations are saved as PHP files on the file system. As a result they can be included into version control systems and by utilizing the multi environment feature different configuration files for different deployment stages an be defined.
Pimcore Class Definitions
As with Pimcore configurations also Pimcore class definitions are saved as PHP configuration files and therefore can be added to version control systems and be deployed to different deployment stages.
Note: Changes on Pimcore class definitions not only have influence to configuration files but also on the database. If deploying changes between different deployment stages also database changes need to be deployed. This can be done with the
After every code update you should use the
deployment:classes-rebuild command to push changes to the database.
php pimcore/cli/console.php deployment:classes-rebuild
As an alternative also class export to json-files and the class import commands can be used.
php pimcore/cli/console.php definition:import:objectbrick /brick_jsonfile_path.json php pimcore/cli/console.php definition:import:fieldcollection /collection_jsonfile_path.json php pimcore/cli/console.php definition:import:class /class_jsonfile_path.json
The Pimcore Console provides several useful tasks for deployment. These tasks can be integrated into custom deployment workflows and tools. One example for them would be the Pimcore class definitions as described above.
To get a list of all available commands use ```php pimcore/cli/console.php list````.
Potentially useful commands:
|classmap-generator||Generate class maps to improve performance|
|mysql-tools||Optimize and warmup mysql database|
|search-backend-reindex||Re-indexes the backend search of pimcore|
|update||Update pimcore to the desired version/build|
|cache:warming||Warm up caches|
|classificationstore:delete-store||Delete Classification Store|
|definition:import:class||Import Class definition from a JSON export|
|definition:import:fieldcollection||Import FieldCollection definition from a JSON export|
|definition:import:objectbrick||Import ObjectBrick definition from a JSON export|
|deployment:classes-rebuild||rebuilds classes and db structure based on updated
|thumbnails:image||Generate image thumbnails, useful to pre-generate thumbnails in the background|
|thumbnails:optimize-images||Optimize filesize of all images in
|thumbnails:video||Generate video thumbnails, useful to pre-generate thumbnails in the background|
Find more about the Pimcore Console on the dedicated page.
The content migration between environments is not provided by Pimcore and also it's not recommended.
The content should be created by editors in the production environment and visibility on the frontend can be managed by built-in features like publishing / unpublishing / versioning / scheduling / preview the effect in editmode.
Therefore, editors shouldn't work on different stages.
Of course, the content migration is possible but this is always a very individual task depending on data model, environments and use cases.