drupal

Upgrading from Drupal 6 to 7

Just upgraded my web site from Drupal 6 to 7. All I had to do was to download the latest release from drupal.org and follow the instructions from UPGRADE.txt. I admit this part was easier than expected.

But if you want to try a different approach, check out the following project:
http://fuerstnet.de/en/drupal-upgrade-easier

It uses a patch system to update from all minor versions to the latest version of Drupal. Download the right patch file for your version, than run the following commands:

cd DRUPAL-ROOT
patch -p1 --dry-run < PATCHFILE
patch -p1 < PATCHFILE

Drupal 6 yelling a "Page not found" after clearing the cache

In the process of exporting a Drupal 6 database, I had to empty some cache tables that got really big. To my surprise, Drupal started to show "Page not found" errors for all the pages it served.

After a bit of research I've discovered it's quite a common problem with Drupal 6. In my case, the solution was simple. All I had to do was to run update.php.

Install GeSHi Filter for Drupal 6

To enable syntax highlighting in Drupal posts, you can use the GeSHi Filter module. This module uses Generic Syntax Highlighter - GeSHi, which is a third-party PHP library that supports more than 100 programming languages.

To install this module, you'll have to:

Once everything has been copied over, you should enable the module. Go to Administer >> Site Building >> Modules.

Now you'll have to add the GeSHi filter to your input filters. Go to Administer >> Site Configuration >> Input Filters.

The final step is to enable the languages you think you're going to use by going to Administer >> Site configuration >> GeSHi Filter >> Languages.

Install Drupal in a subdirectory, but access it as root

I wanted to install Drupal in a subdirectory, for instance ~/public_html/drupal, and still access it as root.

The theory is simple: put Drupal in a subdirectory then add a .htaccess file in the root directory that redirects non existing URL's to '/drupal'. But in practice it proves to be trickier than I thought.

So, here is the code for the .htaccess file:

Options -Indexes
Options +FollowSymLinks
 
<IfModule mod_rewrite.c>
RewriteEngine On
 
# skip processing the drupal files
RewriteCond %{DOCUMENT_ROOT}/drupal%{REQUEST_URI} -f
RewriteRule .* drupal/$0 [L]
 
# process drupal urls 
RewriteCond %{HTTP_HOST} ^kenjiru\.ro|www\.kenjiru\.ro$ [NC]
RewriteRule ^$ drupal/ [L]
 
# the actual redirect
RewriteCond %{HTTP_HOST} ^kenjiru\.ro|www\.kenjiru\.ro$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ drupal/$1 [L]
</IfModule>

I specified the domain because I'm having other addon domains hosted on the same document root.