Chapter 66. Upgrading PHP-Nuke


New versions of PHP-Nuke are released every few months. Generally, each new version introduces one or two major new features, a bunch of bug fixes and minor improvements, and so forth. Old, unused modules may be removed, while newer modules are added.

By the Way

When you upgrade to a new version, your modules never disappear. So if you're using the WebMail module, which isn't included in new versions of PHP-Nuke, that module will continue to exist after the upgrade. The upgrade simply won't fix any bugs or anything that may be present in the module, but the old version of the module will continue to work.


Because upgrading your site can be a major undertakinghundred of files have to be uploaded to your site, for exampleyou probably won't upgrade to every new version. Personally, I wait about every three to four versions to upgrade, unless there's some killer new feature that I just have to have on my site.

The upgrade process is pretty simple. First, back up your site and its database. If I could print just one thing in giant red, blinking text with hooting alarms, that'd be it. Use any means at your disposal to back up the site's files. If you're hosting your own server, it'll be easy; if you're using a hosting service, try software like BatchFTP (www.batchftp.com) to download all of your site's files onto your local computer. Back up your database, too, using either PHP-Nuke's built-in routines for doing so or other means provided by your hosting service. Topic 43, "Backing Up Your Site and Database," addresses backup procedures in more detail.

I'm really not kidding. Don't even read any further until you've got a backup. Seriously.

Second, you need to get the new version's files onto your Web server (download the new version from www.phpnuke.org). You backed up the old files, right? Okay. If you host your own server, you can usually decompress the new version of PHP-Nuke right onto your Web server. Versions are typically distributed in ZIP files, which can be decompressed into the individual files quite easilyconsult your system documentation for details on doing so. If you're hosting your site with a service provider, you will probably need to download the ZIP file to your local computer and extract it there. Use a program like WinZIP (www.winzip.com) to extract the ZIP file into its individual files; on Windows XP and higher, simply right-click the ZIP file and select the Extract option from the pop-up menu.

The ZIP file expands into a set of subfolders: Only the ones named HTML and Upgrade need to be copied to your Web site. The HTML subfolder actually contains the new PHP-Nuke version: the Modules folder, the Admin folder, the Blocks folder, and so forth. Use a program like BatchFTP to copy these up to your Web site. The Upgrade folder should be uploaded to your server as well and placed into the top-level folder.

Next, you need to upgrade your database. To do so, run every upgrade script that's applicable. So, if you're currently on version 6.9 of PHP-Nuke and you're upgrading to version 7.3, you'll run these scripts in this order:

  1. upgrade69-70.php

  2. upgrade70-71.php

  3. upgrade71-72.php

  4. upgrade72-73.php

To run the script, just provide the correct path to it in a Web browser: www.yoursite.com/upgrade/7.x/upgrade72-73.php, for example. Run each upgrade script in order to apply the necessary database changes. Figure 66.1 shows the folder structure PHP-Nuke uses for the upgrade scripts.

Figure 66.1. Upgrade scripts for PHP-Nuke.


Finallyand this is really importantdelete the entire Upgrade folder from your Web site. Once the upgrade is complete, it doesn't need to be there, and it could present a security risk for it to remain on your sitesomeone else could run those scripts and mess up your database something fierce.

So those are the basic steps: back up, copy files, run upgrade scripts, delete upgrade scripts. Then, of course, you'll want to test your site to make sure everything's working properly. Deactivate any new modules you don't want to use (or don't have time to set up right now), and you should be ready to go.



    PHP-Nuke Garage
    PHP-Nuke Garage
    ISBN: 0131855166
    EAN: 2147483647
    Year: 2006
    Pages: 235
    Authors: Don Jones

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net