dboettger's Blog

Migrating sites from standalone Drupal to the AEgir hosting system

Posted on: January 27, 2010

As we are decided to use the great AEgir hosting system for all upcoming Drupalprojects i needed to migrate some sites from standalone installations to our new Aegir hosting system.

First i needed to backup the tables in my mysql database. My database’s name was drupal ( not that good idea ) and i was using table prefixes ( this idea was even worse 😉 ).
The tableprefix of the website was website_
Only the tables were exported, not the CREATE DATABASE!
After exporting the tables into the drupal.sql file i opened the file with a editor, searched for website_ and replaced it with an empty string.

I created the folder /var/aegir/drupal-website as user aegir on myaegirHost.

su - aegir
mkdir drupal-website

Then i copied all the content of the drupalfolder from my standalone drupalsystem to my aegirhost.

cd /var/www/drupal
scp -r * aegir@myaegirHost:/var/aegir/drupal-website

Then i needed to copy and import the mysql database.

Source host:
scp drupal.sql aegir@myaegirHost:/var/aegir/

Target host:
mysql -u root -p
GRANT ALL ON drupal.* TO 'drupal'@localhost IDENTIFIED BY 'drupal';
mysql -u root -p -D drupal < drupal.sql

After the database and all the files has been created i created a new platform in Aegir called drupal-website and entered the folder /var/aegir/drupal-website.
Aegir then creates the new platform and imports all sites from the platform.

Then i migrated all the sites to another platform. The manually created database called drupal gets renamed to the Aegir – style site_NUMBER scheme.

If there are any missing modules for a single site (shown under the migration tab), it’s possible to add the modules on a per site base with drush.

su - aegir
cd /var/aegir/drupal-website/sites/website
/var/aegir/drush/drush.php dl modulename

After installing the missing modules it was still showing missing in the Aegir migration tab. I ignored that and clicked on the button migrate. After two minutes the site was moved to the new platform.

If u need any further assistance, don’t hesitate to contact me!




3 Responses to "Migrating sites from standalone Drupal to the AEgir hosting system"

Thank You…
My Web Running This

Hi mate,

I tried this method thinking I was on to a winner, but after the platform was setup, no import of sites happened? Is there something else you need to do to get the import to begin? Your documentation said that it should happen automatically hence why I am asking.

One issue I have been having is when I import a stand alone drupal site to aegir, the sites/default/files and all my image_assist links are broken due to the files missing. If I migrate 20 sites this could become quite a task. 100 sites, forget it! 😦

Could you offer any more advice?

@karudee You should check out aegirs community pages about migrating sites to aegir. You need to manually move your files to a new directory (aegir uses multisite setup).

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s


%d bloggers like this: