Hi,
I am trying to upgrade my drupal 6.20 site to drupal 7 using drush.
I used the command:
drush site-upgrade @self
and I get the following mysql error:
ERROR 1044 (42000) at line 1: Access denied for user 'drpl1'@'localhost' to database 'drpl1'
I thought the problem was that I was not logged as the sql user. So, I used the following command:
drush site-upgrade @self --db-su=drpl1 --db-su-pw=secretpassword
and now I get the following error:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
I am logged as root, what should I do ??
Thanks
Alexandre Amato
www.amato.com.br
Comments
Comment #1
greg.1.anderson commentedNote that the alias specified to the site-upgrade command should point to the destination site. The source of the site upgrade is always @self. It is not valid to say
drush site-upgrade @self, because the destination of the site upgrade must be a different site than the source.I was looking at this a bit last night, and it seems that site upgrade still is not working. I got to the point where settings.php is being created. There is some code in the function
drush_upgrade_fix_db_urlthat reads as follows:The thing is, though, that drush_drupal_major_version() operates on the bootstrapped site, which is the source site, which in this case is Drupal 6, so it makes a $db_url. It seems that this test should be on the Drupal version of the destination site -- in this case, Drupal 7, which is to say that it should make the $databases record instead.
I didn't fully track this down though; I will return to it again later.
Comment #2
moshe weitzman commentedIIRC, drupal7 will upgrade just fine using a DB6 style settings.php. In that case, Drupal reads out the info it needs and then appends a long form $databases array to settings.php.
Comment #3
greg.1.anderson commentedOkay, cool, thank you. I guess then my problem is that my db_url was not being composed correctly. I'll keep investigating; this may be a different issue than the OP's, who, it seems, has mysql permission issues.
site-upgrade worked for me in the past; still might be a user error.
Comment #4
greg.1.anderson commentedHere are some suggested improvements for site-upgrade
drush @source site-upgrade ...instead ofdrush --root=... --uri=... site-upgrade ...then the sql-sync will always fail. I'm sure this used to work in the past, but now what is going on is that sup calls sql-sync with the source "@self", but now the @self record is a bit smarter than it used to be, and it knows its original name. The database is fetched and stored under the cache under the original name, and sql-sync fails to find it under "@self". The db-fetch-and-cache code needs to get a little smarter to keep up with other changes in the code.I will continue to work on these, esp. the last one.
Edit: Change to an ordered list above. A patch to fix #4 is in #1040052: self alias caching
Comment #5
greg.1.anderson commentedThis patch improves the error reporting per items 1-3 in #4, above. n.b. item 4 in #4 was committed as part of #1040052: self alias caching.
Regarding the missing $db_url in the target alias, site-upgrade will now use the target alias name as a basis to generate a database name if one is not provided, logging a warning if it does so.
Edit: Note that some of the changed lines in includes/sitealias.inc are simply the removal of tabs.
Comment #6
moshe weitzman commenteddebug line?
Are we trying to make this work for D5 => D6 upgrade? Not worth the support hassle, IMO. Or we don't mean 'target' here.
Comment #7
greg.1.anderson commentedActually #5 is broken. :( Working on it...
Comment #8
greg.1.anderson commentedI ran into some issues with site-upgrade that were inconvenient at times. For example:
If you followed the instructions in UPGRADE.txt, then site-upgrade worked fine, but I wanted it to be a bit more automated, so I can run through my site upgrades without having to step through UPGRADE.txt like a recipe book. I don't want to take my site offline and disable all of my non-core modules by hand. Drush should follow the instructions for us!
This patch does in fact straighten out a lot of the issues, and makes site-upgrades go a lot more smoothly with less preparation. There is documentation in the code, but the changes include:
Also attached to this issue are the scripts I used to test this. Customize the 00-00 script to your environment. Yes, I should use the unit-testing framework... If you run the scripts, you will see drupal-6.20 downloaded, and a couple of modules added to it prior to a site-upgrade to 7.x-dev. The updatedb operation for the views module emits a bunch of spurious warnings, but I believe this is a normal situation for a views-7.x upgrade.
As you might guess from the description, this patch is kind of large -- regrettable, but these issues were all interrelated, and needed to be fixed together to make site-upgrade breeze through complex upgrade dependencies without causing a lot of head scratching. There is more work to be done, e.g. integration with #1043922: drush_backend_set_result() can be overwritten, but it's at a point where it's ready for review and input.
Comment #9
moshe weitzman commentedWow. Making site-upgrade more user friendly is a terrific goal.
I actually finished unit tests for site-upgrade yesterday. See https://github.com/Cyrve/Drush-PHPUnit/blob/master/siteUpgradeTest.php
With this patch applied, the test still passes so we are off to a great start. We aren't done because site-upgrade crashes on an infinite loop in drush_upgrade_order_extensions(). Maybe it is because I have a completely virgin D6 site?
#4 is the only point I object to. Ordering of update functions is the responsibility of contrib modules. New in D7 is the ability for update functions to depend on other update functions. It sounds like a dependency is not working in your pathauto/token scenario. Given the existence of dependencies, I think it should be possible to run updatedb once, against both core and contrib modules. But I am OK with breaking that apart for clarity.
I will review the code ASAP.
-moshe
Comment #10
greg.1.anderson commentedI could not reproduce the infinite loop. This could happen if you have modules that declare circular dependencies.
Also, I tried removing the call to reorder the extensions, and found that the upgrade still worked fine. I'm pretty sure I was having problems updating pathauto before token before; I don't know.
Will keep working on this.
Comment #11
moshe weitzman commentedCode looks good to me. Get rid of the ordering and perhaps we have a winner. Do we really need run updatedb after moving each contrib module into the target. Seems excessively cautious.
Need jonhattan or others to review the pm changes.
Thats a clever hack to use the D6 code and not yet upgraded D7 DB.
Comment #12
greg.1.anderson commentedMoving the contrib modules around before running updatedb was critical when ordering the extensions, because updatedb will update everything it can find, enabled or not. When the extension ordering is removed, all of that other code disappears as well. Too bad I got an erroneous failure result when I tried it this way the first time; it's working fine now, and the code is much simpler.
I'll write up a help topic on upgrading once the code is rtbc.
Comment #13
moshe weitzman commentedConfusing. Could we call this core-only? "after updatedb" is ambigous.
Whats the user case for no-enable?
Drupal core now enforces this requirement. updatedb will halt. No need for drush to take action.
Should be return FALSE now?
Powered by Dreditor.
Comment #14
greg.1.anderson commentedThose are good suggestions. Here is an updated patch with those changes made. Also, "seven" is used for the admin theme if it has already been set as the admin theme in the d6 site; otherwise, "garland" is used. Some other simplifications were done, and
drush topic docs-upgradewas added.Comment #15
moshe weitzman commentedI tested the patch and it worked first try. RTBC. Minor buglets below. Also, lets commit to HEAD and then discuss with Mark about Drush4.
Not necessary. Thats some legacy cruft. Lets remove the TODO.
Lets say CODE instead of FILES just to remove any ambiguity with uploaded files directory
Code comments should ideally start with capital and end with period as per http://drupal.org/coding-standards
Comment #16
moshe weitzman commentedAlso, there are some leading whitespace cleanups needed.
Comment #17
greg.1.anderson commentedCommitted.
While the drush-4 vs. drush-5 question does not affect me personally, since I'm tracking drush-HEAD on all of my servers, I'm partial to seeing this in drush-4. A lot of people will be doing 6-to-7 upgrades with drush-stable, and having this will save a lot of time.
Comment #18
msonnabaum commentedBackported to 4.x. Would very much like another maintainer to verify before I close however.
Comment #19
greg.1.anderson commented#1070558: Allow drush sup to be run multiple times, re-using same code each time further improves site-upgrade; if we could get that committed to HEAD and then 4.x, I'd be happy to confirm both at the same time.
Edit: I mean that patch and this patch at the same time on drush-4.x.
Comment #20
karens commentedI tried this out and it worked nicely. I like all the messages like telling you that you need to use Content Migrate. The biggest problem I saw is that my non-core modules did not get re-enabled in the D7 site. As far as i could see, everything else worked fine.
Comment #21
msonnabaum commented