Upgrade from 1.x to 2.x
A short and concise manual to help you upgrade your CMS Made Simple website to the latest 2.x release.
1. Preparations
- Check the servers PHP version before upgrade for PHP 5.4.11 or higher
- Create a back-up of files and database
- Upgrade CMSMS to version 1.12.2 »
- Perform all third party module upgrades.
- Clean/remove all unneeded templates and stylesheets
- Clean/remove all not used third party modules and plugins.
- Change Admin Theme to the core default OneEleven
2. Check third party plugins
Not all plugins are already updated by its developer to be compatible with CMSMS 2.x.
Check before upgrading this list: http://dev.cmsmadesimple.org/project/list_tagged/CMSMS-2
3. Smarty Scope
Smarty introduces the concept of 'scopes' in templates. This version of Smarty does not treat each and every variable as a global. This will solve problems with Smarty variables being inadvertently overwritten, but will cause problems with websites that rely on some global variables.
Formerly, you could create a variable in a module template (for example the News detail template could set a canonical variable) and then use that variable in another template, such as in the portion of your page template. Though this is still possible, an additional step is required.
Some examples:
Templates
Current
New
Or a bit shorter:
Current
New
Current
New
Current
New
Current
New
Or a bit shorter:
Current
New (only in CMSMS 2.x)
Stylesheets
Current
New
Current
New
4. The upgrade!
The maximum PHP version for 1.12.2 is 7.4. The minimum PHP version for 2.x (and the installer) may be higher than that, so you will likely need to switch PHP versions at this point. See Requirements for the current PHP requirements.
Now we have done preperations, we can start the real upgrade process!
- Create a new back-up of files and database.
- CHMOD config.php 644
- Download the latest cmsms-2.x.x-install.zip file and unzip it localy.
- Read the included readme.txt file for more information.
- Upload the installer file to the website root using the CMSMS File Manager.
- Perform the upgrade, by opening i.e. www.website.com/cmsms-2.x.x-install.php
- Remove the installer file...
5. Necessary follow-up actions and known issues
Smarty security setting
Syntax error in template "..." on line 1 "..." PHP function '...' not allowed by security setting.
Add to your config.php file:
This config variable loosens some of the security configuration for smarty templates. Particularly enabling this option allows the use of any PHP function as a Smarty plugin. You better not use this option if you are allowing content to be submitted for display on your website from untrusted sources! If a function works without this line, you better not add it!
Template names
During the upgrade the CMSMS Install Assistent might rename page and core module templates to ensure all names are unique.
In a few cases you need to change them at your website:
- If you use template names in module tags, i.e. {news summarytemplate='foobar'}
- In default page templates with template inheritance, i.e. {extends file='template:foobar'}