Maintaining, Optimizing and Upgrading Your Site in Drupal 6: Part 2

Exclusive offer: get 50% off this eBook here
Drupal 6 Site Builder Solutions

Drupal 6 Site Builder Solutions — Save 50%

Build powerful website features for your business and connect to your customers through blogs, product catalogs, newsletters, and maps

$26.99    $13.50
by Mark Noble | August 2009 | Drupal Open Source

This is the second part of the two-part article by Mark Noble. In the previous part, we saw how to create website backups and optimize our website. In this part, we will discuss how to maintain the content and upgrade to new versions of Drupal.

Maintaining content

As you continue to add content to your web site, you will need to ensure that your content is properly moderated, that old content is removed, and that changes to web site content are tracked.

Creating content revisions

Good Eatin' Goal: Create revisions of content to ensure that you have a complete record of changes to your web site's content.

Additional modules needed: None.

Basic steps

We have simply updated our pages as necessary to add new functionality and content. However, if you have many editors, content that changes frequently, a need to view the history of a page, or need the ability to easily return to an old version of a page, you will want to store multiple revisions of your pages.

To do this, carry out the following steps:

  1. Edit the content for which you want to create a new revision.
  2. Make the changes as needed and, before saving, expand the Revision information section.
  3. Maintaining, Optimizing and Upgrading Your Site in Drupal 6: Part 2

  4. Select the Create new revision option and enter a message describing the changes that you have made to the node.
  5. When you save the content, you will see a new tab called Revisions. Clicking on this tab will show you a list of all of the revisions that have been created for the page.
  6. Maintaining, Optimizing and Upgrading Your Site in Drupal 6: Part 2

  7. If you would like to return to an older version of the page, you can click the revert link. Or, if you want to remove an older revision, you can click the delete link to get rid of it permanently.
  8. You can control which users have access to the revision system by using the Permissions Manager. Drupal allows you to control which users can: view revisions, revert revisions, and delete revisions.
  9. If you want to force users to always create new revisions when editing content, edit the content type and then expand the Workflow settings.
  10. Maintaining, Optimizing and Upgrading Your Site in Drupal 6: Part 2

  11. Change the default options to select the Create new revision option. When editors change content, the Create new revision option will be selected by default, and they will not be able to change the option unless they have the administer nodes permission.
  12. If you want to approve all revisions before publication, you can deselect the Published checkbox.

Comparing content revisions

Good Eatin' Goal: Compare the text of two different revisions of a page.

Additional modules needed: Diff (http://drupal.org/project/diff).

Basic steps

Although the built-in functionality for creating revisions in Drupal works perfectly well, it can be difficult to review the changes that were made in each revision. The Diff module makes comparing revisions very easy.

  1. Begin by installing and activating the Diff module.
  2. To use the Diff module, simply view the revisions for any page. You will notice that the Revisions list has changed to allow you to select the revisions to be compared.
  3. Maintaining, Optimizing and Upgrading Your Site in Drupal 6: Part 2

  4. Select the revisions to compare and then click on the Show diff button. Drupal will then display information about the text that has been changed, added, or deleted.
  5. Maintaining, Optimizing and Upgrading Your Site in Drupal 6: Part 2

Moderate content

Good Eatin' Goal: Find questionable or offensive content, and remove it from your site, easily.

Additional modules needed: Modr8 (http://drupal.org/project/modr8).

Basic steps

An unfortunate side effect of having a web site on the Internet is that, at some point, a malicious user will attempt to post inappropriate content on your site. If your site is extremely busy, you may find yourself with a large amount of content to review and approve.

The Modr8 module can help you manage the workload and can send emails to users letting them know when their content has been approved or rejected.

  1. Begin by installing and activating the Modr8 module.
  2. The settings for the Modr8 module can be accessed by selecting Site configuration and then Modr8, from the Administer menu.
  3. The basic settings control how often logs are removed. Alternatively, you can choose to keep the logs forever. You can also change the number of items in the moderation queue to be displayed at a time, as well as the default action for the content that requires moderation.
  4. Maintaining, Optimizing and Upgrading Your Site in Drupal 6: Part 2

  5. You can also configure the email settings for the moderation queue, including the text of the emails, and whether or not emails should be sent to the user who posted the content when their content is approved and/or when their content is rejected. You can also choose to send an email if the moderator does not take action for the item and wants to send a note to the author.
  6. Maintaining, Optimizing and Upgrading Your Site in Drupal 6: Part 2

  7. If you would like new content to be added to the moderation queue automatically, you can edit the content type and select the In moderation queue setting in the workflow section.
  8. To view the moderation queue, select Content management and then Moderated content, from the Administer menu.
  9. The moderation queue appears as follows:
  10. Maintaining, Optimizing and Upgrading Your Site in Drupal 6: Part 2

  11. From this page, you can approve, delete, or defer action on any content that needs moderation. After you make your changes, click Save to complete your selections. You can also display a log of all the moderation actions, by clicking on Reports and then Content moderation log. The moderation log appears as follows:
  12. Maintaining, Optimizing and Upgrading Your Site in Drupal 6: Part 2

Allowing users to report questionable or offensive content.

Good Eatin' Goal: Get feedback from users to learn what they find offensive so the objectionable content can be removed.

Additional modules needed: Abuse (http://drupal.org/project/abuse).

Basic steps

In the last task, we reviewed methods that allowed you to moderate every piece of content that is added to the site. However, this can be a time-intensive task if the proportion of content that you receive that is questionable is low. If this is the case, you can allow your users to help you to moderate the content by using the Abuse module, to let them report items that they find offensive.

This strategy has a couple of advantages. Firstly, you are freed from the maintenance of pre-approving all content before it is published. Secondly, it ensures that the content meets community standards, rather than placing you or your editors in charge of defining community standards.

The Abuse module also has a Watchlist component that allows you to flag content as suspicious or banned, and automatically move them into a queue for review by an administrator.

  1. Begin by downloading and installing the Abuse and Watchlist modules, both of which are included in the Abuse installation.
  2. We will begin by editing the Watchlist settings, which can be accessed by selecting Site configuration and then Watchlist settings, from the Administer menu.
  3. Maintaining, Optimizing and Upgrading Your Site in Drupal 6: Part 2

  4. You can include any words that you want to, in the Watch list and Filtered/banned word list, depending on your target audience and your site's needs; just make sure that you enter one word per line. Items on the Watch list can be viewed while they are in the review queue, and items on the Filtered/banned word list will be hidden until they are reviewed.
  5. You can also control which items are automatically added to the Watch list or banned list, based on the Watchlist word settings configured above.
  6. Maintaining, Optimizing and Upgrading Your Site in Drupal 6: Part 2

  7. You can also force moderation for specific types if they are more prone to abuse.
  8. Maintaining, Optimizing and Upgrading Your Site in Drupal 6: Part 2

  9. We can now modify the Abuse Moderation settings by selecting Site configuration and then Abuse Moderation settings, from the Administer menu.
  10. The first setting controls what content types are subject to abuse reports.
  11. Maintaining, Optimizing and Upgrading Your Site in Drupal 6: Part 2

  12. The next section of controls how abuse tickets are to be handled by your moderators.
  13. Maintaining, Optimizing and Upgrading Your Site in Drupal 6: Part 2

    If you have multiple moderators for your site, you can select the Abuse Assigned Moderators option. If you use this, you will also need to store the maximum number of items that have been flagged for abuse that are added to the moderator's queue. If moderators live in different time zones, you can set an hour of the day at which all moderation queues are cleared, so that items do not remain in the moderation queue for an overly-long period of time.

  14. Finally, you can configure the settings related to all of the items that have been flagged as abusive by a user.
  15. Maintaining, Optimizing and Upgrading Your Site in Drupal 6: Part 2

    The Abuse threshold controls how many complaints must be registered for an item before it is moved into the moderation queue. 3 is a good number to start with, but you may want to increase or decrease the threshold depending on the needs of your site.

  16. You can edit the reasons for flagging an item for abuse by selecting Site configuration, then Abuse Moderation settings, and finally Abuse Moderation reasons, from the Administer menu.
  17. Maintaining, Optimizing and Upgrading Your Site in Drupal 6: Part 2

    All available reasons will be listed on the page using a format similar to the example above. You can add new reasons, remove reasons, or change the text for reasons from this page.

  18. Before the abuse module is activated, you need to assign permissions to users, so that they can flag content for review.
  19. Maintaining, Optimizing and Upgrading Your Site in Drupal 6: Part 2

  20. Content that has the abuse module activated will have a new Flag as offensive link added to it, as shown in the following screenshot:
  21. Maintaining, Optimizing and Upgrading Your Site in Drupal 6: Part 2

  22. When the user clicks on the Flag as offensive link, he or she will be presented with a form where he or she can specify their contact information, and a reason why he or she believes that the content is offensive.
  23. Maintaining, Optimizing and Upgrading Your Site in Drupal 6: Part 2

  24. Administrators can review content that has been flagged as offensive by clicking on Content management and then Moderate.
  25. Maintaining, Optimizing and Upgrading Your Site in Drupal 6: Part 2

  26. The administrators can click on the Get More Tickets link to have additional items assigned to them.
  27. Once a ticket has been assigned to them, the administrator can view information about the user who submitted the content as well as the user who flagged the content, and choose what action to take for the content.
  28. Maintaining, Optimizing and Upgrading Your Site in Drupal 6: Part 2

The administrator can either allow the content, or remove the content from the web site. The administrator can also optionally send a warning to the user without further action.

Drupal 6 Site Builder Solutions Build powerful website features for your business and connect to your customers through blogs, product catalogs, newsletters, and maps
Published: December 2008
eBook Price: $26.99
Book Price: $44.99
See more
Select your format and quantity:

Upgrading to new versions of Drupal

One of the fantastic things about Drupal is that it is constantly evolving to offer new and improved functionalities. However, this requires you to regularly check for updates to Drupal and any contributed modules that are installed.

In this section, we will discuss how to find updates, test them, and install them onto your site.

There are two types of updates that you will encounter. Minor updates will correct security issues or problems found by users, and may have minimal functionality enhancements. A major update will typically have much more functionality, and may be incompatible with the previous versions.

The version number for Drupal contains two numbers separated by periods. For example, version 6.5 indicates major version 6 and minor version 5.

A custom module will begin with the version of Drupal it is compatible with, followed by a major and minor version for the module itself. If a module is compatible with all of the minor releases of a Drupal major release, the minor version will be represented by an x. For example, version 6.x-1.5 indicates that the module is compatible with any version of Drupal 6, and that the major version of the module is 1 and its minor version is 5. A module may also indicate development versions by adding—dev to the end of the version, a beta version by adding—beta1, or a release candidate by adding—rc1 after the version. Multiple beta and release candidates are indicated by incrementing the numbers after beta or rc, respectively.

Checking for new updates to Drupal and modules

Good Eatin' Goal: Ensure that we are using the latest versions of Drupal and the contributed modules that the site uses.

Additional modules needed: None (core).

Basic steps

Drupal 6 and later makes it easy to check for updates to Drupal and the modules that you have installed. By default, Drupal will check for updates to the system each time that cron is run.

You can check the current status of the system by selecting Reports and then Available updates, from the Administer menu. Drupal will also display a warning when you navigate to any administration page, if it has detected that Drupal, or some related content, is outdated.

Maintaining, Optimizing and Upgrading Your Site in Drupal 6: Part 2

If you want to, you can click on the Check manually link to ensure that all modules are up-to-date.

If any modules are outdated, they will be shown as follows.

Maintaining, Optimizing and Upgrading Your Site in Drupal 6: Part 2

The display includes the version that you have currently installed, the recommended version that should be installed, a link to download a new version, and a link to the release notes for the new version. The Release notes will include a list of changes that have been made to the module. In the next few tasks, we will discuss upgrading your installation.

Upgrading minor releases

Good Eatin' Goal: Upgrade between minor versions.

Additional modules needed: None (core).

Basic steps

When Drupal detects that a new version of Drupal is available, it will inform you as mentioned earlier.

  1. Before you download and install the new version, you should read all of the release notes for the new version, to determine if there are any potential incompatibilities with the other modules that you have installed.
  2. If you do not see any potential issues based on the release notes, you can begin testing the new version yourself.
  3. Before installing the new version, make a complete backup of your site including all of the files and the database.
  4. You should test the new version on a non-production test site, before installing it on your live site. If you do not have a test site set up yet, you can create a test site on your local computer, in a different location on your web host, or on another web host. If you choose to have the test web site hosted at a web host, you should make sure that it is not publicly accessible to visitors. This will help to ensure that your visitors are not directed to the wrong version of your site through search engines.
  5. Open the update page of your site, which is available at http://yoursite.com/update.php. In order to reach this page, you must be logged in using the administration account, which is the first user you created.
  6. Maintaining, Optimizing and Upgrading Your Site in Drupal 6: Part 2

  7. If your test site is not available to the public, you do not need to worry about putting the site into maintenance mode.
  8. Install the module into the test version of your site by copying the files to the server.
  9. Click the Continue button on the Update page.
  10. Drupal will then display a list of modules where the database tables need to be updated. By default, Drupal will select the correct version to upgrade to.
  11. Maintaining, Optimizing and Upgrading Your Site in Drupal 6: Part 2

  12. In most cases, you will want to use the version that Drupal selects, but you can override the version selected if needed.
  13. When you have selected the version you want to upgrade to, click the Update button.
  14. Drupal will now run all of the updates and display the results with links back to your site.
  15. Once the installation is complete, you should test your web site to ensure that it is still functioning correctly, and that all of the functionality related to the update is running properly.
  16. Assuming that all functionality works correctly for you, and you do not detect any incompatibilities, you can use the same steps on your live site to install the updates in production. If you do detect any incompatibilities, please report the problems that you found on the Drupal site so that they can be corrected as quickly as possible. When reporting issues, make sure that you give a full description of the problem that you are having, the version it is related to, and, if appropriate, a list of the other modules installed on your site.

Upgrading to a new major release

Good Eatin' Goal: Upgrade to a new major release of Drupal.

Additional modules needed: None (core).

Basic steps

The process of upgrading Drupal to a new major release can be a non-trivial process, which you will want to undertake carefully.

  1. Begin by verifying that the contributed modules you use have been upgraded to be compatible with the latest release of Drupal. This can be done by checking the project page for the module on the Drupal.org web site.
  2. If a module has not been ported to the latest version of Drupal, you can search for a suitable replacement, wait until the module has been upgraded, or remove the functionality provided by the module from your site. It may take several months after the latest version of Drupal is released for production usage for the maintainers to port the module. You can contact the maintainer to see if they have a schedule for development, or to see if you can contribute to help cover development costs.
  3. Once all of the modules that you have installed are available for update, you can begin the actual installation process. As before, you should test the installation process on a test site before doing it on the production site, to ensure that you don't encounter problems.
  4. If you are upgrading a live site, put your site into maintenance mode by selecting Site configuration and then Site maintenance, from the Administer menu.
  5. Maintaining, Optimizing and Upgrading Your Site in Drupal 6: Part 2

    Change the status to Off-line and then click the Save configuration button.

  6. Make a complete backup of the files and the database tables that comprise your site.
  7. Disable all custom modules that you have installed. This will allow you to upgrade them later.
  8. Switch to a default theme installed with the Drupal core installation.
  9. Upload the new Drupal files to your site.
  10. Run the upgrade page at http://yoursite.com/update.php, as described in the previous task.
  11. Download and install the custom modules for your site.
  12. Download and install your site theme(s).
  13. Run the upgrade script again.
  14. Back up the following files, and then remove them from your site.
    • install.php
    • CHANGELOG.txt
    • INSTALL.txt
    • INSTALL.mysql.txt
    • INSTALL.pgsql.txt
    • LICENSE.txt
    • MAINTAINERS.txt
    • UPGRADE.txt
  15. Test your site to ensure that all of the functionalities are working properly.
  16. If your site is working properly, you can either repeat the steps on your live site, or copy the test site to the live site.
  17. If any functionality is not working properly, you can try the upgrade process again using your backup, or contact the maintainers of the functionality that is not working, so that they can help you to resolve any issues.

Summary

In this article, we have reviewed a number of tasks that happen behind the scenes, in order to give your visitors the best possible experience, and to ensure that your web site operates at peak performance even if you are confronted with hardware failures or other unforeseen events. We have also discussed ways of managing your content to ensure that your site is of the highest possible quality.

Although these tasks are not glamorous, they are essential to any professional web site.

Drupal 6 Site Builder Solutions Build powerful website features for your business and connect to your customers through blogs, product catalogs, newsletters, and maps
Published: December 2008
eBook Price: $26.99
Book Price: $44.99
See more
Select your format and quantity:

About the Author :


Mark Noble

Mark Noble has worked in software development and website design for over 13 years in a variety of capacities including development, quality assurance, and management. He takes pride in developing software and websites to make businesses run more effectively and delights in helping users to get their jobs done more easily.

Mark currently works developing websites to help libraries manage their books. He also does occasional contract work for clients in a variety of industries.

When he isn’t in front of a computer, Mark enjoys playing with his family, photography, and geocaching.

Books From Packt

Papervision3D Essentials
Papervision3D Essentials

WordPress MU 2.7: Beginner's Guide
WordPress MU 2.7: Beginner's Guide

Joomla! 1.5x Customization: Make Your Site Adapt to Your Needs
Joomla! 1.5x Customization: Make Your Site Adapt to Your Needs

Learning Ext JS
Learning Ext JS

Joomla! 1.5 SEO
Joomla! 1.5 SEO

Drupal 6 Content Administration
Drupal 6 Content Administration

JasperReports 3.5 for Java Developers
JasperReports 3.5 for Java Developers

PHP Team Development
PHP Team Development

 

No votes yet

Post new comment

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
k
A
C
n
A
x
Enter the code without spaces and pay attention to upper/lower case.
Code Download and Errata
Packt Anytime, Anywhere
Register Books
Print Upgrades
eBook Downloads
Video Support
Contact Us
Awards Voting Nominations Previous Winners
Judges Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software
Resources
Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software