Video tutorials

Aegir Site Tasks: Backup, Restore, Clone, Migrate

In this Aegir screencast, we'll learn how to backup and restore your site, use the migrate feature to move your site to another platform (or upgrade it) and quickly create a copy of your site (for development or testing, for example).

Watch the Screencast

Tutorial In a Nutshell

In the previous installment, we created a drupal 7 platform and a pressflow 6 platform, and installed a site on each. You can see the overview of your sites and run tasks on them by going to hosting/sites

Site overview

Backup the site

To run backup, go to the site page and press the Run button next to Backup. An overlay window will appear where you can enter the description of the backup. Press the Backup button. I use Pressflow site for this example.

Backup the site

On the site page, there's also an overview of Packages (modules, themes and profiles) available on the site (enabled or disabled).

Packages on the sites

Now let's enable Views module. Open the terminal and run drush commands using the site alias. Aegir creates aliases for all sites, platforms and servers. The full list can be seen by running drush sa.

drush site alias

Note that servers and platforms would have special prefix. To enable views, run

drush @yoursite en views views_ui -y

enable views

If you go to the site now, views should be available (if you haven't logged in before, you'll see the reset password screen).

Let's try downloading the latest 6.3 version of Views:

drush @pressflow6 pm-releases views

drush @pressflow6 dl views-6.x-3.0-alpha3

drush @pressflow6 updb

Now go to your website page in Aegir, click verify and go to the packages tab. Views should be enabled and be version 6.3.

Packages update

Restore site

Views 3 has produced errors so now I'd like to revert back to views 2. It's as simple as going to the site page, running Restore and choosing the appropriate backup.

Restore from backup

Now first run Verify again and then check the packages. Views should be disabled but it's still version 3. The reason is because drush downloads to sites/all/modules directory, however aegir backs up the database and everything in sites/ directory, including files (and that's how it should be, modules should belong to the platform, not sites).

Site packages

Migrate (upgrade) sites

Migrating means moving site to another platform. It's most often used for upgrading (core and packages). Let's upgrade pressflow6 to drupal 7. Click on Migrate and choose the platform.

Migrate site

You can see information on Upgrades, Errors and Warning and you can also compare the chosen platform with the current one.

Compare platforms

Click on Migrate when done. Aegir will move the site to the new platform and run the database updates. You can also migrate to the same platform which effectively means renaming the site (changing the domain name). Since my site is no longer on Pressflow 6, I'd like to rename it.

Let's click on Migrate again. This time, there will only be Drupal 7 platform. Aegir can't downgrade the sites, only upgrade them. Let's rename the site and run Migrate.

Rename the site by migrating

Before going to the site, add it to your /etc/hosts file. You can now login to your new D7 site and enable various modules and themes.

Clone sites

Clone task allows you to quickly create copies of the sites (usually used for testing or development purposes). Keep in mind that you'll probably need a different platform if you're going to test updates (remember, the modules are in sites/all directory so they'll affect other sites on the platform).

So I've created a copy of my D7 platform called drupal7dev (it's easy to do with the makefiles). Now I can go to drupal7 admin screen and click on Clone. You'll need to give the copy a new domain, but otherwise the screen is the same to Migrate. Choose the platform and click on Clone.

Clone the site

Thanks for watching/reading this tutorial, if you have any comments, don't hesitate to post them!