Symfony applications and Exponential
A custom Symfony application keeps its content in Doctrine entities (or another store) and renders it with Twig. Moving it to Exponential is a content migration from your own database; staying on Symfony while gaining a content repository is a choice of Exponential Platform distribution.
Migration hub · Checklist · Mapping · Tools
1. First decide: Exponential 6, or a Symfony-based Exponential Platform
| Your team and app | Target |
|---|---|
| The app is mostly content (pages, articles, media); the team accepts TPL and INI | Exponential 6, this guide |
| The team wants to stay on Symfony and Twig, and needs a content repository | Exponential Platform DXP (Symfony 7.4) or Nexus |
| Both: Symfony controllers for the app, the legacy admin and TPL for content | Platform Legacy |
| The app has business logic beyond content (bookings, accounts) | keep the app; move only its content, and link the two (REST, shared sign-in) |
2. From a Symfony application to Exponential 6
- Map the entities: each content-like entity becomes a class; its columns attributes; Doctrine relations object relations or tree positions; files (VichUploader, Flysystem, plain paths) image or file objects (mapping).
- Export from the app itself: a Symfony console command in the app that loads the entities through Doctrine
(in batches, clearing the entity manager between batches) and writes JSON rows with remote ids
(
app-<entity>-<id>), the rendered or raw rich text, and the route of each item (from the router, so the old addresses are exact). - Import on the Exponential server with the script skeleton or xrowextract's importer.
- Twig to TPL: the templates are rewritten; 17.5 maps the constructs.
- Users: Symfony's
PasswordHasherwith theauto,bcryptorsodiumalgorithms writes standard PHPpassword_hash()values ($2y$...,$argon2id$...), which Exponential can verify as type 7 (mapping, 6); test with a few accounts. Other hashers mean resets. - Routes: every route that served content becomes a node alias or a redirect.
3. Running a Symfony app next to Exponential
When the app keeps its non-content features:
- Serve both under one domain with the web server routing paths to each, or on subdomains.
- Let the app read content from Exponential over REST with a personal API key (REST API v1 and v2).
- Sign-in: keep them separate, or use the same identity provider for both.
4. From Exponential to a Symfony application
Export with xrowextract to JSON (leaving Exponential) and load it with a Doctrine command; or, for a Symfony team, move to an Exponential Platform distribution of the same content model, which keeps the content repository and its tooling.
5. Checklist
- To do: Target chosen (Exponential 6, DXP, Nexus, Platform Legacy, or app plus content site).
- To do: Entity mapping written; export command in the app; routes exported from the router.
- To do: Imported with remote ids; templates rewritten; password hashes tested.
- To do: Redirects for every content route; REST access for the remaining app.
Become an Exponential Partner
Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.
This page is part of the Exponential documentation and is free documentation under the GNU Free Documentation License 1.3 or any later version (the license of this documentation).