Deployment Tools
Pimcore provides the following tools to support deployment processes.
For deployments without database access (e.g. CI pipelines), Doctrine ORM cache warm-up fails because it tries to detect the database version. Configure the server version explicitly in the default DBAL connection:
doctrine:
dbal:
default_connection: default
connections:
default:
...
server_version: mariadb-10.11.0
Pimcore Configurations
Pimcore has two categories of configuration:
Symfony-only configurations (config/ directory) are standard Symfony YAML/PHP config files.
These are always file-based, included in version control, and deployed alongside code.
Use Symfony configuration environments
to define different values per deployment stage.
Studio-editable configurations (thumbnails, custom reports, static routes, perspectives,
document types, predefined properties, custom views, etc.) use the LocationAwareConfigRepository,
which supports two storage backends:
symfony-config- YAML files on the filesystem (default directory:var/config/). Suitable for version control and file-based deployment. In production without debug mode, these files are compiled into the Symfony container and are read-only - changes on disk have no effect until the cache is rebuilt.settings-store- Database-backed key-value storage. Allows runtime editing through Pimcore Studio in production.
Each configuration type has independent read and write targets, configurable per environment. See Configuration Environments for details on setting up read/write targets and handling production deployments.
Pimcore Class Definitions
Pimcore class definitions are stored as PHP configuration files and can be added to version control and deployed across stages.
The PHP configuration files and classes are written to var/classes by default.
To make a class read-only, create a copy at config/pimcore/classes.
The optional environment variable PIMCORE_CLASS_DEFINITION_WRITABLE controls write access:
0- Disallow all write access, including creation of new classes.1- Allow modification of all classes, including those inconfig/pimcore/classesthat are normally read-only.- Not set - Classes in
config/pimcore/classesare read-only; new classes are created invar/classes.
Use the environment variable PIMCORE_CLASS_DEFINITION_DIRECTORY to specify a custom directory
for class definitions instead of var/classes or config/pimcore/classes.
Changes to class definitions affect both configuration files and the database.
When deploying changes between stages, deploy database changes with
the pimcore:deployment:classes-rebuild command.
Run pimcore:deployment:classes-rebuild after every code update to push changes to the database:
bin/console pimcore:deployment:classes-rebuild
To update only the database structure without dumping classes to the file system:
bin/console pimcore:deployment:classes-rebuild --db-only
To create new classes from configuration files in the database:
bin/console pimcore:deployment:classes-rebuild --create-classes
If you use Composer's autoloader optimization, register newly created classes with:
composer dump-autoload --optimize
As an alternative, use the class export/import commands for JSON-based definitions:
bin/console pimcore:definition:import:objectbrick /brick_jsonfile_path.json
bin/console pimcore:definition:import:fieldcollection /collection_jsonfile_path.json
bin/console pimcore:definition:import:class /class_jsonfile_path.json
Pimcore Console
The Pimcore Console provides several useful commands for deployment. Integrate these into custom deployment workflows as needed.
Run bin/console list for a full list of available commands.
Useful Deployment Commands
| Command | Description |
|---|---|
| pimcore:mysql-tools | Optimize and warm up the MySQL database |
| pimcore:search-backend-reindex | Re-index the backend search (requires SimpleBackendSearchBundle) |
| pimcore:cache:clear | Clear Pimcore core caches |
| cache:clear | Clear Symfony caches |
| pimcore:cache:warming | Warm up caches |
| pimcore:classificationstore:delete-store | Delete a Classification Store |
| pimcore:definition:import:class | Import a class definition from a JSON export |
| pimcore:definition:import:customlayout | Import a custom layout definition from a JSON export |
| pimcore:definition:import:fieldcollection | Import a FieldCollection definition from a JSON export |
| pimcore:definition:import:objectbrick | Import an ObjectBrick definition from a JSON export |
| pimcore:definition:import:units | Import quantity value unit definitions from a JSON export |
| pimcore:deployment:classes-rebuild | Rebuild classes and database structure based on updated var/classes/definition_*.php files |
| pimcore:thumbnails:image | Generate image thumbnails. Use --processes for parallel processing. |
| pimcore:thumbnails:optimize-images | Optimize file size of all images in public/var/tmp |
| pimcore:thumbnails:video | Generate video thumbnails. Use --processes for parallel processing. |
Find more about the Pimcore Console on the dedicated page.
Content Migration
Pimcore does not provide content migration between environments and does not recommend it.
Create and manage content in the production environment. Control visibility with built-in features: publishing/unpublishing, versioning, scheduling, and editmode preview.
Editors should create and modify content on a single environment (typically production) rather than maintaining content across multiple stages.
If content migration is necessary, it is always a project-specific task depending on the data model, environments, and use cases. Use the PHP API for assets, objects, and documents.