typo3typo3-6.2.xtypo3-4.5

How to upgrade TYPO3 4.5 to 6.2


What are the recommended steps to upgrade TYPO3 4.5 (or 6.1) to 6.2? I have a mac and my site is running on a shared Linux account.


Solution

  • Here's a step by step guide from my upgrading practice which I would like to share. Thanks for the guide on https://jweiland.net/typo3/vortraege/typo3camp-berlin-2014.html that has helped me a lot.

    Note that these are my personal experiences which may or may not apply to your environment. Treat everything carefully.

    I differentiate between "Quick" and "Long" upgrades. With "Long" upgrades, you do the upgrading twice. First, you upgrade a copy of the live site, get all extensions and templates working, and when you're ready, you declare the content freeze, re-doing the upgrade, using the files modified in the first step. For a "Quick" upgrade, you declare a content freeze right away, do the upgrade and tests, and then deploy to the test or live environment directly.

    Set up the site locally

    Hint: Work locally. I can only refer to using MAMP Pro (be sure to get the pro version) on a mac. Always be aware on which site (and with which DB) you are working, btw! And attention: OS X file system is case insensitve, which can be a bummer when deploying to Linux (see below). For the database administration, I prefer http://www.sequelpro.com/ to phpMyAdmin for most tasks. It's very handy to make backups or to quickly browse tables, although it has a few missing features in comparison with phpMyAdmin. It is also extremely reliable for importing dbs onto a live server - where phpMyAdmin can stall often.

    Hint: If you're working on MAMP, you'll have to chown all the files (except templates and config files of your apps (like Sublime)) to _www:_www. I have found it useful to define some aliases for the sudo chown in ~/.bash_profile, like alias chownmamp="sudo chown -R _www:_www ." and vice versa to your own user. Another possibility might be to temporarily chmod 777 everything - when deploying, taking extra care this is removed (find . -type f -exec chmod 644 {} \;find . -type d -exec chmod 755 {} \;)

    Hint: If you use different hostnames for your local and the live site, replace them where needed. For the command line, I have found grep -rl 'www.site.ch' ./ | xargs sed -i 's/www.site.ch/www.localsite.dev/g' useful. But of course you can do that in your IDE or editor too. Don't forget to check realurl_conf.php and .htaccess too. For a quick run, it is also possible to use the real hostnames, so you don't have to replace anything (but won't be able to compare sites from the same machine).

    Hint: On MAMP, I've had issues with $TYPO3_CONF_VARS['BE']['warning_email_addr'] which prevented logging into the install tool with an error 500, as it couldn't sent the email. Remove that setting in localconf.php for the local upgrade if it happens.

    Prep the upgrade

    Hint: with FAL, the _cli_scheduler user needs rights for every file mount you want to index with ke_search, else the indexing via scheduler will fail.

    Do the upgrade

    Hint: don't be too eager with APC, the availability check in 6.2 isn't perfect, cf. https://forge.typo3.org/issues/64030 (you can't use it if your shared hosting relies on suPHP).

    Hint: If something doesn't seem to be complete after all wizards went through, you can re-enable the upgrade wizards in LocalConfiguration.php under ['INSTALL']['wizardDone']. (Like if the whole sys_file_reference table empty and there are no images in tt_content table - remove the line for TceformsUpdateWizard, so it can run again).

    Hint: Check typo3conf/AdditionalConfiguration.php and make sure there are no values in it that override values from LocalConfiguration.php. I've had this on a 6.1->6.2 upgrade, and thus was unable to enable error logs (the devIPmask was overridden all the time).

    Hint: here are a few occasional replacements I had to make for 6.2 compatibility:

    require_once(PATH_tslib . 'class.tslib_pibase.php‘);
    -> if (!class_exists('tslib_pibase')) require_once(PATH_tslib . 'class.tslib_pibase.php');
    
    require_once(PATH_t3lib . 'class.t3lib_scbase.php‘);
    -> require_once(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('backend'). 'Classes/Module/BaseScriptClass.php‘);
    
    t3lib_div::GPvar()
    -> \TYPO3\CMS\Core\Utility\GeneralUtility::_GP()
    
    mysql_num_rows($res)
    -> GLOBALS['TYPO3_DB']->sql_num_rows($res)
    
    t3lib_div::intInRange
    -> t3lib_utility_Math::forceIntegerInRange
    
    t3lib_div::view_array()
    -> t3lib_utility_Debug::viewArray 
    
    t3lib_div::testInt
    -> t3lib_utility_Math::canBeInterpretedAsInteger
    

    EDIT: a much more comprehensive list is on https://github.com/FriendsOfTYPO3/compatibility6/blob/master/Migrations/Code/ClassAliasMap.php

    Hint: In the last case, take care, to select the page template in accordance to the selected BE Layout, never use .if, always use CASE. See With TYPO3 be_layout, how to choose frontend template correctly (performance-wise)?

    Hint: Btw, extensions I use on all sites: realurl_clearcache, nc_staticfilecache, sourceopt, ke_search. On most sites (feature-based), of course: news, powermail.

    Hint: Also make sure that the "page tree rights" group is properly set up, cf http://typo3.uni-koeln.de/typo3-admin-access-default.html?&L=0

    Hint: Here's a snippet I add to all user's userTSConfig.

    Test and deploy