Delete a Website

Events happening in the community are now at Drupal community events on www.drupal.org.

There may come a time when you want to remove a website from your Aegir powered server. As you'd expect, Aegir handles this for you too. It'll even clean up after the site properly

But resist the first temptation of someone used to working with Drupal's nodes - don't go to the site's node, select the edit tab and press the 'delete' button! (in coming releases of Aegir this is to be made clearer).

Here's the proper way to do it:

1. Disable the Site

From the Sites page of your Aegir system, click on the name of the site you want to remove. This will display a page of information about the site. A list of tasks is viewable as an inset block on the node view. Click the 'Run' button next to the 'Disable' task.

You will be prompted to confirm the Disable task in a dialog box.

Aegir will now add a new task to the task queue, and when it next runs the queue (probably within a minute) your site will be disabled.

When Aegir disables a site it will take a backup of the database and sites/example.com directory and store this in a tarball in /var/aegir/backups.

Finally, Aegir will setup a redirect in apache, to direct visitors to the domain name to a holding page explaining that the site has been disabled.

2. Delete the Site

When you next visit the page for this site in Aegir, you'll see that the 'Run'button against the Delete task is now clickable instead of 'greyed out'. If you really want to delete the site, click this - and Aegir will ask you to confirm.

Once again, Aegir will add this task to its queue, and process it in about a minute.

Just for caution, Aegir will also take another backup at this stage.

When Aegir deletes a site in this way it cleans up the system. Here's what it does....

  • Removes the apache vhost configuration files for the site
  • Removes the drush alias file for this site
  • Removes the database for the site
  • Removes the mysql user for the site
  • Removes the sites/example.com directory from the platform's codebase
  • Removes the site's history from Aegir - all tasks etc.

Manually deleting the site

Sometimes something goes wrong in an Install task and a site doesn't install successfully, but also can't be deleted from the frontend normally with the above steps.

At the time of writing, no task in Aegir exists to 'force' a removal of a site without having to bootstrap it first, so some manual steps are required on your part to remove this site.

  • Manually remove the site files on the server if they exist (i.e /var/aegir/drupal-6.16/sites/my-failed-site.com
  • Drop the database and revoke db user privileges associated with this site if it got created before failing (check the vhost config for the site name, or check the task output for this information)
  • If your site node is nid '83', go to /node/83/delete in your browser on the Aegir frontend and delete the node. You can also find it through /admin/content as usual, and delete from there. This will remove the site node and associated task nodes from the system, as well as remove the entry from the hosting_sites table in the database.
  • Manually remove the Apache vhost file for this site if it is still present (in /var/aegir/config/server_master/apache/vhost.d/)
  • Manually remove the Drush alias for this site if it is still present (in /var/aegir/.drush/)
  • EDIT for new SSL Feature in latest versions: if your site generated the SSL certificate you also need to manually delete the SSL certificate folder located in /var/aegir/config/ssl.d/[domain of site you are deleting] and/or /var/aegir/config/server_master/ssl.d/[domain of site you are deleting]. Additionally you will probably also need to delete the entry for the domain you are deleting in the hosting_ssl_cert MySQL table.

Aegir hosting system

Group organizers

Group categories

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: