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.
- 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_enabledto1inconfig/constants.xml. - Disables XForms PHP calculations in
config/xfp/constants.xml.
3. Updates Database Constants
- Enables slug generation (
USE_JADUSLUGS). - Sets
READABLE_URLS_WORD_SEPARATORto-. - Disables
XFP_LOAD_LANGUAGE_PACK_FROM_FILEif previously enabled. - Updates the
USER_ADAPTERconstant to a Photon equivalent.
4. Rewrites Routes and Canonical URLs
- Truncates
JaduRoutesand replaces with Photon equivalents. - Updates canonical URLs in
JaduCanonicalURLto 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
JaduLanguagePackEntriesand populates with Photon-compatible entries.
7. Overwrites Page Supplements
- Truncates
JaduPageSupplementLocationsand replaces with Photon equivalents. - Updates
JaduPageSupplementsto new Photon locations. - Installs any missing standard page supplements to
JaduPageSupplementsandJaduPageSupplementPublicCode. - 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.xmlto register Photon Symfony bundles.
10. Modifies Web.config
- Overwrites
public_html/Web.configandpublic_html/blog/Web.configfor WISP.
11. Updates Apache VHost Templates
- Adds
%THEME_CONFIG%placeholder tovhost.cfgandvhost-ssl.cfg.
12. Registers Themes
- Registers Photon-compatible themes (e.g.,
Origin,Alpha,Spectral).
13. Sets the New Theme
- Replaces
config/frontend/config.ymlto activate theOrigintheme.
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_htmlcontaining classic frontend templates. - Deletes any images in the
public_html/site/imagesfolder. - Deletes
config/galaxy/config.ymlandconfig/galaxy/security.ymlto 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
After running the conversion command, you will need to register the theme resources with the application if this has not been done before. To do this:
For LAMP Systems If your system is running on a LAMP stack, reload the Apache service to apply the changes:
sudo systemctl reload httpd
For WISP Systems
If your system is running on a WISP stack, run the Lightmatter Powershell script var\iis\iis_config_updater.ps1 as Administrator and adjust the Jadu InstallPath to suit. Note: this script returns no confirmation output.
Powershell.exe -File C:\inetpub\wwwroot\jadu\var\iis\iis_config_updater.ps1
Then clear and warm the Frontend Cache:
For LAMP Systems
sudo -u jadu-www /usr/bin/php -d memory_limit=-1 /var/www/jadu/cli.php \
cache:clear --kernel=frontend
sudo -u jadu-www /usr/bin/php -d memory_limit=-1 /var/www/jadu/cli.php \
cache:warmup --kernel=frontend
For WISP Systems
Run as Administrator and adjust the Jadu InstallPath to suit.
php -d memory_limit=-1 C:\inetpub\wwwroot\jadu\cli.php cms:clear-cache --kernel=frontend
php -d memory_limit=-1 C:\inetpub\wwwroot\jadu\cli.php cache:warmup --kernel=frontend
Your site should now be using the Origin theme.
Force the site routes to be repulished by toggling Readable URLs on and off in Settings.
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.