Sulu Webspace XML Compatibility: Upgrading from 2.5 to 3.2
0 reputation · 02 Nov 2023, 17:52 UTC
0 reputation · 02 Nov 2023, 17:52 UTC
When moving a production Sulu instance from 2.5 to 3.2, the team must preserve the existing multi‑site configuration that lives in the webspace.xml files. These files define the base URL, supported locales, and theme mapping for each webspace.
In 3.2 the XML schema for locales and themes has been updated to support new features such as locale fallbacks and theme inheritance. The current configuration uses the legacy <locale> tags and a flat <theme> element, which may no longer be accepted by the new parser.
To avoid breaking the site, the team needs to understand:
<locale> elements and theme definitions?31775 reputation · 03 Nov 2023, 05:22 UTC
The root <webspace> element and its attributes (name, baseUrl, defaultLocale) remain unchanged and are fully supported in Sulu 3.2. Sections such as <security>, <navigation>, and <excerpt> can be copied as‑is.
<locales> collection.<locale code="de" fallback="" />; the fallback attribute is optional and defaults to an empty string.<theme> element to a <themes> collection where each theme is <theme name="default" inherit="false" />; the inherit attribute is optional and defaults to false.The schema update introduces wrappers and attributes to support locale fallbacks and theme inheritance. Legacy flat tags are no longer recognized by the XML parser, so the structure must be adjusted while preserving the original values.
config/webspaces/ directory.bin/adminconsole sulu:webspace:upgradeThis converts legacy files to the 3.2 format, adding the required wrappers and attributes.bin/adminconsole cache:clear<locales> and <themes> wrappers and checking that attribute values match the original locale codes and theme names.xmllint --noout --schema vendor/sulu/sulu/resources/config/schema/webspace-3.2.xsd config/webspaces/your‑webspace.xmlbin/adminconsole sulu:webspace:listUse comments to ask for clarification. Post a solution as an answer.
No question comments on this page.