Currently if you have a wrong db_url configured (or none configured at all), the upgrade process will first do a lot of stuff and ask you 2 questions, and only then it will tell you that it fails to connect to the database.

I think it would be a good idea to do it the other way round.

Otherwise, great that this can be done with Drush! The instructions to do this manually are really scary.


greg.1.anderson’s picture

Great suggestion; patches welcome.

donquixote’s picture

hm, let me see.. i am rewriting krumo, i want to improve the horrible crumbs admin form, i am producing a fancy meteor mobile thingie, and more stuff. help!

this is the first time i do a D6 -> D7 upgrade (honestly). Maybe on the 3rd time I would produce a patch :)

greg.1.anderson’s picture

Understood. Since I am very much in the same boat, #1 is also addressed to future readers, so they know that this suggestion would be welcomed if they had time to post a patch. Silence might be interpreted as disinterest.

colan’s picture

Title:Check if db_url is correct, before doing anything else» Source DB tables get dropped if db-url not set
Component:Miscellaneous» Code
Category:Feature request» Bug report
Priority:Normal» Major
Issue summary:View changes

I'm escalating this to a bug because Moshe's post says that "it is safe to run this command from within your production site" when it actually drops all tables in the source database if it's unset.

When didn't have this set initially, it must have assumed that the source was the target. It cleared up when I found the proper format for db-url over at Upgrade Drupal 6 to Drupal 7 using Drush site-upgrade.

Other folks have complained about this in Moshe's post's comments.

Here's the error that showed up in my case:

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.
Error: no database record could be found for @DB_ALIAS_DEST                                                                                             [error]
Table 'DB_NAME_SOURCE.semaphore' doesn't exist                                                                                       [warning]
query: DELETE FROM semaphore WHERE value = '190065822652aa4e406dd969.80295671'

greg.1.anderson’s picture

Priority:Major» Critical

I agree this is critical. I'll post a note on the project page.