I have my blog in Drupal 5.14 that i just installed in a new 5.14 platform (from our old 0.1-dev hostmaster setup to our new 0.2-alpha install, using a crude manual backup/restore hack, which I'll explain later). I deployed a new 5.16 platform and verified it properly, and made sure all modules were present. Then I tried to migrate from 5.14 to 5.16. There was a critical error in the migration script:
Task starts processing
Running: php /var/aegir/drush/drush.php --root='/var/aegir/drupal-5.14' 'provision' 'migrate' 'anarcat.koumbit.org' '/var/aegir/drupal-5.16' --backend
Drush bootstrap phase : _drush_bootstrap_drush()
Drush bootstrap phase : _drush_bootstrap_drupal_root()
Loading drushrc "/srv/aegir/drupal-5.14/drushrc.php" into "drupal" scope.
Initialized Drupal 5.14 root directory at /var/aegir/drupal-5.14
Found command: provision migrate
Initializing drush commandfile: provision_apache
Initializing drush commandfile: provision_drupal
Initializing drush commandfile: provision_mysql
Including /var/aegir/.drush/provision/platform/migrate.provision.inc
Drush bootstrap phase : _drush_bootstrap_drupal_site()
Initialized Drupal site anarcat.koumbit.org at sites/anarcat.koumbit.org
Loading drushrc "/srv/aegir/drupal-5.14/sites/anarcat.koumbit.org/drushrc.php" into "site" scope.
Including /var/aegir/.drush/provision/platform/backup.provision.inc
Including /var/aegir/.drush/provision/db_server/backup.provision.inc
Generating mysql dump for anarcat.koumbit.org.
mysqldump -usite_137_0 -pXXXXXXXXX site_137_0 > sites/anarcat.koumbit.org/database.sql
Adding sites directory to /var/aegir/backups/anarcat.koumbit.org-2009-04-28_3.tar
cd /var/aegir/drupal-5.14/sites/anarcat.koumbit.org; tar -rf /var/aegir/backups/anarcat.koumbit.org-2009-04-28_3.tar *
gzip /var/aegir/backups/anarcat.koumbit.org-2009-04-28_3.tar
Deleted mysql dump from sites directory
Running: php /var/aegir/drush/drush.php --root='/var/aegir/drupal-5.16' --uri='http://anarcat.koumbit.org' 'provision' 'deploy' 'anarcat.koumbit.org' '/var/aegir/backups/anarcat.koumbit.org-2009-04-28_3.tar.gz' --backend
Drush bootstrap phase : _drush_bootstrap_drush()
Drush bootstrap phase : _drush_bootstrap_drupal_root()
Loading drushrc "/srv/aegir/drupal-5.16/drushrc.php" into "drupal" scope.
Initialized Drupal 5.16 root directory at /var/aegir/drupal-5.16
Found command: provision deploy
Initializing drush commandfile: provision_apache
Initializing drush commandfile: provision_drupal
Initializing drush commandfile: provision_mysql
Including /var/aegir/.drush/provision/web_server/deploy.provision.inc
Including /var/aegir/.drush/provision/platform/deploy.provision.inc
Including /var/aegir/.drush/provision/db_server/deploy.provision.inc
Deploying site from /var/aegir/backups/anarcat.koumbit.org-2009-04-28_3.tar.gz
tar -zxf /var/aegir/backups/anarcat.koumbit.org-2009-04-28_3.tar.gz -C /var/aegir/drupal-5.16/sites/anarcat.koumbit.org
Running: tar -zxf /var/aegir/backups/anarcat.koumbit.org-2009-04-28_3.tar.gz -C /var/aegir/drupal-5.16/sites/anarcat.koumbit.org
Successfully extracted the contents of /var/aegir/backups/anarcat.koumbit.org-2009-04-28_3.tar.gz
Drush bootstrap phase : _drush_bootstrap_drupal_site()
Initialized Drupal site anarcat.koumbit.org at sites/anarcat.koumbit.org
Loading drushrc "/srv/aegir/drupal-5.16/sites/anarcat.koumbit.org/drushrc.php" into "site" scope.
Created site_137 database
Found database dump at /var/aegir/drupal-5.16/sites/anarcat.koumbit.org/database.sql.
Database dump at /var/aegir/drupal-5.16/sites/anarcat.koumbit.org/database.sql is readable
Importing database using command: mysql -usite_137 -pXXXXXXX -hmysql.koumbit.net site_137 < /var/aegir/drupal-5.16/sites/anarcat.koumbit.org/database.sql
mysql -usite_137 -pXXXXXXX -hmysql.koumbit.net site_137 < /var/aegir/drupal-5.16/sites/anarcat.koumbit.org/database.sql
Database import failed
An error occurred at function : provision_mysql_provision_deploy
Dropping database site_137
Revoking privileges
Changes for provision_mysql_provision_deploy module have been rolled back.
Deleting sites/anarcat.koumbit.org/modules directory sucessful.
Deleting sites/anarcat.koumbit.org/files/tmp directory sucessful.
Deleting sites/anarcat.koumbit.org/files/pictures directory sucessful.
Deleting sites/anarcat.koumbit.org/files/images directory sucessful.
Deleting sites/anarcat.koumbit.org/files/geshifilter directory sucessful.
Deleting sites/anarcat.koumbit.org/files directory sucessful.
Deleting sites/anarcat.koumbit.org/themes directory sucessful.
Deleting sites/anarcat.koumbit.org directory sucessful.
Changes for provision_drupal_pre_provision_deploy module have been rolled back.
An error occurred at function : provision_drupal_provision_migrate
Removed unused migration site package
Changes for provision_drupal_pre_provision_migrate module have been rolled back.
Removing task from hosting queue
An error occurred at function : hosting_hosting_task
Changes for hosting_hosting_task module have been rolled back.
I am not sure as to why this is failing. One thing that is peculiar about the setup is that /var/aegir is a symlink to /srv/aegir. Another thing is that the modules are all in sites/all/modules in both platforms, but the migrate dialog seems to say that some modules are missing (even though the module list should be the same):
root@ceres:/var/aegir/drupal-5.16/sites/all/modules# ls |wc
46 46 447
root@ceres:/var/aegir/drupal-5.16/sites/all/modules# cd /var/aegir/drupal-5.14/sites/all/modules/
root@ceres:/var/aegir/drupal-5.14/sites/all/modules# ls | wc
46 46 447
Same with themes.
Finally the other peculiar thing about this site is that it was created using the following hack:
* on the old aegir platform, do a backup
* on the new platform, create the site (it will be empty, don't worry)
* on the new platform, do a backup
* transfer the backup from the old platform, copy over the backup in the new platform
* on the new platform, restore that backup
Everything came up normally. It works because the platform was identical (same modules, same database structure, etc).
Maybe that last assumption is false: maybe the database structure has one subtle difference that makes the database load crash...
Comments
Comment #1
anarcat commentedA quick note too:
That's what I get when retrying the task. Looks weird... especially since that doesn't come up in the task log.
Comment #2
anarcat commentedAfter thorough debugging, i ended up against the usual Drush wall. It seems that somehow the drush_shell_exec() function fails to call my mysql command properly.
I have tried the following patch on drush to see which commands were being executed exactly:
Nasty, i know, but farily effective. My foobar file holds the following commands:
Which basically means that the mysql load is simply not happening and is breaking before getting to that print...
Something weird is happening here.
Comment #3
anarcat commentedI found the issue! The mysqldump doesn't use the -h flag.
That yield a very funny result: the content of the database dump is:
... that's rather annoying. It's because of the way drush redirects stderr into stdout. That should be worked around, probably by telling mysqldump to directly write to the file without shell redirection.
Comment #4
anarcat commentedSo that was it. I committed a fix to take into account the db_host in mysqldumps. I hope that doesn't break localhost, but i don't think so since it's being used everywhere else.
I also committed a patch to use -r instead of stdout redirection to properly catch errors from mysqldump next time round.
Comment #6
anarcat commentedtagging this old issue