[TYPO3-english] No template found after conversion to UTF8...

Andrew Plank plankmeister_NO at SPAM_hotmail.com
Wed Feb 18 11:45:14 CET 2009


Hi conversion-to-UTF8 experts!

I'm starting a project to move a whole bunch of Typo3 sites spread 
across different physical servers to a single server. Nearly all of the 
sites in question are Typo3 4.1.6, and 100% of them are running on a 
latin1 database.

On the new server (which is already running 10s of Typo3 4.2.1 sites on 
a UTF8 database) we don't have shell access, and we have rather limited 
permissions in Plesk, so that it's not possible to modify my.cnf or 
php.ini etc. We only have the luxury of modifying .htaccess files. Also, 
the local shared copy of Typo3 is 4.2.1; 4.1.6 is not available as 
shared source. Rather than use 100s of MB of disk space copying the 
4.1.6 source to each new hosting account, I simply use symlinks which 
point to the 4.2.1 source.

So I started with a test site. Created the hosting account, created the 
symlinks for t3lib and typo3, copied via ftp the fileadmin, typo3conf, 
and uploads folders from the "old" site to the "new" site. Edited 
localconf.php and added the following lines at the end:

$TYPO3_CONF_VARS['BE']['forceCharset'] = 'utf-8';
$TYPO3_CONF_VARS['SYS']['setDBinit'] = "SET NAMES utf8;\nSET CHARACTER 
SET utf8;\nSET SESSION character_set_server=utf8;";
$TYPO3_CONF_VARS['SYS']['UTF8filesystem'] = '1';

Then, using phpMyAdmin, I exported the "old" database, used the linux 
"iconv" tool to convert the exported SQL script from iso-8859-1 to UTF8. 
I then appended "DEFAULT CHARSET=utf8" to each "CREATE TABLE" statement, 
and imported this modified SQL script to the "new" site's database using 
phpMyAdmin.

So far so good. In theory, I have a 100% clone of the "old" site now on 
the new server, with the exception that the Typo3 source is 4.2.1 
instead of 4.1.6.

So... I log in to the "new" site, and using the install tool, change the 
compat mode to 4.2, and run the "compare" function in the "database 
analyzer" tool. I end up with a database that matches the various SQL 
files (that is... it reports no differences). I noticed that the 
sys.template table doesn't get imported correctly, because of the BLOB 
column types, so I manually exported the contents from the "old" 
database using a custom PHP script, and updated the correct values in 
the "new" database. This update was confirmed, as looking in the BE, I 
can see the setup and constant fields now correctly contain UTF8 
characters, and are not truncated - as was happening before. I also 
upgraded a few extensions that were causing problems (the error log was 
most helpful!). Clicking around in the BE, I can see that all UTF8 
characters are being displayed 100% correctly, and it appears as though 
the upgrade and conversion has been 100% successful....

So - now I clear all caches, and hit the site's front end. Everything 
looks beautiful! Just as it should! I click all the links, everything's 
working, even tt_news and sr_email_subscribe.

So I move on to the next site. And the next. And the next... 5 in all. 
And then I find a problem; When refreshing the current page with F5, or 
when hitting a page that has already been cached, I get the dreaded "No 
template found!" error.

I Googled a lot, and found a few hints. One was regarding the correct TS 
call for TV (->main_page instead of ->main) but this checks out fine. 
The other was that the database may contain columns of a different 
character set. I've exhaustively checked this, but all tables and 
columns are in UTF8 format.

Can anyone point me in the right direction? Hopefully it's something 
banal that I've overlooked...

Many thanks in advance,

Andrew Plank.









More information about the TYPO3-english mailing list