Hi,
I tried to upgrade and stopped on 12 step with following error:
----------------------------------------
UPGRADE.txt Major Upgrade Step 12-a
12-a. Drush-specific step: Drush will now do steps 5 and 6 of UPGRADE.txt,
and set the site theme to Garland and disable all contrib modules. Before
it does this, it makes a copy of your database, and does all modifications
on the *copy*, leaving your source site unchanged. Drush will also
uninstall all modules specified via the --uninstall option at this time.
Drush will automatically do this step now.
You will destroy data from p37_sp and replace with data from db2_sp.
You might want to make a backup first, using the sql-dump command.
Do you really want to continue? (y/n): y
Table 'p37_sp.Arrayaccess' doesn't exist [warning]
query: SELECT 1 FROM Arrayaccess WHERE type = 'host' AND
LOWER('127.0.0.1') LIKE LOWER(mask) AND status = 0 LIMIT 0,
1 database.mysqli.inc:134
Table 'p37_sp.Arraycache' doesn't exist [warning]
query: SELECT data, created, headers, expire, serialized FROM
Arraycache WHERE cid = 'variables' database.mysqli.inc:134
Table 'p37_sp.Arrayvariable' doesn't exist [warning]
query: SELECT * FROM Arrayvariable database.mysqli.inc:134
Table 'p37_sp.Arraycache' doesn't exist [warning]
query: UPDATE Arraycache SET data = '', created =
1338119622, expire = 0, headers = '', serialized = 0 WHERE
cid = 'variables' database.mysqli.inc:134
Table 'p37_sp.Arraysystem' doesn't exist [warning]
query: SELECT name, filename, throttle FROM Arraysystem WHERE type =
'module' AND status = 1 AND bootstrap = 1 ORDER BY weight
ASC, filename ASC database.mysqli.inc:134
Table 'p37_sp.Arrayurl_alias' doesn't exist [warning]
query: SELECT COUNT(pid) FROM Arrayurl_alias database.mysqli.inc:134
Table 'p37_sp.Arraysystem' doesn't exist [error]
query: SELECT name, filename, throttle FROM Arraysystem WHERE type =
'module' AND status = 1 ORDER BY weight ASC,
filename ASC in
/home/webmaster/domains/test/html/includes/module.inc on line
63.
---------------------------
I checked : Tables cache, system and others exists . Looks like problem with adding 'Array' to tables names.
Comment | File | Size | Author |
---|---|---|---|
#10 | array_db_prefix.patch | 918 bytes | ehowland |
Comments
Comment #1
greg.1.anderson CreditAttribution: greg.1.anderson commentedCould you show the output for
drush status
anddrush sql-conf
for both your source and target sites? Showing your database records from settings.php would also be helpful, if sql-conf does not print them with full fidelity.Comment #2
Oleksa-1 CreditAttribution: Oleksa-1 commentedI think the reason is that source site is in multi-site with shared tables. And solution in my case to change settings.php in source site to remove data about shared tables from $db_prefix and leave it like this $db_prefix = '';
root@tratim:/home/webmaster/domains/test.com/html/sites/sp.test.com# drush status
Drupal version : 6.26
Site URI : http://sp.test.com
Database driver : mysqli
Database hostname : localhost
Database username : webmaster
Database name : testsp
Database : Connected
Drupal bootstrap : Successful
Drupal user : п?п+я¦я-я-
Default theme : pmsp
Administration theme : pmsp
PHP configuration : /etc/php5/cli/php.ini
Drush version : 5.1
Drush configuration :
Drush alias files : /usr/share/php/drush/includes/../aliases.drushrc.php
Drupal root : /home/webmaster/domains/test.com/html
Site path : sites/sp.test.com
File directory path : sites/sp.test.com/files
=============================
root@tratim:/home/webmaster/domains/test.com/html/sites/sp.test.com# drush sql-conf
Array
(
[driver] => mysql
[username] => webmaster
[port] =>
[host] => localhost
[database] => testsp
[db_prefix] => Array
(
[default] =>
[users] => test.
[sessions] => test.
[profile_fields] => test.
[profile_values] => test.
)
)
==================================================
Comment #3
greg.1.anderson CreditAttribution: greg.1.anderson commentedYes; it appears that Drush in general, and Drush Site Upgrade in particular do not support "array" values for db_prefix. Patches welcome, although fixes are likely to span both drush_sup and drush projects.
Comment #4
BrightBoldI think the problem here is mysqli and not database prefixing. I'm getting a very similar error but am not using shared tables. Here's my error:
These are all the same tables generating errors for Oleksa, with the addition of theme_registry. I also got that "The syntax of the command is incorrect." error at the beginning.
Since I wasn't using prefixing, I tried to figure out what else our situations had in common, and noticed that you were also using mysqli. When I changed my settings.php in both the source and destination sites to
$db_url = 'mysql:' [etc]
, the process made it past step 12-a without errors.Note: I modified the issue name but left the original included because I know this is linked from the project page, and it's of course possible we have similar errors with different causes. It sounded as if Oleska fixed his/her error by removing the db prefix, so let me know if you want me to file a separate issue.
Comment #5
greg.1.anderson CreditAttribution: greg.1.anderson commentedI think that #4 is a completely different issue with similar error messages.
Can you use sql-sync to copy your database from one copy of the site to the other? site-upgrade is just calling through to Drush sql-sync here; if there is a problem with mysqli, it should be fixed in Drush.
Comment #6
BrightBoldSorry to compound two different issues. I'll try a sql-sync test using mysqli later — if that fails should I file a Drush issue?
Comment #7
greg.1.anderson CreditAttribution: greg.1.anderson commentedYes, please -- but search the issue queue for duplicates first, this may have come up before.
Comment #8
distanceroller CreditAttribution: distanceroller commentedIn my case drush sql-sync works perfectly. I am having problems when I try the site-upgrade:
drush site-upgrade @mysite @onward
Table 'rollthew_drupal.roll_access' doesn't exist [warning]
query: SELECT 1 FROM roll_access WHERE type = 'host' AND LOWER('127.0.0.1') LIKE LOWER(mask) AND status = 0 LIMIT 0, 1 database.mysqli.inc:134
Table 'rollthew_drupal.roll_cache' doesn't exist [warning]
query: SELECT data, created, headers, expire, serialized FROM roll_cache WHERE cid = 'variables' database.mysqli.inc:134
Table 'rollthew_drupal.roll_variable' doesn't exist [warning]
query: SELECT * FROM roll_variable database.mysqli.inc:134
Table 'rollthew_drupal.roll_cache' doesn't exist [warning]
query: UPDATE roll_cache SET data = '', created = 1363958174, expire = 0, headers = '', serialized = 0 WHERE cid = 'variables'
database.mysqli.inc:134
Table 'rollthew_drupal.roll_system' doesn't exist [warning]
query: SELECT name, filename, throttle FROM roll_system WHERE type = 'module' AND status = 1 AND bootstrap = 1 ORDER BY weight ASC, filename ASC
database.mysqli.inc:134
Table 'rollthew_drupal.roll_url_alias' doesn't exist [warning]
query: SELECT COUNT(pid) FROM roll_url_alias database.mysqli.inc:134
Table 'rollthew_drupal.roll_system' doesn't exist [error]
query: SELECT name, filename, throttle FROM roll_system WHERE type = 'module' AND status = 1 ORDER BY weight ASC, filename ASC in
/Applications/MAMP/htdocs/includes/module.inc on line 63.
Table 'rollthew_drupal.roll_system' doesn't exist [warning]
query: SELECT * FROM roll_system WHERE type = 'theme' database.mysqli.inc:134
Table 'rollthew_drupal.roll_cache' doesn't exist [warning]
query: SELECT data, created, headers, expire, serialized FROM roll_cache WHERE cid = 'theme_registry:' database.mysqli.inc:134
Table 'rollthew_drupal.roll_cache' doesn't exist [warning]
query: UPDATE roll_cache SET data = 'a:0:{}', created = 1363958174, expire = 0, headers = '', serialized = 1 WHERE cid =
'theme_registry:' database.mysqli.inc:134
Command site-upgrade needs the following modules installed/enabled to run: update. [error]
The drush command 'site-upgrade @mysite @onward' could not be executed.
Comment #9
greg.1.anderson CreditAttribution: greg.1.anderson commentedI think you've run into the same limitation as #2. Note that I have upgraded a single site with a database prefix, so I don't think that is the full extent of the problem, but it is related.
Patches welcome, and sorry for the inconvenience.
Comment #10
ehowland CreditAttribution: ehowland commentedI was getting errors like:
In my settings.php my $db_prefix value started like this:
The attached patch allows the upgrade to go forward and logs an error. The error does not show up on the screen however suggesting I should not be using drush_log.
Comment #11
greg.1.anderson CreditAttribution: greg.1.anderson commentedUntil array-style db prefix records are supported, it would be better to halt the upgrade via
return drush_set_error(...);
. The upgrade does not work correctly when the $db_prefix is an array, does it?As for your drush_log not showing up, the default log type is 'notice', which does not show up by default (need to be running in --debug or --verbose mode to see those). When printing log messages that are not fatal, use the 'warning' log type, which is always displayed.
Comment #12
ehowland CreditAttribution: ehowland commentedIn my case, this works as well as I expect. All the entries in db_prefix were related to CiviCRM and so they did not affect the upgrade. I guess in most cases, people would not be so lucky.
I did not expect site-upgrade to also upgrade CiviCRM - although maybe it could chain to the upgrade tools the CiviCRM folks have built into drush. But actually a CiviCRM upgrade is such an involved and fragile process I would not recommend it even if theoretically possible.
So maybe you are correct. On finding an array, it should just stop and tell the human to fix it. I did much of my migration after backing up settings.php and deleting $db_prefix. But then I got thinking about where Array came from and that led to this simplistic patch.
So I agree, while in my case, this behavior was better, in the general case, it would be better to stop the upgrade with a message. I do think providing an alternative to abandoning Site Upgrade would be valuable. Maybe something like:
Comment #13
greg.1.anderson CreditAttribution: greg.1.anderson commentedThe message in #12 looks good. It is unlikely that I will ever have time to support $db_prefix here, but would certainly accept patches from anyone who wanted to tackle it.
Comment #13.0
greg.1.anderson CreditAttribution: greg.1.anderson commentedcode tag added