5.5 KiB
title | summary |
---|---|
Migrating off CWP | Migrate your project off the Common Web Platform v2 |
Migrate your project off the Common Web Platform v2
Until November 2021, Silverstripe Ltd maintained a specialised version of the Silverstripe CMS project for the New Zealand Government and related New Zealand public-sector agencies. This version was called Common Web Platform (CWP for short).
The CWP CMS release has been discontinued. CWP projects who wish to continue to receive updates must migrate their code base off the latest CWP release back to the regular Silverstripe CMS release.
Steps to migrate away from CWP
Before you begin this process you must identify which version of Silverstripe CMS Recipe you want to upgrade to. You can upgrade to Silverstripe CMS Recipe 4.9.0 or greater.
Review the changelog list to choose the Silverstripe CMS Recipe version you wish to upgrade to. Read the changelog carefully. It may contain additional release specific upgrade guidance beyond the steps in this guide.
- If your current composer file contains
cwp/cwp-installer
, runcomposer update-recipe cwp/cwp-installer
to inline the recipe. - If your current composer file contains
cwp/cwp-recipe-cms
, runcomposer update-recipe cwp/cwp-recipe-cms
to inline the recipe. - If your current composer file contains
cwp/cwp-recipe-core
, replace it withsilverstripe/recipe-ccl
. - If your current composer file contains
cwp/cwp-recipe-search
, replace it withsilverstripe/recipe-solr-search
. - Review all your composer requirements and update the constraints so the module versions documented in the changelog for you desired Silverstripe CMS Recipe release are installable.
- Run a
composer update
to get the lastest tag of each module.
The silverstripe/recipe-solr-search
and silverstripe/recipe-ccl
release versions follow the same numbering scheme as the recipes they superseded:
- the last release version of
cwp/cwp-recipe-search
andcwp/cwp-recipe-core
is 2.8.0 - the first release version of
silverstripe/recipe-solr-search
andsilverstripe/recipe-ccl
is 2.9.0.
Optional clean-up step
composer update-recipe
adds some superfluous data to your composer.json
file. You may remove the following entries from your composer file:
extra.project-dependencies-installed
and all the underlying entries- all the
cwp
entries under theprovide
key.
Once you've completed the clean up, you should run a composer update
to sync up your changes in the composer.lock
file.
Questions
What constraint should I use in my requirement version?
That really depends on how comfortable your organisiation is with automatically applying updates to your Silverstripe CMS project.
The three broad constraint categories you can use are, in descending order of restrictiveness:
- exact version which forces composer to install the exact version of a package (e.g.:
"silverstripe/userforms: "5.9.0"
) - tilde constraint which allows composer to install a later version of a package within the same minor release line (e.g.:
"silverstripe/userforms: "~5.9.2"
will allow composer to install the5.9.2
or5.9.3
releases, but not the5.10.0
or5.9.1
ones) - caret constraint which allows composer to install a later version of a package within the same major release line (e.g.:
"silverstripe/userforms: "^5.9.2"
will allow composer to install the5.9.3
or5.10.0
releases, but not the6.0.0
one).
The tilde constraint is a suitable default and is the constraint style that ships in the silverstripe/installer
.
Read Next Significant Release Operators in the composer documentation for more information version constraint operators.
What if I get a conflict when running composer update?
Composer normally tells you which packages are in conflict. You can try using the --with-all-dependencies
flag and allow composer upgrade or downgrade other dependencies to resolve conflicts:
composer update --with-all-dependencies
If the --with-all-dependencies
flag doesn't fix the problem, carefully read the composer error message and try to identify which constraints need to be updated to resolve to an installable set of dependencies.
What happens if I do not migrate off the CWP CMS recipes?
The CWP CMS recipes have been archived, but existing versions will remain installable for the indefinite future. No new versions of the CWP CMS recipes will be tagged. The CWP CMS recipes are in lockstep with exact versions of various Silverstripe CMS modules. This means you will not be able to upgrade to any Silverstripe CMS Recipes beyond the 4.8 release.
Your project will still work, but will not receive any bug fixes, security fixes or new features that ship in later releases.
What if my project is still using CWP 1?
Read the Upgrading to Silverstripe CMS 4 guide first.
Once you've completed the Upgrade your dependencies step, follow the directions in this guide to remove all the legacy CWP CMS recipes.
Is there a way to create a new project that would require all the modules a CWP project would have?
There's no officially supported alternative to the cwp/cwp-installer
module. There's nothing stopping you from creating a new project using cwp/cwp-installer
as a baseline and then inlining the CWP CMS recipes using the steps outlined in this guide.
However, your project will not be following the most up-to-date best practices if you use this approach.