• Migration of Icarus to MayFirst

  last modified July 12, 2007 by scottle

The MayFirst migration is complete. Notes by Scott Lahteine....

The Icarus site migration and upgrade process began on 22 May 2007, and was completed on 12 July 2007. It was initially assumed we would upgrade the site to Drupal 5.1 first, then complete the migration. However it proved much simpler to upgrade the site to 4.7.6 and go ahead with the migration a bit earlier. (A 5.1 upgrade is being staged on my home server, and to this end I've collected all the 3rd-party modules currently available - that is to say, almost all. Among those modules which Icarus uses, but which lack a 5.1 version: im, image_pub, and taxonomy_browser. The upgrade will commence when suitable substitutes are found - or if these modules are nonessential.) More upgrade details will follow as I go forward, but let's get on with the migration notes....

The migration process involved a lot of up-front testing of the site after it was initially copied to icarus.mayfirst.org. Several problems were encountered during this trial, all of which have been overcome.

There was a period where a bug in the session code prevented administrator login. This was solved by the upgrade to 4.7.6. Several of the menus in the old site held absolute paths to theicarusproject.net (not a big deal once the server is switched over). I made all menu items into relative links on the live site prior to migration so that when the database was copied the site would work no matter what the domain. Also the "sites/www.icarusproject.net" folder was renamed "sites/default" to make the site server-agnostic.

CiviCRM posed some problems as well, which were fixed through a little PHP code. First, CiviCRM had hard-coded the server domain in a serialized array, so this had to be modified using PHP and MySQL. Finally, CiviCRM's Smarty Template Cache files (in the "files" folder) were also problematic. A PHP script was necessary to remove them due to their ownership by Apache.

The day before the final migration all the necessary email accounts were created and all their passwords set to a single value. When the site switches over, all those persons attempting to fetch or send email via theicarusproject.net - with the exception of people receiving forwarded email - will need to reconfigure their email clients and change their email passwords.

With everything in-place, the following steps were performed to complete the migration:

Old Server:

  • Login at theicarusproject.net and set Maintenance Mode
  • ssh scottl@theicarusproject.net
  • cd /www
  • mv community community-hide
  • mysql -uproduser -p icarus_prod_drupal
  • mysql> delete from watchdog; delete from cache; delete from accesslog; delete from sessions;
  • mysql> drop table phpbb2drupal_temp_forum; (and phpbb2drupal_temp_post, phpbb2drupal_temp_topic, phpbb2drupal_temp_user)
  • CTRL-D (exit)
  • cd /www/drupal
  • mysqldump -uroot -p(password) phpbb2 >~/Documents/phpbb2-migration.sql
  • mysqldump -uproduser -p(password) icarus_prod_drupal >~/Documents/drupal-migration.sql
  • tar -czf ~/Documents/files-migration.tgz files
  • cd ../community-hide
  • tar -czf ~/Documents/discussionboards-migration.tgz discussionboards
  • cd ~/Documents
  • tar -czf icarus-database.tgz drupal-migration.sql phpbb2-migration.sql
  • scp icarus-database.tgz files-migration.tgz discussionboards-migration.tgz icarus@icarus.mayfirst.org:
  • CTRL-D (logout)

New Server:

  • ssh icarus@icarus.mayfirst.org
  • mkdir migration
  • mv *.tgz migration/
  • cd migration/
  • tar -xzf files-migration.tgz
  • tar -xzf discussionboards-migration.tgz
  • tar -xzf icarus-database.tgz
  • chmod -R 777 files discussionboards/files discussionboards/cache
  • vi drupal-migration.sql (Add line "SET FOREIGN_KEY_CHECKS=0;" save and exit)
  • vi phpbb2-migration.sql (Add line "SET FOREIGN_KEY_CHECKS=0;" save and exit)
  • cd ../icarusproject.net/users/icarus/icarusproject.net/web
  • mv files ~/migration/drupal-files-before
  • mv ~/migration/files .
  • rm -rf community
  • mkdir -p community
  • mv ~/migration/discussionboards community/
  • mysql -u icarusproject -p icarusproject
  • mysql> SET FOREIGN_KEY_CHECKS=0;
  • mysql> drop table if exists access;
  • mysql> drop table if exists accesslog;
  • (etc... drop every single table)
  • CTRL-D (exit)
  • mysql -u icarusproject -p icarusproject <drupal-migration.sql
  • mysql -u icarusproject -p icarusproject <phpbb2-migration.sql
  • mysql -u icarusproject -p icarusproject
  • mysql> UPDATE system SET filename=REPLACE(filename, 'sites/www.theicarusproject.net/modules', 'sites/default/modules');
  • exit
  • FTP: Edit update.php, setting $access_check to FALSE
  • BROWSER: http://icarus.mayfirst.org/update.php (upgrade the database for Drupal 4.7.6)
  • FTP: Edit update.php, setting $access_check to TRUE
  • BROWSER: http://icarus.mayfirst.org/user (log in and turn off Maintenance Mode)

Final Migration Steps:

  • Log in to https://theicarusproject.net:2087/ and Edit DNS Zone
  • Change NS Records to a.ns.mayfirst.org / b.ns.mayfirst.org
  • Change MX Record to malcolm.mayfirst.org (probably unnecessary)
  • Remaining CNAME and A records were left as-is



Previous Notes:

The "launch" of stage.theicarusproject.net

Here we will create a brand new production instance of new drupal site, leave staging site intact for development, and retire the old picora site. PHPBB Discussion will remain (seamlessly intact).


  1. upgrade to drupal 4.7.4?
  2. move ryans 2 custom modules into svn and their proper home
  3. password protect both staging and lives sites. we do this so we can upgrade in peace, but still give users friendly message
  4. backup stage_drupal
  5. copy entire code base of /www-stage/drupal to /www/drupal
  6. figure out where to stash picora and linda's drupal - how about archive.theicarusproject.net (cpanel subdomain creation?)
  7. msysql dump drupal_stage
  8. search and replace dump for occurances of stage.theicaurproject.net url, hardcoded into some content accidentally by tinymce
  9. clean up extraneous mysql databases. linda's drupal
  10. create new drupal production database. Grant perms
  11. import drupal_stage to drupal_prod
  12. change conf files to new settings
  13. adjust apache rewrite rules to accomodate both drupal and phpbb
  14. remove basic auth
  15. pop the cork?