Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#48 | Drush_9_port_of_commands-2915726-48.patch | 775 bytes | stefan.korn |
#38 | 2915726-38.patch | 11.83 KB | heddn |
#38 | interdiff_36-38.txt | 1.1 KB | heddn |
Comments
Comment #2
bpresles CreditAttribution: bpresles commentedHere a patch containing the port of the commands.
Comment #3
bpresles CreditAttribution: bpresles commentedComment #4
bpresles CreditAttribution: bpresles commentedComment #5
heddnI'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.
Comment #6
heddnI also think this is the only blocker for a stable release of this code.
Comment #7
mikelutzPlease 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.
Comment #8
drikc CreditAttribution: drikc commentedI tried patch in #7 and drush migrate:upgrade command is here but now when I trigger it it responds:
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?
Comment #9
mikelutzRight, 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.
Comment #10
mpp CreditAttribution: mpp as a volunteer and at AmeXio for District09 commentedSetting this to critical as Drush now has a final 9.0.0 release and is the recommended version.
Comment #11
heddnWhile important, there are work arounds. The module is not entirely un-usable. Lowering priority.
Comment #12
mpp CreditAttribution: mpp as a volunteer and at AmeXio for District09 commentedHi @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.
Comment #13
jcnventura CreditAttribution: jcnventura at Wunder commentedReplacing the drush_convert_db_from_db_url() call with SqlBase::dbSpecFromDbUrl() seems to do it. Rollbacks are still broken.
Comment #14
JayVGee CreditAttribution: JayVGee commentedIn 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.
Comment #15
jcnventura CreditAttribution: jcnventura at Wunder commentedIn addition to $databases['default']['default], add a second database array for $databases['migrate']['default]
Comment #16
JayVGee CreditAttribution: JayVGee commentedFor 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.
Comment #17
jcnventura CreditAttribution: jcnventura at Wunder commentedComposer 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"
Comment #18
JayVGee CreditAttribution: JayVGee commentedYes, 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).
Comment #19
mikelutz@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.
Comment #20
JayVGee CreditAttribution: JayVGee commentedOk, 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.
Comment #21
mikelutzWell, It's definitely not done yet, but without it, there is no support for drush 9 at all, so it's better than nothing.
Comment #22
rovoI 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.
Comment #23
JayVGee CreditAttribution: JayVGee commentedStill 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.
Comment #24
slayerment CreditAttribution: slayerment commentedTried same steps as JayVGee #23 and having same issue. Not sure if I'm doing something wrong.
Comment #25
GoldJust trying what JayVGee listed at #23.
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.
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.
Comment #26
edg CreditAttribution: edg commentedUpdate: This works for me now.
When I run 'drush migrate-upgrade --configure-only' I see the list of migrations.
Comment #27
juampynr CreditAttribution: juampynr at Lullabot commentedWorked fine for me. The process ended with a "MySQL has gone away" error but I think that it is unrelated with this patch.
Comment #28
mecano CreditAttribution: mecano as a volunteer commentedWas able to --configure-only without a glitch, thanks.
Comment #29
juampynr CreditAttribution: juampynr at Lullabot commentedPatch still works against HEAD. Marking as reviewed.
Comment #30
heddnRerunning the latest patch against tests again. The last time, it failed.
Comment #32
boby_ui CreditAttribution: boby_ui as a volunteer commentednoob question where should I patched the drush?
Comment #33
heddnLooks like tests are failing. So I cannot commit this :(
Comment #34
llslim CreditAttribution: llslim commented@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.
Comment #35
camerongreen CreditAttribution: camerongreen commented@boby ui not sure about windows, but if you are on linux or mac, you'll want to do something like:
Comment #36
heddnLooks 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.
Comment #38
heddnWe are close.
Comment #39
Christopher Riley CreditAttribution: Christopher Riley commentedI 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?
Comment #40
quietone CreditAttribution: quietone as a volunteer commentedWhile it has been awhile since I used migrate-upgrade this patch doesn't work for me. I just get this error:
Drupal 8.6.x
Drush 9.3.0
Comment #41
Christopher Riley CreditAttribution: Christopher Riley commentedIt 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.
Comment #42
magicmirror CreditAttribution: magicmirror commentedI'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.
Comment #43
GoldI 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...
Comment #45
heddnI did some manual testing. The annotations were causing some issues. I've fixed those issues and merged the code.
Comment #47
stefan.kornIs 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.
Comment #48
stefan.kornHow about this to make it still compatible with Drush 8?
Comment #49
heddnCan 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.
Comment #50
stefan.kornAh, 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?