Developer

Upgrading AWF 1.04 from previous versions

Upgrading to AWF version 1.04 from previous versions isn't the easiest thing to do. But by creating a second instance of AWF on your server, you can make the upgrade run more smoothly.


Adaptive Web site Framework (AWF) is an amazingly powerful tool that helps administrators create and administer dynamic Web sites quickly and cheaply. Recently, Liquid Bytes released an update to AWF. If you’ve already deployed AWF, you might find that upgrading to the latest version is a real hassle. Here’s how to more easily upgrade to AWF 1.04.

Author’s Note
For more information about AWF, see the Daily Drill Down “AWF: Create news/Web portals with this amazing Web foundry.” That article will show you how to get a site up and running with AWF version 1.0. For a complete list of what the newest version offers, visit the AWF Official Web site. For the purposes of this article, I’ll be upgrading from AWF 1.0 to 1.04 on a Red Hat 7.3 server. Don’t panic if you’re running a different version of Linux. These techniques will work for you too.

In this example, AWF 1.0 is located in the /var/www/html/awf directory. I’ll install AWF 1.04 to the /var/www/html/awf2. Finally, I’ve named the AWF 1.04 database awf_new.


Not such an easy task
Upgrading to AWF is not a simple feat. After a week’s worth of hacking and little sleep, I managed to get my site running with 1.04 and lived to tell the tale. Hopefully, my trials and tribulations will help you avoid most of the stress of the upgrade.

Now, my site isn't huge like Slashdot. It gets an average of three- to five-thousand hits a day. Nothing heart stopping, but I do have a good amount of regular readers and bringing the site down was not an option. I had, at one point, thought about just starting from scratch—even down to reinstalling the server. Unfortunately, because I was also running Mailman, a chat, and a few other services, I realized that an upgrade was my only solution. So I set out to migrate from AWF 1.00 to 1.04.

Simply put, the easiest way to upgrade AWF is to create a second instance of AWF and then configure it to your needs. Afterwards, you can delete the old version.

Setting up a second instance
Begin by downloading AWF 1.04 from Liquid Bytes. Don’t extract the awf-1.04.tar.gz right away. Before you make a serious mistake and untar the file into /var/www/html, thus overwriting your current working installation, back up your current installation. You can do so using the tar cfz awf_backup.tgz awf/ command. Move the resulting tgz file into another directory.

Next, copy the awf-1.04.tar.gz file to the /usr/local/src/ directory. Unpack the file using the tar xvzf awf-1.04.tar.gz command. Unpacking this file will create the new directory called awf. Move this new awf directory into /var/www/html and rename it awf2 with the mv awf /var/www/html/awf2 command.

With this new directory in place, you can move onto the standard AWF installation. To start it, start the browser on your system and point it to awf2/admin/setup.php. The installation routine for AWF 1.04 is identical to AWF 1.0, so you can refer to the Daily Drill Down I mentioned above for detailed information about how to run the installation.

After the second instance of AWF installs, configure it to match your first installation. Once you have both instances configured identically, you can migrate the AWF 1.0 database to AWF 1.04.

Here’s where one of the gotchas may kick in. The structure of the database used by AWF changed from 1.00 to 1.04. The change revolves around two fields (created and last_changed) that were part of the pre-1.02 databases. You can overcome these problems by doing the following:
  • Copy the backup of the database awf (named awf.tgz) to /tmp.
  • Change to the /tmp directory.
  • Unpack the awf.tgz file, which will result in the creation of the awf directory.
  • Move the new awf directory back into /var/lib/mysql/ and rename it awf_new. This will overwrite the current awf_new directory. You can do this by using the mv awf /var/lib/mysql/awf_new command.

The awf_new database has the same data as the original awf database. But when browsing to your awf2 installation, things won't look the same. Instead of having the clean look that you had before, the fonts will be too large, bitmappy, and just plain ugly. This error is due the CSS files not being read properly. This occurs because AWF thinks it's still looking at an older database. To resolve this issue, simply rerun the setup.php routine from the awf2 installation. Once you run the setup.php again, things will start looking the same.

Making the move
Now it's time to migrate the second instance of AWF over to the old installation. To do this, move the original installation of AWF to an awf_old command by using the mv awf awf_old command. With awf out of the way, use the mv awf2 awf command to move the second installation to the original installation.

After the second installation is residing in the original version’s directory, you must rerun the setup.php, this time from the awf directory. Reconfigure the direct path as /var/www/html/awf. With that final step complete, you should now have a working, updated version of your AWF site running smoothly.

Final touches
Remember to reapply any security you might have created for the awf/admin/ directory. You will also want to just peek through the site a bit to make sure nothing strange has happened. There is at least one haunting issue that won't go away on my site. When adding or updating content, any text entered in the text area disappears when Save is clicked. To get around this I just click the Turn Edit Mode Off button and then click it again and the text returns.

Also make sure that all your permissions are the same in the new instance of AWF. This was an issue with my install, and I wound up having to check and recheck all permissions within the subdirectories before everything went live.

About Jack Wallen

Jack Wallen is an award-winning writer for TechRepublic and Linux.com. He’s an avid promoter of open source and the voice of The Android Expert. For more news about Jack Wallen, visit his website jackwallen.com.

Editor's Picks

Free Newsletters, In your Inbox