Uninstalling Aegir

Tagged:

There is no formal method for uninstalling Aegir, but there is also no real mystery either since the system tries to keep itself together in one location, typically /var/aegir.

Below are the steps to completely remove all traces of Aegir from your server.

Obviously if you have any sites and platforms currently managed by Aegir, you would want to move them out of the /var/aegir area before you delete it! Ensure you have set up your sites and platforms elsewhere, with Apache vhost files etc in their typical locations, or at least out of harm's way before attempting this.

WARNING: Performing these steps will remove Aegir from your server and may result in loss of data. Use with caution.

Run these commands as a privileged user (such as root). We assume your Aegir installation resides in /var/aegir

Backup

Backup anything you need to keep from the /var/aegir/ directory

Remove /var/aegir

rm -rf /var/aegir

Remove the aegir user's crontab

crontab -r -u aegir

Delete the aegir user

userdel aegir

This will also remove the user from the www-data group.

Remove the user from sudoers

visudo

Remove the line that looks something like

aegir ALL=NOPASSWD: /usr/sbin/apache2ctl

Save and exit the file.

Drop the database(s) and db user(s)

There are no generic instructions for this, since every system differs. Essentially you can perform this within a MySQL shell

mysql -u root -p

Use the DROP DATABASE $databasename; syntax to drop databases.

To see a list of GRANTs that Aegir has made for your database users, you can use a command like the following

SELECT user, host FROM mysql.user;

You can use the DROP USER $user syntax to delete these users and their privileges, depending on your version of MySQL.

Consult the GRANT and DROP documentation from MySQL for more information.

Delete the symlink/include from Apache

Depending on your installation and OS this may vary.

Generally:

cd /etc/apache2/conf.d

unlink aegir.conf

Or if it is a file and not a symlink, remove the file.

If your Include statements were contained in a global system httpd.conf file or similar, you will need to remove these lines manually.

Restart Apache when you have completed this.