I am getting this error when upgrading:

Initialized Drupal site drupal_upgrade at sites/drupal_upgrade                                                                                                                            [notice]
Command site-upgrade-prepare needs a higher bootstrap level to run - you will need invoke drush from a more functional Drupal environment to run this command.                               [error]
The drush command 'site-upgrade-prepare adminrole admin_menu content email fieldgroup filefield imagefield link linkimagefield nodereference number optionwidgets text userreference         [error]
custom_search custom_search_blocks custom_search_taxonomy date date_api date_locale date_popup date_timezone imageapi imageapi_gd imagecache imagecache_ui markdown spamspan mobile_tools
i18nblocks i18n i18nstrings nodequeue nodequeue_randomizer smartqueue service_links general_services widget_services ed_readmore auto_nodetitle better_formats unlimited_css job_queue
lightbox2 node_adoption pathauto poormanscron quotes config_perms token token_actions transliteration antispam googleanalytics jquery_ui insert_view views views_export views_ui framework
journal-21-mobile' could not be executed.
Drush was not able to start (bootstrap) the Drupal database.                                                                                                                                 [error]
Hint: This error often occurs when Drush is trying to bootstrap a site that has not been installed or does not have a configured database.

Drush was attempting to connect to : 
  Drupal version    : 6.28
  Site URI          : drupal_upgrade
  Database driver   : mysql
  Database hostname : 127.0.0.1
  Database username : drupaluser
  Database name     : drupal_upgrade
  Default theme     : garland
  Administration theme: garland
  PHP configuration : 
  Drush version     : 5.4
  Drush configuration: /Users/username/.drushrc.php
  Drupal root       : /Users/username/Sites/drupal
  Site path         : sites/drupal_upgrade
  Modules path      : sites/all/modules
  Themes path       : sites/all/themes
  %paths            : Array

You can select another site with a working database setup by specifying the URI to use with the --uri parameter on the command line or $options['uri'] in your drushrc.php file.

Command dispatch complete                                                                                                                                                                       [notice]

This is how I call the upgrade:

drush site-upgrade @onward --auto --verbose

And this is my drush.aliases.inc:

<?php

$hosts = '/Users/username/Sites/';
$domain = 'drupal_upgrade';
$alias = 'drupal_upgrade';

$aliases['onward'] = array(
  'root' => '/Users/username/Sites/drupal_upgrade',
  'uri' => 'http://drupal_upgrade:8082',
  'default' =>array (
    'default' =>    array (
      'database' => 'drupal_upgrade',
      'username' => 'drupaluser',
      'password' => '',
      'host' => '127.0.0.1',
      'port' => '33066',
      'driver' => 'mysql',
      'prefix' => '',
    ),
  ),
);
?>

Am I doing something wrong?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Lukas von Blarer’s picture

FileSize
25.43 KB

And this is the full debug output

greg.1.anderson’s picture

Category: bug » support
Status: Active » Fixed

If your source site is defined by the alias @d6, then call site-upgrade like this:

drush @d6 site-upgrade @onward

Alternately, cd to the directory that contains your source sites' settings.php file, and run your site-upgrade command as you were doing before.

Hint: Don't use --auto until you have the basics working! The prompts can be helpful.

Also, I don't see the intended purpose of the following lines; these do nothing.

$hosts = '/Users/username/Sites/';
$domain = 'drupal_upgrade';
$alias = 'drupal_upgrade';
Lukas von Blarer’s picture

FileSize
22.89 KB

Yes, I executed the command in the root directory of the source site.

The three lines at the top don't do anything in the example. I use them locally to set the values of all site aliases. I had to anonymify the scripts to post them on d.o.

I did now try with an alias for the source site as well without the auto option:

drush @d6 site-upgrade @onward --verbose

And it failed again:

You will destroy data from drupal_d6 and replace with data from drupal_d6.

You might want to make a backup first, using the sql-dump command.

Do you really want to continue? (y/n): y
Calling system(mysqldump --result-file /private/tmp/drupal_d6.sql.be6J1o --no-autocommit --single-transaction --opt -Q  drupal_d6 --host=127.0.0.1 --port=33066 --user=drupaluser --password= --skip-extended-insert --order-by-primary );
Calling system(mysql --database=drupal_d6 --host=127.0.0.1 --port=33066 --user=drupaluser --password= --silent < /private/tmp/drupal_d6.sql.be6J1o);
Command dispatch complete                                                                                    [notice]
copy(sites/drupal_d6/settings.php): failed to open stream: Permission denied drush.inc:792             [warning]
Table &#039;drupal_d6.locales_source&#039; doesn&#039;t exist                                          [warning]
query: SELECT s.lid, t.translation, s.version FROM locales_source s LEFT JOIN locales_target t ON s.lid =
t.lid AND t.language = &#039;de&#039; WHERE s.source = &#039;Could not create a temporary multisite &#039;
AND s.textgroup = &#039;default&#039; database.mysqli.inc:134
Table &#039;drupal_d6.locales_source&#039; doesn&#039;t exist                                          [warning]
query: INSERT INTO locales_source (location, source, textgroup, version) VALUES (&#039;/index.php&#039;,
&#039;Could not create a temporary multisite &#039;, &#039;default&#039;, &#039;6.28&#039;)
database.mysqli.inc:134
Table &#039;drupal_d6.cache&#039; doesn&#039;t exist                                                   [warning]
query: DELETE FROM cache WHERE cid LIKE &#039;locale:%&#039; database.mysqli.inc:134
Could not create a temporary multisite                                                                    [error]
Command dispatch complete                                                                                    [notice]
Table &#039;drupal_d6.semaphore&#039; doesn&#039;t exist                                               [warning]
query: DELETE FROM semaphore WHERE value = &#039;429910795162b453d65595.66521659&#039;
database.mysqli.inc:134

It seems to confuse the source and the destination db. After the script finishes both my source and my destination databases are empty.

This is my current aliases file:

<?php

$hosts = '/Users/lukasvonblarer/Sites/';
$domain = 'drupal_upgrade';
$alias = 'drupal_upgrade';

$aliases['onward'] = array(
  'root' => $hosts . $domain,
  'uri' => 'http://' . $alias . ':8082',
  'default' =>array (
    'default' =>    array (
      'database' => 'drupal_upgrade',
      'username' => 'drupaluser',
      'password' => '',
      'host' => '127.0.0.1',
      'port' => '33066',
      'driver' => 'mysql',
      'prefix' => '',
    ),
  ),
);

$aliases['d6'] = array(
  'root' => '/Users/lukasvonblarer/Sites/drupal_d6',
  'uri' => 'http://drupal_d6:8082',
  'default' =>array (
    'default' =>    array (
      'database' => 'drupal_d6',
      'username' => 'drupaluser',
      'password' => '',
      'host' => '127.0.0.1',
      'port' => '33066',
      'driver' => 'mysql',
      'prefix' => '',
    ),
  ),
);
?>

Where could this be coming from?

Lukas von Blarer’s picture

I fixed the permission problem, but the issue still persists. "You will destroy data from drupal_d6 and replace with data from drupal_d6." Something is not right... Again, afterwards both databases are empty.

You will destroy data from drupal_d6 and replace with data from drupal_d6.

You might want to make a backup first, using the sql-dump command.

Do you really want to continue? (y/n): y
Calling system(mysqldump --result-file /private/tmp/drupal_d6.sql.pjcRaI --no-autocommit --single-transaction --opt -Q  drupal_d6 --host=127.0.0.1 --port=33066 --user=drupaluser --password= --skip-extended-insert --order-by-primary );
Calling system(mysql --database=drupal_d6 --host=127.0.0.1 --port=33066 --user=drupaluser --password= --silent < /private/tmp/drupal_d6.sql.pjcRaI);
Command dispatch complete                                                                                   [notice]
Table &#039;drupal_d6.locales_source&#039; doesn&#039;t exist                                         [warning]
query: SELECT s.lid, t.translation, s.version FROM locales_source s LEFT JOIN locales_target t ON s.lid =
t.lid AND t.language = &#039;de&#039; WHERE s.source = &#039;executing !cmd&#039; AND s.textgroup =
&#039;default&#039; database.mysqli.inc:134
Table &#039;drupal_d6.locales_source&#039; doesn&#039;t exist                                         [warning]
query: INSERT INTO locales_source (location, source, textgroup, version) VALUES (&#039;/index.php&#039;,
&#039;executing !cmd&#039;, &#039;default&#039;, &#039;6.28&#039;) database.mysqli.inc:134
Table &#039;drupal_d6.cache&#039; doesn&#039;t exist                                                  [warning]
query: DELETE FROM cache WHERE cid LIKE &#039;locale:%&#039; database.mysqli.inc:134
executing /usr/bin/php /Users/lukasvonblarer/dev/drush/drush.php --php=/usr/bin/php  --invoke --yes         [notice]
--verbose --root=/Users/lukasvonblarer/Sites/drupal_d6 --uri=drupal_d6 site-upgrade-prepare
adminrole admin_menu content email fieldgroup filefield imagefield link linkimagefield nodereference
number optionwidgets text userreference custom_search custom_search_blocks custom_search_taxonomy date
date_api date_locale date_popup date_timezone imageapi imageapi_gd imagecache imagecache_ui markdown
spamspan mobile_tools i18nblocks i18n i18nstrings nodequeue nodequeue_randomizer smartqueue service_links
general_services widget_services ed_readmore auto_nodetitle better_formats unlimited_css job_queue
lightbox2 node_adoption pathauto poormanscron quotes config_perms token token_actions transliteration
antispam googleanalytics jquery_ui insert_view views views_export views_ui framework journal-21-mobile
--uninstall= > `tty` 2>&1
Calling proc_open(/usr/bin/php /Users/lukasvonblarer/dev/drush/drush.php --php=/usr/bin/php  --invoke --yes --verbose --root=/Users/lukasvonblarer/Sites/drupal_d6 --uri=drupal_d6 site-upgrade-prepare adminrole admin_menu content email fieldgroup filefield imagefield link linkimagefield nodereference number optionwidgets text userreference custom_search custom_search_blocks custom_search_taxonomy date date_api date_locale date_popup date_timezone imageapi imageapi_gd imagecache imagecache_ui markdown spamspan mobile_tools i18nblocks i18n i18nstrings nodequeue nodequeue_randomizer smartqueue service_links general_services widget_services ed_readmore auto_nodetitle better_formats unlimited_css job_queue lightbox2 node_adoption pathauto poormanscron quotes config_perms token token_actions transliteration antispam googleanalytics jquery_ui insert_view views views_export views_ui framework journal-21-mobile   --uninstall= > `tty` 2>&1);
Initialized Drupal 6.28 root directory at /Users/lukasvonblarer/Sites/drupal_d6                          [notice]
Initialized Drupal site drupal_d6 at sites/drupal_d6                                                  [notice]
Command site-upgrade-prepare needs a higher bootstrap level to run - you will need invoke drush from a   [error]
more functional Drupal environment to run this command.
The drush command 'site-upgrade-prepare adminrole admin_menu content email fieldgroup filefield          [error]
imagefield link linkimagefield nodereference number optionwidgets text userreference custom_search
custom_search_blocks custom_search_taxonomy date date_api date_locale date_popup date_timezone imageapi
imageapi_gd imagecache imagecache_ui markdown spamspan mobile_tools i18nblocks i18n i18nstrings nodequeue
nodequeue_randomizer smartqueue service_links general_services widget_services ed_readmore auto_nodetitle
better_formats unlimited_css job_queue lightbox2 node_adoption pathauto poormanscron quotes config_perms
token token_actions transliteration antispam googleanalytics jquery_ui insert_view views views_export
views_ui framework journal-21-mobile' could not be executed.
Drush was not able to start (bootstrap) the Drupal database.                                             [error]
Hint: This error often occurs when Drush is trying to bootstrap a site that has not been installed or
does not have a configured database.

Drush was attempting to connect to :
  Drupal version    : 6.28
  Site URI          : drupal_d6
  Database driver   : mysql
  Database hostname : 127.0.0.1
  Database username : drupaluser
  Database name     : drupal_d6
  Default theme     : garland
  Administration theme: garland
  PHP configuration :
  Drush version     : 5.4
  Drush configuration: /Users/lukasvonblarer/.drushrc.php
  Drupal root       : /Users/lukasvonblarer/Sites/drupal_d6
  Site path         : sites/drupal_d6
  Modules path      : sites/all/modules
  Themes path       : sites/all/themes
  %paths            : Array

You can select another site with a working database setup by specifying the URI to use with the --uri
parameter on the command line or $options['uri'] in your drushrc.php file.

Table &#039;drupal_d6.locales_source&#039; doesn&#039;t exist                                         [warning]
query: SELECT s.lid, t.translation, s.version FROM locales_source s LEFT JOIN locales_target t ON s.lid =
t.lid AND t.language = &#039;de&#039; WHERE s.source = &#039;Command dispatch complete&#039; AND
s.textgroup = &#039;default&#039; database.mysqli.inc:134
Table &#039;drupal_d6.locales_source&#039; doesn&#039;t exist                                         [warning]
query: INSERT INTO locales_source (location, source, textgroup, version) VALUES (&#039;/index.php&#039;,
&#039;Command dispatch complete&#039;, &#039;default&#039;, &#039;6.28&#039;) database.mysqli.inc:134
Table &#039;drupal_d6.cache&#039; doesn&#039;t exist                                                  [warning]
query: DELETE FROM cache WHERE cid LIKE &#039;locale:%&#039; database.mysqli.inc:134
Command dispatch complete                                                                                   [notice]
Table &#039;drupal_d6.locales_source&#039; doesn&#039;t exist                                         [warning]
query: SELECT s.lid, t.translation, s.version FROM locales_source s LEFT JOIN locales_target t ON s.lid =
t.lid AND t.language = &#039;de&#039; WHERE s.source = &#039;@size KB&#039; AND s.textgroup =
&#039;default&#039; database.mysqli.inc:134
Table &#039;drupal_d6.locales_source&#039; doesn&#039;t exist                                         [warning]
query: INSERT INTO locales_source (location, source, textgroup, version) VALUES (&#039;/index.php&#039;,
&#039;@size KB&#039;, &#039;default&#039;, &#039;6.28&#039;) database.mysqli.inc:134
Table &#039;drupal_d6.cache&#039; doesn&#039;t exist                                                  [warning]
query: DELETE FROM cache WHERE cid LIKE &#039;locale:%&#039; database.mysqli.inc:134
Table &#039;drupal_d6.locales_source&#039; doesn&#039;t exist                                         [warning]
query: SELECT s.lid, t.translation, s.version FROM locales_source s LEFT JOIN locales_target t ON s.lid =
t.lid AND t.language = &#039;de&#039; WHERE s.source = &#039;@size MB&#039; AND s.textgroup =
&#039;default&#039; database.mysqli.inc:134
Table &#039;drupal_d6.locales_source&#039; doesn&#039;t exist                                         [warning]
query: INSERT INTO locales_source (location, source, textgroup, version) VALUES (&#039;/index.php&#039;,
&#039;@size MB&#039;, &#039;default&#039;, &#039;6.28&#039;) database.mysqli.inc:134
Table &#039;drupal_d6.cache&#039; doesn&#039;t exist                                                  [warning]
query: DELETE FROM cache WHERE cid LIKE &#039;locale:%&#039; database.mysqli.inc:134
Table &#039;drupal_d6.locales_source&#039; doesn&#039;t exist                                         [warning]
query: SELECT s.lid, t.translation, s.version FROM locales_source s LEFT JOIN locales_target t ON s.lid =
t.lid AND t.language = &#039;de&#039; WHERE s.source = &#039;@size GB&#039; AND s.textgroup =
&#039;default&#039; database.mysqli.inc:134
Table &#039;drupal_d6.locales_source&#039; doesn&#039;t exist                                         [warning]
query: INSERT INTO locales_source (location, source, textgroup, version) VALUES (&#039;/index.php&#039;,
&#039;@size GB&#039;, &#039;default&#039;, &#039;6.28&#039;) database.mysqli.inc:134
Table &#039;drupal_d6.cache&#039; doesn&#039;t exist                                                  [warning]
query: DELETE FROM cache WHERE cid LIKE &#039;locale:%&#039; database.mysqli.inc:134
Table &#039;drupal_d6.locales_source&#039; doesn&#039;t exist                                         [warning]
query: SELECT s.lid, t.translation, s.version FROM locales_source s LEFT JOIN locales_target t ON s.lid =
t.lid AND t.language = &#039;de&#039; WHERE s.source = &#039;@size TB&#039; AND s.textgroup =
&#039;default&#039; database.mysqli.inc:134
Table &#039;drupal_d6.locales_source&#039; doesn&#039;t exist                                         [warning]
query: INSERT INTO locales_source (location, source, textgroup, version) VALUES (&#039;/index.php&#039;,
&#039;@size TB&#039;, &#039;default&#039;, &#039;6.28&#039;) database.mysqli.inc:134
Table &#039;drupal_d6.cache&#039; doesn&#039;t exist                                                  [warning]
query: DELETE FROM cache WHERE cid LIKE &#039;locale:%&#039; database.mysqli.inc:134
Table &#039;drupal_d6.locales_source&#039; doesn&#039;t exist                                         [warning]
query: SELECT s.lid, t.translation, s.version FROM locales_source s LEFT JOIN locales_target t ON s.lid =
t.lid AND t.language = &#039;de&#039; WHERE s.source = &#039;@size PB&#039; AND s.textgroup =
&#039;default&#039; database.mysqli.inc:134
Table &#039;drupal_d6.locales_source&#039; doesn&#039;t exist                                         [warning]
query: INSERT INTO locales_source (location, source, textgroup, version) VALUES (&#039;/index.php&#039;,
&#039;@size PB&#039;, &#039;default&#039;, &#039;6.28&#039;) database.mysqli.inc:134
Table &#039;drupal_d6.cache&#039; doesn&#039;t exist                                                  [warning]
query: DELETE FROM cache WHERE cid LIKE &#039;locale:%&#039; database.mysqli.inc:134
Table &#039;drupal_d6.locales_source&#039; doesn&#039;t exist                                         [warning]
query: SELECT s.lid, t.translation, s.version FROM locales_source s LEFT JOIN locales_target t ON s.lid =
t.lid AND t.language = &#039;de&#039; WHERE s.source = &#039;@size EB&#039; AND s.textgroup =
&#039;default&#039; database.mysqli.inc:134
Table &#039;drupal_d6.locales_source&#039; doesn&#039;t exist                                         [warning]
query: INSERT INTO locales_source (location, source, textgroup, version) VALUES (&#039;/index.php&#039;,
&#039;@size EB&#039;, &#039;default&#039;, &#039;6.28&#039;) database.mysqli.inc:134
Table &#039;drupal_d6.cache&#039; doesn&#039;t exist                                                  [warning]
query: DELETE FROM cache WHERE cid LIKE &#039;locale:%&#039; database.mysqli.inc:134
Table &#039;drupal_d6.locales_source&#039; doesn&#039;t exist                                         [warning]
query: SELECT s.lid, t.translation, s.version FROM locales_source s LEFT JOIN locales_target t ON s.lid =
t.lid AND t.language = &#039;de&#039; WHERE s.source = &#039;@size ZB&#039; AND s.textgroup =
&#039;default&#039; database.mysqli.inc:134
Table &#039;drupal_d6.locales_source&#039; doesn&#039;t exist                                         [warning]
query: INSERT INTO locales_source (location, source, textgroup, version) VALUES (&#039;/index.php&#039;,
&#039;@size ZB&#039;, &#039;default&#039;, &#039;6.28&#039;) database.mysqli.inc:134
Table &#039;drupal_d6.cache&#039; doesn&#039;t exist                                                  [warning]
query: DELETE FROM cache WHERE cid LIKE &#039;locale:%&#039; database.mysqli.inc:134
Table &#039;drupal_d6.locales_source&#039; doesn&#039;t exist                                         [warning]
query: SELECT s.lid, t.translation, s.version FROM locales_source s LEFT JOIN locales_target t ON s.lid =
t.lid AND t.language = &#039;de&#039; WHERE s.source = &#039;@size YB&#039; AND s.textgroup =
&#039;default&#039; database.mysqli.inc:134
Table &#039;drupal_d6.locales_source&#039; doesn&#039;t exist                                         [warning]
query: INSERT INTO locales_source (location, source, textgroup, version) VALUES (&#039;/index.php&#039;,
&#039;@size YB&#039;, &#039;default&#039;, &#039;6.28&#039;) database.mysqli.inc:134
Table &#039;drupal_d6.cache&#039; doesn&#039;t exist                                                  [warning]
query: DELETE FROM cache WHERE cid LIKE &#039;locale:%&#039; database.mysqli.inc:134
Table &#039;drupal_d6.locales_source&#039; doesn&#039;t exist                                         [warning]
query: SELECT s.lid, t.translation, s.version FROM locales_source s LEFT JOIN locales_target t ON s.lid =
t.lid AND t.language = &#039;de&#039; WHERE s.source = &#039;Peak memory usage was !peak&#039; AND
s.textgroup = &#039;default&#039; database.mysqli.inc:134
Table &#039;drupal_d6.locales_source&#039; doesn&#039;t exist                                         [warning]
query: INSERT INTO locales_source (location, source, textgroup, version) VALUES (&#039;/index.php&#039;,
&#039;Peak memory usage was !peak&#039;, &#039;default&#039;, &#039;6.28&#039;) database.mysqli.inc:134
Table &#039;drupal_d6.cache&#039; doesn&#039;t exist                                                  [warning]
query: DELETE FROM cache WHERE cid LIKE &#039;locale:%&#039; database.mysqli.inc:134
Table &#039;drupal_d6.semaphore&#039; doesn&#039;t exist                                              [warning]
query: DELETE FROM semaphore WHERE value = &#039;149777180651638db102eb80.98251652&#039;
database.mysqli.inc:134<code>

Lukas von Blarer’s picture

FileSize
32.86 KB

And the full debug log.

greg.1.anderson’s picture

From your logs:

copy(sites/drupal_d6/settings.php): failed to open stream: Permission denied drush.inc:792             [warning]

Make sure that drush_sup can write the settings.php file in the target site.

Lukas von Blarer’s picture

The run in #4 already fixed that, right?

Status: Fixed » Closed (fixed)

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

greg.1.anderson’s picture

Status: Closed (fixed) » Active

Sorry, mis-read the report in #6; this is still active. Have you solved your problem yet? I'm not sure why drush sup is confused about the database name to use for the target. As a test, try removing the database definition from the target alias file, and let drush sup generate the target database name. If that works, then there is a bug in the target alias determination code. I mostly used auto-generated target db names, so that's possible.

Lukas von Blarer’s picture

FileSize
14.96 KB

I was just testing sup for that site... But I ran it again without the database definition and still got errors:

greg.1.anderson’s picture

Status: Active » Postponed (maintainer needs more info)

My best guess is that the user you are running the site upgrade does not have the right to create a new database. Maybe pre-create the database identified in the output at the end of sup.txt in #10, or, failing that, run again in --debug mode, and post output around the area where drush sup is creating the database.