Annvix
Personal tools



/User Guide/Upgrading

From Annvix

(Redirected from Documentation/Upgrading)

Upgrading Strategies

Annvix is an operating system designed to be upgraded "live". The goal is to provide a straight-forward upgrade path from one version to the next. This is usually accomplished by executing apt-get dist-upgrade for simple updates and using fabricated upgrade scripts for upgrades that require more complex work (such as upgrading from 1.2-RELEASE to 2.0-RELEASE).

However, just because it's easy to upgrade one rpm package to the next does not necessarily mean the software being installed is as easy to upgrade. Software upgrades such as MySQL 4.1.x upgrading to MySQL 5.0.x require a little more effort in a way that the rpm package cannot do for you. It could certainly try, but wouldn't you feel more safe knowing you had manually performed (and tested) those upgrades before letting rpm arbitrarily do it for you using some canned script that may not be sufficient for your situation?

To that end, this page indicates some upgrading strategies that can be used to tailor specific upgrade techniques to use when you upgrade software. It is unwise to rely on the distributor, vendor, or package maintainer to make these assumptions for you, and any good sysadmin will be taking care to cover their bases prior to an upgrade.

For the record, Annvix tries to make as little assumption about your running system as possible so you must take care to backup, upgrade, or migrate data on your own.

Contents

Upgrading MySQL

The MySQL database is very straightforward to backup. Very good release notes are provided by the MySQL developers pertaining to changes and whatnot that are made to the database engine itself. Should be required reading for anyone performing an upgrade:

Creating a backup

The first step must be always to create a backup of your existing data. The command to dump the database:

# mysqldump \
    -u root -p \
    --all-databases \
    --add-drop-database \
    --opt \
    --allow-keywords \
    --flush-logs \
    --hex-blob \
    --max_allowed_packet=16M \
    --quote-names \
    --result-file=BACKUP_MYSQL_4.1.SQL

This assumes the currently installed version of MySQL is 4.1 (thus the backup file name). The BACKUP_MYSQL_4.1.SQL file can now be used to recreate your data. Before assuming that this file is valid, you should import the data on a spare system and check that everything is there.

You could also make a binary backup of your database:

# srv --down mysqld
# tar cvjf ~/mysql-backup.tar.bz2 /var/lib/mysql
# srv --up mysqld

Finally, to restore your data via your SQL export (BACKUP_MYSQL_4.1.SQL), you would use:

# mysql \
    -u root -p \
    --max_allowed_packet=16M < BACKUP_MYSQL_4.1.SQL
# mysqlcheck -u root -p --all-databases

You must run mysqlcheck after the upgrade as it checks the databases for incompatibilities with the new version of MySQL; it will check and repair any tables that require it. See mysql_upgrade - Check Tables for MySQL Upgrade for more information.

Also note that mysqld must be running in order to import the data via the SQL file.

Upgrading OpenLDAP

OpenLDAP is a directory service that acts quite a bit like a database, so care must be taken when upgrading it as well. The easiest way to backup OpenLDAP is to make an LDIF file using slapcat:

# srv --down slapd
# slapcat >~/ldap-backup.ldif
# srv --up slapd

The slapd daemon shouldn't be running when you execute slapcat to make sure no changes are made to the directory while it is creating the LDIF file. You can also create an LDIF of a particular base DN using:

# slapcat -b "dc=example,dc=com" >~/ldap-backup-example.com.ldif

Once OpenLDAP is upgraded, you can restore the data using:

# slapadd -cv -l ~/ldap-backup.ldif

or you can use the -b option as noted above if the LDIF file is for a particular base DN.

Performing a Remote Upgrade

In theory, you should be able to upgrade Annvix entirely by remote. In practice, this has worked well in testing. In real life, you take chances by performing a remote upgrade. Here are some tips to help make life a little easier if you need or want to do a remote upgrade:

  • open 3 ssh sessions to the remote host; one to run the upgrade script, one to watch the upgrade log (/tmp/upgrade/upgrade.*), and another to do any "emergency" work you migh need to do
  • you can run the system for some time once the upgrade is done, although you should reboot as soon as possible.... take that time to look at /root/.upgrade.log.[date] and make sure there were no critical errors
  • double-check /etc/mdadm.conf if you use RAID
  • double-check /etc/fstab just in case
  • execute find /etc -name '*.rpmnew' and merge in any configuration changes that may be required; do the same for *.rpmsave also
  • if your server provides it's own DNS, you will get an error from apt; you can re-try the apt command with the script, however, using your third terminal, bring back up your DNS server service (named or dnscache, etc.) so that DNS resolution will work
  • for 2.0-RELEASE, if your server relies on LDAP for authentication, be aware that slapd will not properly restart until the system is restarted (it requires the 2.6 kernel to run); to have it come up automatically, be sure to execute rm /service/slapd/down prior to rebooting

A number of upgrade tests with the upgrade script have been done via remote, and live upgrades have been done as well. They have all worked. Your mileage may vary, however.

Image:Annvix-upg_1.2-2.0.jpg

<< Return to User Guide





Sponsors: Arizona Landscaping - Internet Marketing - Loans - Credit Cards