To filter out unwanted migrations from your list you can filter on tag for your Drupal version.

drush migrate:status --tag="Drupal 7"
drush migrate:status --tag="Drupal 6"

Original

I've been working for some time trying to upgrade a site from D7 to D8 using https://drupalize.me/blog/201604/custom-drupal-drupal-migrations-migrate... as my guide. There seemed to be artifacts from a D6 to D7 migration, so I did a D2D from 7 to 7 hoping this would remove these artifacts. Having spent much time getting the site from one D7 installation to another I am returning to the D8 upgrade using this "clean" version of the site. It seems to have had little impact. When trying to do my custom upgrade I run "drush migrate-status" and I see that it is looking for non-existing D6 tables.

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'files' doesn't exist: SELECT COUNT(*) AS expression
FROM
(SELECT 1 AS expression
FROM
{files} f) subquery; Array
(
)

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'comments' doesn't exist: SELECT COUNT(*) AS expression
FROM
(SELECT 1 AS expression
FROM
{comments} c
INNER JOIN {node} n ON c.nid = n.nid) subquery; Array
(
)

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'vocabulary' doesn't exist: SELECT COUNT(*) AS expression
FROM
(SELECT 1 AS expression
FROM
{vocabulary} v) subquery; Array
(
)

I am completely at a loss on where to start addressing this. Searches return little useful information. I don't see a way to tell the upgrade to just ignore them.

Thank you,
Sean

Comments

couloir007 created an issue. See original summary.

majorrobot’s picture

Not sure if you're still having this issue. I ran into the exact same issue migrating from D7 to 8.5.0 last week.

I found that I had apparently run drush migrate-upgrade twice, and this had caused it for me. There must be something about that command that, if it has already run, goes back and looks for more stuff to migrate ... even if there's nothing else to migrate.

benstallings’s picture

Version: 8.3.0-rc1 » 8.7.x-dev

The larger problem here is that any time you run drush migrate-status without specifying a --group, it checks for all migrations that are known to Drupal. If migrate_drupal module is enabled, then all of the D6 and D7 migrations that are defined in that module are known to Drupal, whether or not they are applicable to the current site.

Unless I'm mistaken, the easiest way to solve this problem would be to separate migrate_drupal into two different submodules for D6 migrations and D7 migrations so that they could be enabled individually. I have trouble imagining a realistic case study where someone would want to import from both a D6 and a D7 site, and yet that is the default configuration.

Unfortunately I'm not ambitious enough to attempt to separate the module and offer a patch. I leave that to someone who has a better understanding of how the module works.

quietone’s picture

The migrations can be identified by the migration_tags (not groups). The current tags are 'Drupal 6', 'Drupal 7', 'Configuration' and 'Content'. So, commands like drush ms --tag="Drupal 6 should work to limit the output.

Yes, when Migrate Drupal is enable all the available migrations are discovered. The idea of separating migrate_drupal into two modules is interesting but at least one thing that makes that not attractive is that some migrations are valid for both Drupal 6 and Drupal 7.

clemens.tolboom’s picture

Issue summary: View changes

@quietone thanks for the tip.

I ran into this for a D6 site. This solves the command line UX output ./vendor/bin/drush migrate:status --tag="Drupal 6" which is great.

What I don't understand is why migrate can list the right migrations when using the tag (shared D6/7 migrations) but still lists items for the wrong version

I see

  Default (default)   d6_url_alias  Importing   87388    22673      64715
...
  Default (default)   d7_url_alias  Idle        87388    0          87388

which seems a bug to me as migration found my D6 database.

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

quietone’s picture

Status: Active » Closed (works as designed)

Looks like this has been resolved. The way core finds all the migrations is working as designed.

The solution to limiting the output is to use the --tag option on the migrate-status command.

rupertj’s picture

I came across this issue while trying to get rid of the annoying D6 migration error messages on a D7->D8 upgrade. In the end I got rid of them by altering out the D6 migrations, like this:

function hook_migration_plugins_alter(array &$migrations) {
  foreach ($migrations as $key => $migration) {
    if (substr($key, 0, 3) === 'd6_') {
      unset($migrations[$key]);
    }
  }
}
clemens.tolboom’s picture

Status: Closed (works as designed) » Active

So this means it still is an issue right?

quietone’s picture

Status: Active » Closed (works as designed)

Sorry, as stated in #9 core is working as designed.

The typical way to ignore those messages is to use the filtering options on the `drush ms` command. The solution in #10 will work as well.