Photon Migration Command: cms:photon-convert
Overview
The cms:photon-convert
command permanently migrates a Classic CMS installation to the Photon platform. This process is irreversible and replaces a number of core files, configurations, database records, and themes. Any Classic frontend templates and stylesheets will be removed and replaced with the Origin theme.
This command is intended for clean production-ready environments and should not be executed without complete backups and testing.
warning
- One-Way Operation: There is no built-in rollback. You must restore from backup if anything fails or behaves unexpectedly.
- Loss of Custom Code: Any bespoke or extended functionality built into the Classic CMS core (e.g., custom themes, route overrides, legacy supplements) may be lost or rendered non-functional.
- File and Database Changes: Files will be modified and deleted; database entries will be truncated and restructured.
What the Command Does
1. Checks for Confirmation
- Prompts the user to confirm before proceeding.
- Exits early if the site is already using Photon.
- Exits early if any Galaxies sites are installed.
2. Modifies CMS Configuration
- Sets
photon_enabled
to1
inconfig/constants.xml
. - Disables XForms PHP calculations in
config/xfp/constants.xml
.
3. Updates Database Constants
- Enables slug generation (
USE_JADUSLUGS
). - Sets
READABLE_URLS_WORD_SEPARATOR
to-
. - Disables
XFP_LOAD_LANGUAGE_PACK_FROM_FILE
if previously enabled. - Updates the
USER_ADAPTER
constant to a Photon equivalent.
4. Rewrites Routes and Canonical URLs
- Truncates
JaduRoutes
and replaces with Photon equivalents. - Updates canonical URLs in
JaduCanonicalURL
to new Photon route names. - Regenerates slugs via scheduled task.
5. Overwrites .htaccess
Configuration
- Writes new
config/readable_urls.xml
.
6. Replaces Language Pack Entries
- Truncates
JaduLanguagePackEntries
and populates with Photon-compatible entries.
7. Overwrites Page Supplements
- Truncates
JaduPageSupplementLocations
and replaces with Photon equivalents. - Updates
JaduPageSupplements
to new Photon locations. - Installs any missing standard page supplements to
JaduPageSupplements
andJaduPageSupplementPublicCode
. - Removes incompatible entries from
JaduPageSupplementPublicCode
,JaduPageSupplements
,JaduPageSupplementCategories
, andJaduPageSupplementWidgets
.
8. Removes incompatible widgets
- Removes the Top FAQs widget if previously installed.
9. Modifies Bundle Configuration
- Overwrites
config/bundles.xml
to register Photon Symfony bundles.
10. Modifies Web.config
- Overwrites
public_html/Web.config
andpublic_html/blog/Web.config
for WISP.
11. Updates Apache VHost Templates
- Adds
%THEME_CONFIG%
placeholder tovhost.cfg
andvhost-ssl.cfg
.
12. Registers Themes
- Registers Photon-compatible themes (e.g.,
Origin
,Alpha
,Spectral
).
13. Sets the New Theme
- Replaces
config/frontend/config.yml
to activate theOrigin
theme.
14. Migrates Theme Settings
- Migrates logo, accent color, and other theme settings to Photon configuration.
15. Overwrites Stylesheets
- Deletes all existing stylesheets.
- Adds a default
standard.css
. - Clears styling from homepages and widgets.
16. Filesystem Cleanup
- Deletes any files and folders under
public_html
containing classic frontend templates. - Deletes any images in the
public_html/site/images
folder. - Deletes
config/galaxy/config.yml
andconfig/galaxy/security.yml
to remove any Symfony configuration for Galaxies.
17. Final Cleanup
- Clears cache.
- Regenerates
.htaccess
. - Restarts Apache (if supported on the environment).
Before You Run the Command
-
Ensure you have:
- A full file-system backup of your CMS.
- A SQL dump of the CMS database.
- An understanding of which components have been customised or extended.
- A tested backout plan.
-
Evaluate compatibility of:
- Custom stylesheets and themes.
- Route overrides and legacy PHP logic.
- Forms using PHP logic (these are disabled in Photon).
- Third-party integrations.
How to Run
php cli.php cms:photon-convert
You will be prompted:
Continue with this action (yes/no)? [No]:
Type yes to proceed.
After Migration
- Validate key site functionality:
- Homepage
- Navigation
- Login/account system
- Documents, Events, Directories, and supplements
- Reapply or refactor any required customisations using Photon’s extension points.