Server upgrade complete

Here are some notes I took when upgrading to Debian Lenny this weekend. The only things that gave me serious trouble were Gallery2 and Drupal6, because I had to both migrate the data and upgrade the application at the same time.

aptitude install emacs
copy old /usr/share/emacs/site-lisp/ my stuff
copy old /root/.emacs

aptitude install openssh-server openssh-client
copy old /etc/ssh
copy old /root/.ssh

aptitude update && aptitude safe-upgrade
edit /etc/apt/sources.list
# STABLE
deb http://ftp.us.debian.org/debian/ lenny main contrib non-free
deb-src http://ftp.us.debian.org/debian/ lenny main contrib non-free
deb http://security.debian.org/ lenny/updates main contrib non-free
deb-src http://security.debian.org/ lenny/updates main contrib non-free

# UNstable (sid) for gallery2
deb http://ftp.us.debian.org/debian/ sid main contrib non-free
deb-src http://ftp.us.debian.org/debian/ sid main contrib non-free
shutdown -r now

Networking
edit /etc/networking/
/etc/init.d/networking restart
durable should be on 192.168.254.101
copy /etc/hosts file

copy home directories
change links to /opt/home
copy/merge old /etc/passwd shadow group

aptitude install postfix postfix-tls libsasl2 sasl2-bin libsasl2-modules
remove exim from /etc/ -- do a find
copy old /etc/alias*
backup generated /etc/postfix
copy old /etc/postfix
copy old /etc/ssl
restart both postfix and ssh to get the right certs

aptitude install fetchmail
copy /etc/fetchmailrc
copy /etc/default/fetchmail

aptitude install dovecot-imapd
edit /etc/dovecot/dovecot.conf to point at the postfix cert

aptitude install clamav spamassassin pyzor razor postgrey
copy /etc/spamassassin /etc/default/spamassassin
edit /etc/cron.daily/spamassassin to get rules
copy /etc/cron.daily/spam-daily

aptitude install nfs-kernel-server nfs-common
link /nfs directories
copy /etc/exports

aptitude install samba
copy changes in /etc/samba/smb.conf
copy users in /etc/samba/smbpasswd

aptitude install subversion
copy /svn /var/www /opt/www

aptitude install cpufrequtils hddtemp hdparm ntp rsync smartmontools sudo zsh nmap wget links2 apachetop
copy /etc/default/smartmontools
set in /etc/smartd.conf
# -d ata needed for SATA /dev/sd devices
# -m root sends mail on error
# -M test sends mail on bootup, as a test
/dev/hda -H -m root -M test -a -o on -S on -s (S/../.././02|L/../../6/03)
/dev/sda -d ata -m root -H -a -o on -S on -s (S/../.././02|L/../../6/03)
/dev/sdb -d ata -m root -H -a -o on -S on -s (S/../.././02|L/../../6/03)
setup my user in /etc/sudoers

aptitude install apache2 libapache2-mod-php5 libapache2-svn php5-mysql
copy /etc/apache2/sites-enabled sites-available
a2enmod dav_fs
a2enmod rewrite
copy /etc/apache2/auth-files

aptitude install mysql-server
copy old databases

aptitude install php5-mysql php5 php5-gd dbconfig-common curl libjs-jquery

aptitude install drupal6
ln -s /var/lib/drupal6/files /usr/share/drupal6/files
edit /etc/drupal/6/sites/mysitename.com/settings.php
add "$update_free_access = TRUE;" line to beginning (remove it after upgrade)
go to http://mysitename.com/update.php

aptitude install imagemagick gallery2
edit /etc/apt/preferences (because the package is missing in lenny)
copy /etc/gallery2
copy over /var/lib/mysql/database file

aptitude install bind9

aptitude install logwatch