The latest dev version of the module still don't have Drush 9 (legacy .dush.inc support has been removed on drush 9.0.0-beta5) compatible commands.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bpresles created an issue. See original summary.

bpresles’s picture

Here a patch containing the port of the commands.

bpresles’s picture

Status: Active » Needs review
bpresles’s picture

Issue summary: View changes
heddn’s picture

Status: Needs review » Needs work

I'm not familiar (yet) with the drush 9 requirements, but can we get the legacy drush.inc file to call the new service so we only have a single copy of the logic. Instead of in 2 places?

This blog post from Nuvole is a great guide.

heddn’s picture

I also think this is the only blocker for a stable release of this code.

mikelutz’s picture

FileSize
9.43 KB
5.48 KB

Please for god's sake don't commit this. This is a merging of this patch, which adds a drush 9 command file with a patch from another issue which removes most of the deprecated drush function calls (so this patch actually can work in drush 9). Rollbacks are still broken in d9, using a db-url instead of a db-key is broken in 9 too, and the whole thing needs to be refactored to reduce logic duplication and add tests. I'm just putting this here because I needed a basic migrate-upgrade in drush 9 to work. I'll try to put out something committable in the future.

drikc’s picture

I tried patch in #7 and drush migrate:upgrade command is here but now when I trigger it it responds:

[error]  Error: Call to undefined function Drupal\migrate_upgrade\drush_convert_db_from_db_url() in Drupal\migrate_upgrade\MigrateUpgradeDrushRunner->configure() ...

Now, that drush_convert_db_from_db_url() function is indeed NOT in my project code base and also it seems that it isn't something anymore in drush version 9???: http://api.drush.org/api/drush/includes%21sitealias.inc/function/drush_c...

Anyone else encountering this?

mikelutz’s picture

Right, drush_conver_db_from_db_url doesn't exist anymore.

It's why I said "using a db-url instead of a db-key is broken in 9 too" above. I needed a quick and dirty port, and I was using keys and not urls, so I haven't worked on a replacement for that.

Best workaround if you can is to put the d7 database information in your settings.php file and use the key instead of the url.

mpp’s picture

Priority: Normal » Critical

Setting this to critical as Drush now has a final 9.0.0 release and is the recommended version.

heddn’s picture

Priority: Critical » Major

While important, there are work arounds. The module is not entirely un-usable. Lowering priority.

mpp’s picture

Hi @heddn, thanks for the update. I assume that by workaround(s) you mean the patch in #7?

Note that according to http://docs.drush.org/en/master/install Drush 8 is no longer supported for Drupal 8.3+ so using Drush 8 no longer seems like a viable option.

Adding the Drush 9 port blog from Moshe Weitzman.

jcnventura’s picture

Replacing the drush_convert_db_from_db_url() call with SqlBase::dbSpecFromDbUrl() seems to do it. Rollbacks are still broken.

JayVGee’s picture

In the thread, there was a comment mentioned that there are work arounds. Is the work around that is should be the suggestion that is mentioned in comment #9? If so, how does 1 go about tackling that; "put the d7 database information in your settings.php file and use the key instead of the url"? Is there documentation on how to accomplish this?

I am using the latest version of Drush and Drupal on a clean install.

jcnventura’s picture

In addition to $databases['default']['default], add a second database array for $databases['migrate']['default]

JayVGee’s picture

For some reason, I am currently getting these errors: Command "migrate-status" is not defined AND Command "migrate-upgrade" is not defined.

Drupal version : 8.5.0
Drush version : 9.2.1

This is a base Drupal install, with migrate upgrade installed using composer.

jcnventura’s picture

Composer installs the code, but doesn't enable the module. Are you sure it's enabled? You can do it via Drupal UI, or "drush en"

JayVGee’s picture

Yes, the module is installed and enabled.

Are you able to replicate this on your end with a fresh install?

I used option 'A' to install the latest version of Drupal, which also installs the latest version of Drush: https://www.drupal.org/docs/develop/using-composer/using-composer-to-man...

I used this composer command to install the module: composer require "drupal/migrate_upgrade:3.x-dev" (FYI, I get the same results with the stable release as well).

mikelutz’s picture

@JayVGee To be clear, you are talking about having that error after installing the patch in this thread as well?

Without the patch, migrate_upgrade does not work with Drush 9. This issue thread is dedicated to the work needed to get migrate_upgrade working with Drush 9 and the above patch is the latest work.

If you did install the patch and are still having issues, make sure you clear your cache so that drush can pick up the new commands.

JayVGee’s picture

Ok, thanks for the tip. I was under the impression (based on comments and #7 and the fail message at the top of the page) that the patch was not working. I will give it a shot.

mikelutz’s picture

Well, It's definitely not done yet, but without it, there is no support for drush 9 at all, so it's better than nothing.

rovo’s picture

I need more than to clear drush cache. I had to pm-uninstall migrate_upgrade, then reinstall for the MigrateUpgradeCommands to extend DrushCommands, then migrate:upgrade became available in the list of drush commands in my terminal.

JayVGee’s picture

Still hitting a wall here, seems like Drush cannot find the commands: There are no commands defined in the "migrate" namespace.

Drupal version : 8.5.0
Drush version : 9.2.1
composer require drupal/migrate_upgrade:3.x-dev (Completed)
Applied patch successfully.
Un-installed, then re-installed migrate_upgrade.
Cleared Drush cache.

slayerment’s picture

Tried same steps as JayVGee #23 and having same issue. Not sure if I'm doing something wrong.

Gold’s picture

Just trying what JayVGee listed at #23.

  • Drupal version : 8.5.3
  • migrate version : 8.5.3
  • migrate_drupal version : 8.5.3
  • migrate_plus version : 4.0-beta3
  • Drush version : 9.2.3
  • composer require drupal/migrate_upgrade:3.x-dev (Completed)
  • Applied patch successfully.

I do tend to burn things to the ground when testing. Here's the steps after a db reset on the project I'm currently working on.

vagrant@nbr-website:/vagrant$ drush pm-uninstall migrate
The following extensions will be uninstalled: migrate, migrate_drupal, migrate_custom, migrate_drupal_ui, migrate_plus, migrate_tools

 Do you want to continue? (yes/no) [yes]:
 > yes

 [success] Successfully uninstalled: migrate, migrate_drupal, migrate_custom, migrate_drupal_ui, migrate_plus, migrate_tools
vagrant@nbr-website:/vagrant$ drush en migrate_upgrade
The following module(s) will be enabled: migrate_upgrade, migrate, migrate_drupal, migrate_plus

 Do you want to continue? (yes/no) [yes]:
 > yes

 [success] Successfully enabled: migrate_upgrade, migrate, migrate_drupal, migrate_plus
vagrant@nbr-website:/vagrant$ drush | grep migrate
 migrate:                                                                                                         
   migrate:upgrade (mup)                      Perform one or more upgrade processes.                              
   migrate:upgrade-rollback (mupr)            Rolls back and removes upgrade migrations.

This appears to be working for me without the need to clear caches or do a cache rebuild.

Given others have experienced issues I'd suggest they test with current versions and see if their outcome is any better than previous.

edg’s picture

Update: This works for me now.

  • Drupal version : 8.5.3
  • Drush version : 9.2.3
  • Run 'composer require drupal/migrate_upgrade:3.x-dev'
  • Applied patch.
  • Drush en migrate_upgrade
  • Drush cr

When I run 'drush migrate-upgrade --configure-only' I see the list of migrations.

juampynr’s picture

Worked fine for me. The process ended with a "MySQL has gone away" error but I think that it is unrelated with this patch.

mecano’s picture

Was able to --configure-only without a glitch, thanks.

juampynr’s picture

Status: Needs work » Reviewed & tested by the community

Patch still works against HEAD. Marking as reviewed.

heddn’s picture

Rerunning the latest patch against tests again. The last time, it failed.

Status: Reviewed & tested by the community » Needs work
boby_ui’s picture

noob question where should I patched the drush?

heddn’s picture

Looks like tests are failing. So I cannot commit this :(

llslim’s picture

@hedden did you diff/merge 8.x-3.x and 8.x-3.x-dev branches? According to the "View Results" link of test. https://www.drupal.org/pift-ci-job/966348 if you scroll pass the 2 errors. The test passed on the 8.x-3.x-dev branch. Was the patch applied to that branch as well or no? Just curious.

camerongreen’s picture

@boby ui not sure about windows, but if you are on linux or mac, you'll want to do something like:

cd modules/contrib/migrate_upgrade
curl -O https://www.drupal.org/files/issues/2018-03-17/2915726-13.migrate_upgrade.Drush-9-port-of-commands.patch
patch -p 1 < 2915726-13.migrate_upgrade.Drush-9-port-of-commands.patch
heddn’s picture

Status: Needs work » Needs review
FileSize
6.82 KB
10.74 KB

Looks like it needed a re-roll too, so sorry for the noise in the interdiff. But this should get things back on track hopefully with the tests. The main difference is that we weren't accepting any arguments into setOptions. Now we are and I've moved that into the constructor.

Status: Needs review » Needs work

The last submitted patch, 36: 2915726-36.patch, failed testing. View results

heddn’s picture

Status: Needs work » Needs review
FileSize
1.1 KB
11.83 KB

We are close.

Christopher Riley’s picture

I was working on migrating a site and things were working quite well. I decided to blow away everything and try it again following the same instructions (https://colorfield.be/blog/drupal-7-drupal-8-migration-configuration-ent...) however not sure if its the latest patch or drupal 8.5.4 however now when I try to do a --configure-only however when I do I get the following:

Not enough arguments (missing: "options").

Suggestions?

quietone’s picture

Status: Needs review » Needs work

While it has been awhile since I used migrate-upgrade this patch doesn't work for me. I just get this error:

  Not enough arguments (missing: "options").                                 

Drupal 8.6.x
Drush 9.3.0

Christopher Riley’s picture

It appears that this is an issue with vendor/symfony/console/Input/Input.php I commented out the RuntimeException in the validate function and it worked. I'll add more if I can make any sense of this since I am new to the whole symfony thing.

magicmirror’s picture

I'm not 100% sure if this should be thrown into the mix here or not, but I was having similar issues through today. I got it working, but after a composer update now the drush migrate-status commands fails on a new error that wasn't there earlier today: [error] A bundle was provided but the entity type (vote_result) is not bundleable.

Again; I am not sure where to even begin listing this as it could be related to so many things. But it did just pop up in the middle of all of the above getting sorted out.

Gold’s picture

I can confirm the issue described in #30. I'm also seeing the Not enough arguments (missing: "options"). error.

Needing this right now too. Digging further...

  • heddn committed 4fa447c on 8.x-3.x
    Issue #2915726 by heddn, mikelutz, jcnventura, bpresles, Gold,...
heddn’s picture

Status: Needs work » Fixed

I did some manual testing. The annotations were causing some issues. I've fixed those issues and merged the code.

Status: Fixed » Closed (fixed)

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

stefan.korn’s picture

Is it intended that migrate_upgrade requires Drush 9 to run now?

Latest version (RC-5) does not seem to work with latest Drush 8 stable (8.1.17).

It is now using dbSpecFromDbUrl() function which is not available in Drush 8.

stefan.korn’s picture

How about this to make it still compatible with Drush 8?

heddn’s picture

Can we move this to a new issue? Drush 8 isn't supposed to be used any more on D8 sites as of 8.4. See http://docs.drush.org/en/master/install/#drupal-compatibility. I don't mind continuing to support Drush 8, especially as this is a simple fix. But let's move it to its own issue too.

stefan.korn’s picture

Ah, ok. Thanks for heads up. I have a site with Drupal 8.6.1 and composer.json is referencing drush like this "~8.0|^9.0.0-beta8". So I got the 8.x version still ...

I have found this issue https://www.drupal.org/project/migrate_upgrade/issues/2996962 where users also seem to struggle with RC-5 supposedly because of drush version. So how about using that issue?