Feeds:
RSS
Atom
RDF

TYPO3 releases a new version every year or year and half. The system is not the smallest one and upgrading it may not the easiest task. In this article I want to show how to install TYPO3 with upgrades in mind.

Logically TYPO3 installation consists from two big parts: the core and site-specific files. The core is released by TYPO3 core team and it is not changing. Site-specific files is what web site owner creates in order to have a running web site under TYPO3 control. Inside the file system these parts should be seen as a single set of files.

The core is distributed as a compressed archive by TYPO3 core team. When new version is released, this part should be upgraded. However simply extracting files over existing installation is not the way to upgrade. Sometimes TYPO3 files change, so file can be removed, new files can appear. Extracting files to the existing location is not a good way to keep stable TYPO3 installation.

Ideally core files should stay as a package, separate from the site-specific files. Than core can be easily replaced independently from the rest of the site. But how to make the core separate and still keep the proper site structure?

Here is when symbolic links come to help. Assuming SuSE Linux, we can extract typo3_src‑4.2.0.tar.gz to the /srv/www:

/srv/www $ tar xzf  typo3_src‑4.2.0.tar.gz

This creates typo3_src‑4.2.0 directory. Now we create a symbolic link to this directory. The link will be named named typo3_src:

/srv/www $ ln -s typo3_src-4.2.0 typo3_src

When creating directory structure for the web site we should use index.php, t3lib/ and typo3/ from the typo3_src symbolic link. Later, if we decide to upgrade, we extract newer version into another directory and change a symlink. All directories get new TYPO3 core automatically!

But we could go even further! It makes sense to have another symlink inside web site's directory. By default it can be linked to the first symlink to share core files. If one specific site is not to be updated, this link can be easily set to the proper core directly. Easy and flexible!

Now let's see how we do it. Assuming that new web site is in web01/ directory:

/srv/www/ $ cd web01
/srv/www/web01/ $ ln -s ../typo3_src
/srv/www/web01/ $ ln -s typo3_src/t3lib
/srv/www/web01/ $ ln -s typo3_src/typo3
/srv/www/web01/ $ ln -s typo3_src/index.php

This is all we need to do to have an easily upgradable TYPO3 core. In the next article about upgrade we will talk how to actually perform a TYPO3 upgrade.

Like it? Then bookmark it! digg.comdel.icio.usgoogle.comMyLink.deYahooMyWebTechnoratiFurllive.comnetscapeTagThatWebnews

7 Comments

  1. on Monday, 02-06-08 16:42 Michael
    I would even go one step further and add one more symlink in between typo3_src and typo3_src-4.2.0:

    /srv/www/typo3/ $ ls -l
    lrwxr-xr-x 1 root root 15 May 31 19:29 typo3_src-4.2 -> typo3_src-4.2.0
    drwxr-xr-x 5 root root 1024 Apr 23 12:15 typo3_src-4.2.0
    /srv/www/ $ cd ../web01
    /srv/www/web01/ $ ln -s ../typo3/typo3_src-4.2

    This means that every site links to the currently used branch version.
    In case of a patch-level update, only this symlink must be changed and will immediately affect all sites using that particular branch.

    - michael
  2. on Tuesday, 03-06-08 10:38 Marcus
    My TYPO3 Sources are kept in a directory like typo3-tag-4_1_X or typo3-tag-4_2_X and are associated with the tag releases of TYPO3 SVN repository.
    Then upgrades are done by firing "svn update ..." within seconds.
  3. on Tuesday, 03-06-08 18:38 Marcus
    Uups, I made an error:
    replace "svn update ..." with "svn switch ..."!
  4. on Wednesday, 04-06-08 22:13 Dmitry Dulepov
    Well, I would use the officially released package...
  5. on Wednesday, 04-06-08 23:55 Marcus
    tag releases ARE offically released packages!
  6. on Thursday, 05-06-08 16:02 Benni
    Hey Michael,

    that's exactly how we do it on our servers as well, as it is (usually) quite harmless to update patch level versions.

    benni.
    -SDG-
  7. on Thursday, 12-06-08 15:09 Dmitry Dulepov
    Well, file are identical but "officially released" are those that can be downloaded.

    Updating may cause conflicts (not sure about switching). It has to be done at night because this process usually takes minutes (unlike changing symlinks (which is immediate).

    But I agree, this is also an option :) Why not? :)

Leave a Reply