As TYPO3 9 LTS comes with many new features, upgrading is not quite as trivial as you might think at first. Because some things, from TypoScript to readable, "speaking" URLs, should be adapted for the new functions of TYPO3 9.
Using our sample project for TYPO3 8 LTS as an example, we show how an upgrade to TYPO3 9 LTS could be carried out.
But a note: this cannot be a generally valid guide for an upgrade. Depending on the installed extensions and individual TypoScript or TSConfig, completely different steps may be necessary to successfully perform an upgrade.
The instructions are not necessarily suitable for beginners and are aimed more at users who already have TYPO3 experience.
Prepare upgrade
The video explains how to update the TYPO3 reference index for large websites via the shell.
In our cloud hosting, different directory information is required for this:
/opt/alt/php74/usr/bin/php httpdocs/typo3cms/.....
If necessary, the PHP version must be adapted accordingly.
The following work should be carried out before the upgrade:
- Create a copy of the installation. Never perform an upgrade on the live website!
- Check whether all extensions used are available for TYPO3 9
- If necessary, deactivate incompatible extensions
- Update all active extensions to the latest version compatible with TYPO3 8
- Perform a "Database Compare" in the install tool
- Update the reference index
Carry out the upgrade
- For non-composer installations, adjust the symlink to the new TYPO3 core
- In the domain settings in the customer menu, switch to PHP 7.2 EXTENDED if necessary
- Call up the install tool
- Go through all points in the upgrade wizard
- Start the Database Analyzer and make any necessary adjustments to the database.
- Delete all caches
Although this is not necessary for our sample project, it may be necessary to replace the index.php in the document root for other installations.
The following code could then be used in index.php:
<?php
require __DIR__ . '/typo3_src/index.php';
Update extensions
All active extensions should now be updated to the latest version compatible with TYPO3 9.
Be sure to read the documentation of the extensions!
They often contain important information about the update. Templates or TypoScript instructions may change. Some extensions also have an update script in the extension manager or an upgrade wizard in the install tool to make the necessary changes after the update.
Customize URL routing
By default, TYPO3 9 LTS generates URLs without the .html extension.
However, if URLs with .html were used before the upgrade, it may make sense to adapt this in TYPO3 9 as well. After all, the "old" URLs are already listed in the index of various search engines.
With the following sample configuration, the URLs are all generated with .html. An adjustment for the "news" extension is also included so that readable URLs are also generated for news articles.
In addition, it is ensured that the call of "sitemap.xml" displays the new XML sitemap of the "SEO" system extension. The corresponding static TypoScript template must be integrated for this.
routeEnhancers:
NewsPlugin:
type: Extbase
extension: News
plugin: Pi1
routes:
-
routePath: '/{news_title}'
_controller: 'News::detail'
_arguments:
news_title: news
defaultController: 'News::detail'
aspects:
news_title:
type: PersistedAliasMapper
tableName: tx_news_domain_model_news
routeFieldName: path_segment
PageTypeSuffix:
type: PageType
default: .html
map:
'sitemap.xml': 1533906435
Corrections in the templates of the news extension
As we use a customized template for displaying the news on the start page in the sample project, a small adjustment must be made in this template.
As the spelling of the "default case" has changed in the switch-case view helper, this must be adapted accordingly.
New syntax for TypoScript Conditions
TypoScript conditions are now based on the Symfony Expression Language.
Although the old conditions can still be used in TYPO3 9, they will no longer work with TYPO3 10 and the new syntax should be used early on.
Note on indexed_search
In the sample project we use the system extension indexed_search. On the search results page, the search field, which is located in the header area of the page, is hidden there because the plugin displays it in the normal content area.
In order for this to work in TYPO3 9, a small change in the TypoScript is necessary. These steps can be seen in the video from around minute 9:20:
- Open the file typo3conf/ext/jwmusterprojekt8/Configuration/TypoScript/Setup/lib.search.ts
- Search for the line
lib.search > - Change/add the line as follows:
lib.search >
lib.search = TEXT
lib.search.value >
This adjustment is necessary due to a change in the TYPO3 core, the problem has already been reported: https: //forge.typo3.org/issues/87513
New file extensions for TypoScript and TSconfig files
The file extensions for TypoScript and TSconfig have been standardized and should be adapted.
TypoScript -> .typoscript
TSconfig -> .tsconfig
This is also relevant if you manually include files from system extensions.
In addition, the syntax for including TypoScript files has been greatly simplified.
cs_seo vs. seo
TYPO3 9 comes with its own SEO extension. Many functions that previously had to be retrofitted with third-party extensions are now included as standard.
In sample project 8, we supplied the cs_seo extension. Most of the functions are now covered by the new system extension. In this video, we show the differences between the two extensions. Whether an additional extension such as cs_seo or yoast_seo is necessary depends on the use case and should be decided on a project-by-project basis.
Adjusting the rights of the backend user groups
If backend users with restricted rights (editors) also work in the system, the rights of these user groups may need to be adjusted.
For example, a few adjustments are necessary for the new SEO extension if the new functions are also to be used by editors.
Editors must also have access to the "slug" field. Otherwise, this field remains empty when the editor creates a new page. This will of course not be found.
Clean up
If everything works after the upgrade, you should clean up the system a little. This includes, for example
- Delete unused extensions
- Carry out another database compare
- Switch to live mode in the "Configuration Presets"
Finally, if the new version is to go live under a different domain, the "Entry Point" must be adjusted in the Site Configuration!
This page contains automatically translated content.