I am trying to upgrade my Aegir platform from Drupal 5.13 to 5.17. I have been recommended the following steps by Adrian:

15:24:28 <@anarcat> hostmaster@hostmaster:/var/hostmaster$ ./drush/drush.php dl drupal-5.17 --package-handler=cvs
15:24:39 <@anarcat> hostmaster@hostmaster:/var/hostmaster$ mv drupal drupal-5.17
15:25:10 <@anarcat> hostmaster@hostmaster:/var/hostmaster$ crontab -e 
15:32:53 <@anarcat> hostmaster@hostmaster:~/drupal-5.x$ /var/hostmaster/drush/drush.php --root=/var/hostmaster/drupal-5.x --verbose=2 provision migrate default /var/hostmaster/drupal-5.17/

The actual output is this:

hostmaster@hostmaster:~/drupal-5.x$ /var/hostmaster/drush/drush.php --root=/var/hostmaster/drupal-5.x --verbose=2 provision migrate default /var/hostmaster/drupal-5.17/
Drush bootstrap phase : _drush_bootstrap_drupal_root()                                                                          [bootstrap]
Loading drushrc "/var/hostmaster/drupal-5.x/drushrc.php" into "drupal" scope.                                                   [bootstrap]
Initialized Drupal 5.14 root directory at /var/hostmaster/drupal-5.x                                                            [notice]
Found command: provision migrate                                                                                                [bootstrap]
Initializing drush commandfile: provision_mysql                                                                                 [bootstrap]
Initializing drush commandfile: provision_apache                                                                                [bootstrap]
Initializing drush commandfile: provision_drupal                                                                                [bootstrap]
Including /var/hostmaster/.drush/provision/platform/migrate.provision.inc                                                       [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_site()                                                                          [bootstrap]
Initialized Drupal site default at sites/default                                                                                [notice]
Including /var/hostmaster/.drush/provision/db_server/backup.provision.inc                                                       [bootstrap]
Including /var/hostmaster/.drush/provision/platform/backup.provision.inc                                                        [bootstrap]
PROVISION_DRUPAL_SITE_FOUND                                                                                                     [error]
An error occurred at function : provision_drupal_provision_backup_validate                                                      [error]
An error occurred at function : provision_drupal_pre_provision_migrate                                                          [error]
Could not remove unused migration site package                                                                                  [warning]
Changes for provision_drupal_pre_provision_migrate module have been rolled back.                                                [rollback]

Weird, it looks like it can't find the base site.

Comments

anarcat’s picture

Title: cannot provision migrate without hosting frontend » cannot provision migrate default site

So I first need to add the platform to aegir (duh) and import the "default" site:

hostmaster@hostmaster:~/drupal-5.x$ /var/hostmaster/drush/drush.php --root=/var/hostmaster/drupal-5.x --verbose=2 provision import default
anarcat’s picture

import doesn't create the drushrc.php:


hostmaster@hostmaster:~/drupal-5.x$ /var/hostmaster/drush/drush.php --root=/var/hostmaster/drupal-5.x --verbose=2 provision import default
Drush bootstrap phase : _drush_bootstrap_drupal_root()                                                                          [bootstrap]
Loading drushrc "/var/hostmaster/drupal-5.x/drushrc.php" into "drupal" scope.                                                   [bootstrap]
Initialized Drupal 5.14 root directory at /var/hostmaster/drupal-5.x                                                            [notice]
Found command: provision import                                                                                                 [bootstrap]
Initializing drush commandfile: provision_mysql                                                                                 [bootstrap]
Initializing drush commandfile: provision_apache                                                                                [bootstrap]
Initializing drush commandfile: provision_drupal                                                                                [bootstrap]
Including /var/hostmaster/.drush/provision/platform/import.provision.inc                                                        [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_site()                                                                          [bootstrap]
Initialized Drupal site default at sites/default                                                                                [notice]
Drush bootstrap phase : _drush_bootstrap_drupal_configuration()                                                                 [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_database()                                                                      [bootstrap]
Successfully connected to the Drupal database.                                                                                  [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_full()                                                                          [bootstrap]
Including version specific file : /var/hostmaster/.drush/provision/platform/drupal/import_5.inc                                 [notice]
anarcat’s picture

Status: Active » Needs work

So the import issue was fixed: #453538: cannot import default site.

I still have no luck migrating the site. The migrate task fails and the site is then broken:

Fatal error: Call to undefined function drupal_get_path() in /var/hostmaster/drupal-5.x/profiles/hostmaster/modules/hosting/dns_server/hosting_dns.module on line 13

Lovely. Here's the error log:

hostmaster@hostmaster:~/drupal-5.x$ /var/hostmaster/drush/drush.php --root=/var/hostmaster/drupal-5.x --verbose=2 provision migrate default /var/hostmaster/drupal-5.17/
Drush bootstrap phase : _drush_bootstrap_drupal_root()                                                                          [bootstrap]
Loading drushrc "/var/hostmaster/drupal-5.x/drushrc.php" into "drupal" scope.                                                   [bootstrap]
Initialized Drupal 5.14 root directory at /var/hostmaster/drupal-5.x                                                            [notice]
Found command: provision migrate                                                                                                [bootstrap]
Initializing drush commandfile: provision_mysql                                                                                 [bootstrap]
Initializing drush commandfile: provision_apache                                                                                [bootstrap]
Initializing drush commandfile: provision_drupal                                                                                [bootstrap]
Including /var/hostmaster/.drush/provision/platform/migrate.provision.inc                                                       [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_site()                                                                          [bootstrap]
Initialized Drupal site default at sites/default                                                                                [notice]
Loading drushrc "/var/hostmaster/drupal-5.x/sites/default/drushrc.php" into "site" scope.                                       [bootstrap]
Including /var/hostmaster/.drush/provision/db_server/backup.provision.inc                                                       [bootstrap]
Including /var/hostmaster/.drush/provision/platform/backup.provision.inc                                                        [bootstrap]
Generating mysql dump for default.                                                                                              [backup]
mysqldump -hlocalhost -uhostmaster -pXXXXX -rsites/default/database.sql hostmaster                                       [notice]
Executing: mysqldump -hlocalhost -uhostmaster -pXXXXX -rsites/default/database.sql hostmaster
Adding sites directory to /var/hostmaster/backups/default-2009-05-04.tar                                                        [backup]
cd /var/hostmaster/drupal-5.x/sites/default; tar -rf /var/hostmaster/backups/default-2009-05-04.tar *                           [notice]
Executing: cd /var/hostmaster/drupal-5.x/sites/default; tar -rf /var/hostmaster/backups/default-2009-05-04.tar * 
Deleted mysql dump from sites directory                                                                                         [message]
gzip /var/hostmaster/backups/default-2009-05-04.tar                                                                             [notice]
Executing: gzip /var/hostmaster/backups/default-2009-05-04.tar
Running: php /var/hostmaster/drush/drush.php  --root='/var/hostmaster/drupal-5.17/' --uri='http://default'  'provision' 'deploy'[command]
'default' '/var/hostmaster/backups/default-2009-05-04.tar.gz' --backend

Warning: array_keys(): The first argument should be an array in /var/hostmaster/.drush/provision/platform/deploy.provision.inc on line 44

Warning: array_merge(): Argument #1 is not an array in /var/hostmaster/.drush/provision/platform/deploy.provision.inc on line 49

Warning: array_merge(): Argument #2 is not an array in /var/hostmaster/.drush/provision/platform/deploy.provision.inc on line 49

Warning: Invalid argument supplied for foreach() in /var/hostmaster/.drush/provision/platform/deploy.provision.inc on line 50
Drush bootstrap phase : _drush_bootstrap_drush()                                                                                [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_root()                                                                          [bootstrap]
Loading drushrc "/var/hostmaster/drupal-5.17/drushrc.php" into "drupal" scope.                                                  [bootstrap]
Initialized Drupal 5.17 root directory at /var/hostmaster/drupal-5.17/                                                          [notice]
Found command: provision deploy                                                                                                 [bootstrap]
Initializing drush commandfile: provision_mysql                                                                                 [bootstrap]
Initializing drush commandfile: provision_apache                                                                                [bootstrap]
Initializing drush commandfile: provision_drupal                                                                                [bootstrap]
Including /var/hostmaster/.drush/provision/db_server/deploy.provision.inc                                                       [bootstrap]
Including /var/hostmaster/.drush/provision/web_server/deploy.provision.inc                                                      [bootstrap]
Including /var/hostmaster/.drush/provision/platform/deploy.provision.inc                                                        [bootstrap]
Deploying site from /var/hostmaster/backups/default-2009-05-04.tar.gz                                                           [message]
tar -zxf /var/hostmaster/backups/default-2009-05-04.tar.gz -C /var/hostmaster/drupal-5.17/sites/default                         [notice]
Running: tar -zxf /var/hostmaster/backups/default-2009-05-04.tar.gz -C /var/hostmaster/drupal-5.17/sites/default                [notice]
Successfully extracted the contents of /var/hostmaster/backups/default-2009-05-04.tar.gz                                        [message]
Drush bootstrap phase : _drush_bootstrap_drupal_site()                                                                          [bootstrap]
Initialized Drupal site default at sites/default                                                                                [notice]
Loading drushrc "/var/hostmaster/drupal-5.17/sites/default/drushrc.php" into "site" scope.                                      [bootstrap]
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use[error]
near 'default' at line 1
query: CREATE DATABASE default
Unable to create new databases.                                                                                                 [error]
Database could not be created.                                                                                                  [error]
Found database dump at /var/hostmaster/drupal-5.17/sites/default/database.sql.                                                  [message]
Database dump at /var/hostmaster/drupal-5.17/sites/default/database.sql is readable                                             [message]
Importing database using command: mysql -udefault -pXXXXX -hlocalhost default <                                            [notice]
/var/hostmaster/drupal-5.17/sites/default/database.sql
mysql -udefault -pXXXXX -hlocalhost default < /var/hostmaster/drupal-5.17/sites/default/database.sql                       [notice]
Database import failed                                                                                                          [error]
An error occurred at function : provision_mysql_provision_deploy                                                                [error]
Revoking privileges                                                                                                             [notice]
There is no such grant defined for user 'default' on host '%'                                                                   [error]
query: REVOKE ALL PRIVILEGES ON `default`.* FROM `default`@`%`
Failed to revoke user privileges                                                                                                [warning]
Changes for provision_mysql_provision_deploy module have been rolled back.                                                      [rollback]
Deleting sites/default/modules directory sucessful.                                                                             [message]
Deleting sites/default/themes directory sucessful.                                                                              [message]
Deleting sites/default/CVS directory sucessful.                                                                                 [message]
Deleting sites/default/files/images directory sucessful.                                                                        [message]
Deleting sites/default/files/tmp directory sucessful.                                                                           [message]
Deleting sites/default/files/pictures directory sucessful.                                                                      [message]
Deleting sites/default/files directory sucessful.                                                                               [message]
Deleting sites/default directory sucessful.                                                                                     [message]
Changes for provision_drupal_pre_provision_deploy module have been rolled back.                                                 [rollback]
An error occurred at function : provision_drupal_provision_migrate                                                              [error]
Removed unused migration site package                                                                                           [message]
Changes for provision_drupal_pre_provision_migrate module have been rolled back.                                                [rollback]

Looks like the "nice db name" code is kicking in.

In the meantime I committed some documentation to UPGRADE.txt on how to do this.

anarcat’s picture

I fixed my (really) broken drupal by commenting out the offending line, resaving the module page and restoring the files.

Otherwise I'll try running the migrate command with a proper site-id (i guess?!).

anarcat’s picture

Status: Needs work » Fixed

So I fixed this with the help of Adrian. The issue was that the mysql code wasn't looking at the actual DB settings for sites that don't have an id registered on the frontend.

anarcat’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.