I always forget to take notes when I do a Drupal upgrade. This blog entry will be my notes for this upgrade of my home boxes. I will use it in turn to upgrade FOB, and then hopefully use it again when it's time to upgrade again in the future…
I need to upgrade three different Drupal sites hosted at my home from 4.7.4-->4.7.8-->5.3. The middle migration is just because it is unlikely the last one will work unless one rotates through first. Currently, the sites are running 4.7.4 as installed by me. Now Debian has reasonably up-to-date Drupal packages, so I'm moving back to Debian again.
Do some prep work. Identify any themes you are going to upgrade, and make a plan for that; probably the best idea is to get an upgrade patch ready using some test instance. Identify any non-standard modules you're using, and get new versions ready. Identify any module patches you're using, and make sure they're ready to go.
Check for backups. First, back up /etc/drupal. For me, that was easy—I had previously configured everything to run without it.
Next, move your old stuff out of the way. For me, /usr/share/drupal-4.7.4 contains everything interesting, and /usr/share/drupal-4.7 is a symlink. So removing the symlink is sufficient to mostly protect my stuff.
Finally, make sure that your SQL database is being backed up. I have an /etc/cron.daily/mysql-backup that dumps the database into a compressed file nightly. Then my normal backup stuff backs up the file. But I am careful about these things, so I used "mysqldump --defaults-file=/etc/mysql/debian.cnf --all-databases > ~/tmp/my.sql" to make a current snapshot. Now, if the upgrade goes horribly wrong, I can get back to where I was.
Log into the sites as admin. Keep a browser open once you've done this. You're going to need it to update the sites' databases later. Also, remember to turn off any custom theme. This is a mighty pain to work around if you forget and the new version breaks on your theming.
Install Drupal. Since I'm using Debian, it's as easy as "apt-get install drupal-4.7". There were two questions asked by the installation, both of which had context-dependent answers. I chose not to auto-configure any web server with this install—my setup is complex, and I'd prefer to do it by hand. I also chose not to use db-common yet. It turns out it's easier to turn it on after things are set up right. Then I put my symlink removed above back, so that my sites would work while I continued to work on stuff. Unfortunately, the Debian upgrade had nuked PHP4, so I was dead in the water until the upgrade completed. Bleah.
Upgrade the "sites" directory. A default site configuration is in /usr/share/drupal-4.7/sites. I saved it aside and copied the old site configuration in. It turns out that the new site stuff just needs a couple of small files, so I created them for each site. Now each site directory contains settings.php, baseurl.php, and dbconfig.php. I generated the dbconfigs manually, as mentioned earlier. Make sure that dbconfig.php has the right group, as it is protected from world access since it contains a cleartext password.
Upgrade the htaccess file. I always forget this step. In /etc/drupal/4.7/htaccess is a file that among other things has rewrite rules that sometimes need changing. But it turns out I'm OK; all of that is handled elsewhere in my Apache config.
Reinstall missing stuff. Themes being transferred go in the themes directory, of course, and modules in the modules directory.
Check the web server stuff. It's worth seeing if anything changed in /etc/drupal/4.7/apache.conf. But it really didn't. So my setup should still be good.
Update the databases. Edit /usr/share/drupal-4.7/update.php to allow access. For each site, hit http://site/update.php and follow the instructions.
Update the configurations. For each site, looks at the module list, and add any modules that seem to have vanished. Then look at the access rights; new things are generally turned off until you turn them on. Finally, check and update paths that might accidentally have had an old directory name hardcoded in them.
Clean up.Remember to remove the old cron jobs, and the old installation symlinks, and move the old /etc directory. Then use apt-get to uninstall any previous Debian-controlled version.
and schalit-way.net. Once I'm confident of these, it's time to do this site. Hopefully the notes I've made will help me. (B)