drush help for migrate-import shows --rollback as an option, but also complains that it isn't one.

$ drush help migrate-import
Perform a given migration
...
Options:
...
 --rollback Rollback specified migration(s) if applicable.                                                          
...
$ drush migrate-import Test --rollback
Unknown option: --rollback.  See `drush help migrate-rollback` for available options. To suppress this error, add the option --strict=0.[error]
$ drush version
drush version 5.7

Comments

mikeryan’s picture

Status: Active » Fixed

Well, it's complaining that --rollback isn't an option on migrate-rollback, which is true;). The issue is running a migrate-rollback command (rather than calling the API to run the rollback), and passing the options through. Easily fixed by unsetting the option.

Status: Fixed » Closed (fixed)

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

chingis’s picture

I don't get, drush mi --help display that --rollback is one of the options

osopolar’s picture

Issue summary: View changes
Status: Closed (fixed) » Active

Well, it's complaining that --rollback isn't an option on migrate-rollback, which is true;).

The drush command is not migrate-rollback, it is migrate-import. See examples in drush migrate-import --help. I understood the command drush migrate-import Article --limit="100 items" --stop --rollback the way that it first stops all current Article migrations, roll them back and start migrating 100 items. It's a nice feature for development.

If this does not work, it should be removed from the command help.

Drush Version: 6.6-dev

mikeryan’s picture

Status: Active » Closed (fixed)

Please do not reopen long-closed issues - if the --rollback option is not working for you, please open a new issue (indicating the Migrate version you're using) describing exactly the command you're executing and the result.

Thanks you.

osopolar’s picture

Version: 7.x-2.4 » 7.x-2.7
Status: Closed (fixed) » Active

Why not open an already existing issue if it is exactly the problem and it was only fixed because of a misunderstanding (IMHO) - see also comment #4. Please check again the issue. It is not a problem with the rollback command, but with the migrate-import. What else do you need to reproduce the error?

mikeryan’s picture

Version: 7.x-2.7 » 7.x-2.4
Status: Active » Closed (fixed)

The problem that was reported was receiving the error "Unknown option: --rollback". The --rollback option operates by spawning a migrate-rollback command, and the original problem here was that the --rollback option got passed to the spawned migrate-rollback command, which rightly objected. This problem was fixed, a long time ago, by not passing --rollback to the spawned command. Now, with Migrate 2.7, it works fine for me with migrate_example:

$ drush mi --rollback beerterm
Rolled back 3 in 0.2 sec (1078/min) - done with 'BeerTerm' 
Processed 3 (3 created, 0 updated, 0 failed, 0 ignored) in 0.1 sec (1829/min) - done with 'BeerTerm'

If you're having a problem under Migrate 2.7 with --rollback, it is neither the original problem here, nor is it a universally reproducible problem. Please open a fresh issue, with more detail on the problem you are seeing.