Annvix - upgrading Strategies
Welcome to the tutorial guide. The tutorial will provide guidance and instructions to users on upgrading strategies for Annvix. Please note that Annvix is an operating system designed to be upgraded “live”.
The main purpose 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).
Please note that the software upgrades such as MySQL 4.1.x upgrading to MySQL 5.0.x requires attention as rpm package cannot provide any assistance to a user. Also, a user should be careful to backup, upgrade or to migrate date on his/her own.
This tutorial guide presents upgrading strategies that can be used to tailor specific upgrade techniques to use when upgrading software.
Upgrading MySQL
Let’s learn how to upgrade a MySQL database. The MSQL database is easy to backup.
A user should note that the first step to create a backup of your existing data. A user has to run the following command in order 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 as the backup file name. The BACKUP_MYSQL_4.1.SQL file can now be used to recreate the data. Before assuming that this file is valid, a user should import the data on a spare system and check that everything is there.
A user could also make a binary backup of his/her database:
# srv –down mysqld
# tar cvjf ~/mysql-backup.tar.bz2 /var/lib/mysql
# srv –up mysqld
Finally, to restore his/her data via the SQL export (BACKUP_MYSQL_4.1.SQL), a user would use:
# mysql \
-u root -p \
–max_allowed_packet=16M < BACKUP_MYSQL_4.1.SQL
# mysqlcheck -u root -p –all-databases
A user should 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. It is important to 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. An easy way to backup OpenLDAP is to make an LDIF file using slapcat. This can be done by running following command:
# srv –down slapd
# slapcat >~/ldap-backup.ldif
# srv –up slapd
The slapd daemon shouldn’t be running when a user executes slapcat to make sure no changes are made to the directory while it is creating the LDIF file. A user can also create an LDIF of a particular base DN by running following command:
# slapcat -b “dc=example,dc=com” >~/ldap-backup-example.com.ldif
Once OpenLDAP is upgraded, a user can restore the data by running following command:
# slapadd -cv -l ~/ldap-backup.ldif
or a user can use the -b option as noted above if the LDIF file is for a particular base DN.
How to perform a remote upgrade
A user should be able to upgrade Annvix entirely by remote. In order to perform a remote upgrade, a user can go through following:
• 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 that a user might need to do
• a user can run the system for some time once the upgrade is done, although a user 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 a user is using 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 a users server provides it’s own DNS, a user will get an error from apt; a user can re-try the apt command with the script, however, using the third terminal, bring back up the DNS server service (named or dnscache, etc.) so that DNS resolution will work
• for 2.0-RELEASE, if a users 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.
If a user followed this tutorial guide then he/she would have learnt about Annvix - upgrading Strategies













