02. HowTo: Upgrading from Localizer 1.10 to 3.x

Last modified: August 18, 2008 - 02:26

This document serves as an expanded version of the upgrade instructions found in the README.TXT file in the Localizer archive.

Before starting these procedures, make sure you have a working site with Drupal 5.x + Localizer 1.10. (The latest "stable" combination before Localizer 3.x is Drupal 5.5 + Localizer 1.10, though the last Localizer 1.x-dev could also be used.)

  1. Backup your Drupal database. Backing up the database is a minimum as Localizer 3.x will make some database changes. If you haven't backed up your whole site in some time, this is probably a good time to think about doing so--just in case.
  2. Download the various Localizer 3.x components. This includes Localizer itself, which can be found at http://drupal.org/project/localizer, and flag graphics which can be found at http://www.speedtech.it/drupal-localizer. Don't upload these archives to your server just yet.
  3. Login to your site as administrator (UID=1) and keep this browser window open. (This will be used to access the database update script a little later.) You may want to put your site in maintenance mode at this point.
  4. On your host, delete the old localizer directory that is currently under sites/all/modules/. To do this if you are using Cpanel on your host or a similar user interface, simply navigate to /sites/all/modules using File manager, and click on the localizer folder name, then from the menu choose Delete this folder and all files under it.
  5. The next thing to do is to get the main Localizer module (i.e. the localizer folder) complete with all sub-folders intact, into Drupal's /sites/all/modules folder on your server.

    If you are using Cpanel on your host or a similar user interface, you can simply navigate to /sites/all/modules using File manager and click "upload files". Then, upload the Localizer module archive (as of this writing the filename is localizer-5.x-3.0.tar.gz).

    Once it is uploaded, use File manager to extract the contents, and the localizer directory (i.e. /sites/all/modules/localizer) with all contents intact will be created.

    You should now have the localizer folder in Drupal's /sites/all/modules directory. Check to make sure the contents appear to be there.
    01CPanelSitesAllModulesLocalizer

    You may now delete the archive. (NOT the new folder created.)

    Next, upload the flags archive into /sites/all/modules/localizer by doing basically the same thing. Namely, navigate to /sites/all/modules/localizer using File manager and click "upload files". Then, upload the flags archive (as of this writing the filename is localizer-flags.tgz).

    Extract this archive.

    You should now have the flags folder in Drupal's /sites/all/modules/localizer directory. Check to make sure the contents appear to be there.

    000-2UploadingFlagsLocalizer3

    You may now delete the archive. (NOT the new folder created.)

    This completes the uploading process.

  6. If you have previously setup Localizer 1.x correctly, you will have appended the following code to the end of your sites/default/settings.php file:
    $conf= array
          (
              'cache_inc' =>
          'sites/all/modules/localizer/system/includes/cache.inc',
          );

    This code needs to be deleted. Using Cpanel's File manager, navigate to /sites/default. You should see the settings.php file there.

    Check the permissions. If they are set to 444 or other permission combination that will keep the file from being edited, then click on the file, and then from the menu that appears on the right, click Change Permissions. Change the permissions to 666. (We'll change them back soon.)


    Click on the file, and then from the menu that appears on the right, click Edit file. Scroll down to the end of the file, and delete the lines shown above.


    Now, append the following code to the end of your sites/default/settings.php file (just before the php closure ?> if you have one in your file).
       
           include_once('sites/all/modules/localizer/localizer_settings.php');

    Save the file. Then, in File manager, click on settings.php again but this time click on Show file. Scroll down to the bottom and check to make sure that the added line is there and the old code is gone.


    Assuming everything is there as it should be, change the permissions back to 444 by clicking on settings.php, and then from the menu that appears on the right, click Change Permissions. Refresh your screen once to check that the permissions have really changed.
    That concludes the editing of the settings.php file.
  7. 7. Next, in your open browser window, visit www.example.com/update.php to run the database update script.

    8. Once the database update has successfully completed, go to Administer > Site configuration > Localizer to configure Localizer's various options as you see fit. (You can refer to the documentation at http://drupal.org/node/119631 for more a more detailed explanation about Localizer options.)

    9. Under Administer > User management > Access control, be sure to enable (at a minimum) "access translations" under localizer module for each role that you want to be able to see translated content.
    002r2AccessControlLocalizer3

That's it. Remember to take your site back out of maintenance mode.

 
 

Drupal is a registered trademark of Dries Buytaert.