My First Drupal 6 Upgrade - Part 1

August 13, 2008 – 5:51 pm

I’m using D6 on a couple sites already, but all of them were created from scratch. Starting from scratch doesn’t require any old content, modules and themes, so it’s a piece of cake.

Converting my work site, which is Drupal 5.9, hasn’t been such a cakewalk. I’m not tearing my hair out in frustration, but it’s definitely a process that requires going slowly. This partial write up will hopefully remind me of what needs to be done when I convert other sites over. The whole notion of skipping D6 is out there, but I think this will be a good exercise.

The first thing I did was tar and gzip the existing site and do a mysqldump on the database. Then I created a new entry in my “/etc/hosts” file, which I named “drupal63″. I also added the usual virtual host stuff to the “/etc/httpd/httpd.conf” file for “drupal63.” I create these new entries for all my development sites, so this was pretty routine. Next, I uncompressed the existing site into the “drupal63″ directory and imported the mysqldump into a new “drupal63″ database. At this point, I had a working backup of the existing Drupal 5 site.

With the “restoration” complete, I proceeded with the “upgrade”. I first renamed the “sites” directory to “sites5″ and “misc” directory to “misc5″ to preserve the directories. Then, I just copied over all the directories from an uncompressed version D6.3. I said OK to the overwriting of all duplicate files/folders, and then moved on. I kept an old version of the “misc” directory be/c there were a few special jquery files there. After I copied them to the new “misc” directory, I deleted the “misc5″ directory.

Next, I moved on to the “sites” directory. I copied the “sites/default/default.settings.php” to a new “sites/default/settings.php” file and edited the “db_url” and “base_url” lines to match my new virtual host and new mysql database. I also had to edit the “$update_free_access” variable to be TRUE since I was going to do the upgrade w/o being logged in first.

Then, I ran the “update.php” script and let it do it’s database updates. With all the updates, there was only one error, but since I don’t know much about why there’s a duplicate key, I’m not going to worry about it now …

Duplicate entry ‘2-0′ for key 1 query: ALTER TABLE term_node ADD PRIMARY KEY (tid, vid) in /Users/me/Sites/drupal63/includes/database.mysql-common.inc on line 374.”

Now, I had a pseudo working Drupal 6 version of the existing site. I had to make the “files” directory writeable at some point to make Drupal happy. The next task was to get my theme to work again. I’ll add that info in Part II. Part III will be about getting my modules to work.

Post a Comment