Migrating a Drupal 6.x (6.38) without any translations fails when trying to migrate i18n variables with the following output:

Migration failed with source plugin exception: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'db_name.prefix_i18n_variable' doesn't exist:
SELECT v.*
FROM 
{i18n_variable} v
WHERE name IN (:db_condition_placeholder_0); Array
(
    [:db_condition_placeholder_0] => site_offline_message
)

Activating and installing Locale module on the 6.x installation makes no difference. In fact I can't find any reference to i18n_variable at all in the 6.x core download.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

NiklasBr created an issue. See original summary.

mikeryan’s picture

Priority: Major » Normal
Status: Active » Postponed (maintainer needs more info)

Which specific migration was it that failed? Seems some migration is missing a dependency on i18n...

NiklasBr’s picture

Status: Postponed (maintainer needs more info) » Active

drush migrate-upgrade --legacy-db-url=mysql://user:password@server/database--legacy-root=path/to/files --legacy-db-prefix='prefix'

Or did you ask something else?

mikeryan’s picture

Status: Active » Postponed (maintainer needs more info)

I asked which specific migration generated the error. When you run the migrations, you should see feedback on the ones that are running - prefix_d6_user, prefix_d6_file, etc...

NiklasBr’s picture

Status: Postponed (maintainer needs more info) » Active

upgrade_d6_dblog_settings, upgrade_d6_i18n_system_maintenance, upgrade_user_picture_entity_form_display, upgrade_action_settings, upgrade_d6_user_role.

hellobank’s picture

I got the same error message when I migrate D6 to D8 :

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'Database.prefix_i18n_variable' doesn't exist: SELECT v.*
FROM 
{i18n_variable} v
WHERE  (name IN  (:db_condition_placeholder_0)); Array
(
    [:db_condition_placeholder_0] => site_offline_message
)

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'Database.prefix_i18n_variable' doesn't exist: SELECT v.*
FROM 
{i18n_variable} v
WHERE  (name IN  (:db_condition_placeholder_0, :db_condition_placeholder_1, :db_condition_placeholder_2, :db_condition_placeholder_3, :db_condition_placeholder_4, :db_condition_placeholder_5)); Array
(
    [:db_condition_placeholder_0] => site_name
    [:db_condition_placeholder_1] => site_mail
    [:db_condition_placeholder_2] => site_slogan
    [:db_condition_placeholder_3] => site_frontpage
    [:db_condition_placeholder_4] => site_403
    [:db_condition_placeholder_5] => site_404
)

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'Database.prefix_i18n_variable' doesn't exist: SELECT v.*
FROM 
{i18n_variable} v
WHERE  (name IN  (:db_condition_placeholder_0, :db_condition_placeholder_1, :db_condition_placeholder_2, :db_condition_placeholder_3, :db_condition_placeholder_4, :db_condition_placeholder_5, :db_condition_placeholder_6, :db_condition_placeholder_7, :db_condition_placeholder_8, :db_condition_placeholder_9, :db_condition_placeholder_10, :db_condition_placeholder_11, :db_condition_placeholder_12, :db_condition_placeholder_13)); Array
(
    [:db_condition_placeholder_0] => user_mail_status_activated_subject
    [:db_condition_placeholder_1] => user_mail_status_activated_body
    [:db_condition_placeholder_2] => user_mail_password_reset_subject
    [:db_condition_placeholder_3] => user_mail_password_reset_body
    [:db_condition_placeholder_4] => user_mail_status_deleted_subject
    [:db_condition_placeholder_5] => user_mail_status_deleted_body
    [:db_condition_placeholder_6] => user_mail_register_admin_created_subject
    [:db_condition_placeholder_7] => user_mail_register_admin_created_body
    [:db_condition_placeholder_8] => user_mail_register_no_approval_required_subject
    [:db_condition_placeholder_9] => user_mail_register_no_approval_required_body
    [:db_condition_placeholder_10] => user_mail_register_pending_approval_subject
    [:db_condition_placeholder_11] => user_mail_register_pending_approval_body
    [:db_condition_placeholder_12] => user_mail_status_blocked_subject
    [:db_condition_placeholder_13] => user_mail_status_blocked_body
)

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'Database.prefix_i18n_variable' doesn't exist: SELECT v.*
FROM 
{i18n_variable} v
WHERE  (name IN  (:db_condition_placeholder_0, :db_condition_placeholder_1, :db_condition_placeholder_2, :db_condition_placeholder_3, :db_condition_placeholder_4)); Array
(
    [:db_condition_placeholder_0] => user_mail_status_blocked_notify
    [:db_condition_placeholder_1] => user_mail_status_activated_notify
    [:db_condition_placeholder_2] => user_email_verification
    [:db_condition_placeholder_3] => user_register
    [:db_condition_placeholder_4] => anonymous
)
quietone’s picture

The i18n migrations should only be discovered if the config_translation module is enabled on the destination. Was config_translation enabled when the migrations were configured?

And regarding translating variables on D6, both the i18n module and the Variable module need to be installed.

hellobank’s picture

thank U quietone. I will try it.

hellobank’s picture

Just enabled Internationalization and String translation module, the problem fixed.

thanks again quietone.

NiklasBr’s picture

On the D6 system where I have no memory of ever having installed any i18n module:
SELECT * FROM prefix_system WHERE filename LIKE "%18n%"
0 rows

SELECT * FROM prefix_system WHERE filename LIKE "%variable%"
0 rows

Are they part of D6 core?

quietone’s picture

Status: Active » Closed (won't fix)

Finally saw the cause of this.

The problem is that the source provider on the VocabularyTranslation source plugin is 'taxonomy' and not 'i18n' or 'i18ntaxonomy'. So, as far as the migration is concerned all it needs is the taxonomy module enabled on the source. When it fact it needs the i18n tables.

The fix is to change core/modules/taxonomy/src/Plugin/migrate/source/d6/VocabularyTranslation.php:12 from
* source_provider = "taxonomy"

to
* source_provider = "i18ntaxonomy"

This is fixed in #2569805: For Drupal migration, identify the source module which is at RTBC and there is a work around of installing and enabling the i18n modules. See #9. Therefor changing status to won't fix. Reopen if you disagree.