---
title: "Migrating Multilingual Content from CSV to Drupal 8"
description: "Trying to migrate multilingual content from a CSV file to Drupal 8 but not sure where to start from? Check out this step-by-step guide to an easy Drupal 8 migration of multilingual content."
url: https://www.specbee.com/blogs/migrating-multilingual-content-from-csv-to-drupal-8
type: Article
author: "Suresh Prabhu"
categories: "Code Corner"
published: 2021-07-13
updated: 2026-10-06
---

# Migrating Multilingual Content from CSV to Drupal 8

Migrating data from any source to Drupal 8 is now made simple with various modules that allow easy data transfer. Migration in Drupal is a term for any process that moves data from an external source to the current Drupal site. You can migrate data that includes nodes, users, configuration, and any other components of the site.

Drupal provides you many ways to migrate content. Depending on the website and source of the data, you can choose the best way to do it. However, migrating multilingual data can add a few more steps to your migration process. You will first need to migrate the base content and then migrate the translations. In this article, we will elaborate on these steps to help you get a better understanding of migrating [multilingual content](https://www.specbee.com/blogs/drupal-translation-modules-create-multilingual-drupal-websites) from CSV to Drupal 8.

## Drupal 8 Migration Modules You Will Need

As mentioned earlier, Drupal offers tons of options and modules that can help you with an easy, [hassle-free migration](https://www.specbee.com/blogs/drupal-7-to-8-migration-how-guide-addresses-migrations-challenges-recommendations). For migrating multilingual content, you will need:

1. **Migrate:** Provides a flexible framework for migrating content into Drupal from other sources.
2. **Migrate plus:** Provides plugins for migrations like source plugins, process plugins, destination plugins and API extensions.
3. **Migrate Drupal:** Provides support for migrating content and configurations.
4. **Migrate source CSV:** Provides a plugin to import contents to Drupal from a CSV file.
5. **Migrate tools:** This module gives UI tools and Drush commands used for migration.
6. **Configuration development module:** This module converts script into configurations.

## Step 1: Migrating the base content

To begin with [migrating](https://www.specbee.com/blogs/top-13-questions-about-migrating-to-Drupal-8-answers-included) the base content, we will first need to [create a custom module](https://www.specbee.com/blogs/drupal-9-custom-module-development) in Drupal 8.

 ![Create Custom Module](https://www.specbee.com/sites/default/files/styles/large/public/migrated/Create_custom_module_0.png.avif?itok=AlZ6NlRl)

 

 Make sure that the **info.yml** has these keys and values.

You will need to create **yaml** files, which are known as migration scripts, and place it in the config/install directory of the custom module created. The **config\_devel/install** key of **info.yml** should have all the yaml files written.

 ![Yaml File](https://www.specbee.com/sites/default/files/styles/large/public/migrated/yaml_file_0.png.avif?itok=B5yiRkYk)

 

 This is a sample yaml file for importing taxonomy terms. The migration script has 4 sections:

1. **Metadata:** will have the id, label, and migration group id.
2. **Source:** The source key should have the path to the CSV file.
3. **Process:** The mapping between the fields and the CSV columns.
4. **Destination:** The destination where the imported data is saved.

The yaml file node contents should be written similarly. The only difference being the destination.

 ![Entity Node](https://www.specbee.com/sites/default/files/styles/large/public/migrated/entity_node_0.png.avif?itok=7XXh-SAE)

 

 The destination plugin should be **entity:node** and the **default\_bundle** will have the machine name of the content type to which the content is imported.

After creating all the yaml files, the IDs of the yaml should be included in the **info.yml**. Once everything is done, enable the custom module.

Use the Drush command **drush cdi `<migration id>`**. Here the migration id is **techx migration**. This will convert the script into configurations.

After running the command go to **admin>structure>migration**. You will find the migration group you created by clicking on list migration. This will show you the list of the migration scripts created.

 ![Operations](https://www.specbee.com/sites/default/files/styles/large/public/migrated/Operations_0.png.avif?itok=RQXO1-Dv)

 

 Clicking on execute tab will show the list of operations available:

 ![Operations Available](https://www.specbee.com/sites/default/files/styles/large/public/migrated/Operations_available_0.png.avif?itok=yDzkY4GX)

 

 **Import** is to pull the data from the source.

**Rollback** will delete the data imported.

The **Stop** is to interrupt the import or rollback process.

Sometimes a process gets stuck. To move the status to idle, **Reset** is used.

For a more detailed information on how to migrate the data of different entities like the user, paragraph, check [CSV Import to Migrate Drupal 7 to 8 - A complete guide](https://www.specbee.com/blogs/csv-import-migrate-drupal-7-8-complete-guide).

## Step 2: Migrating the translations of the base content

If you already have enabled multilingual content on your Drupal 8 website, you can skip the first step. If you want to know how to create multilingual Drupal 8 websites (and why you might need one), [check out this article](https://www.specbee.com/blogs/drupal-translation-modules-create-multilingual-drupal-websites).

### 1. Adding language to the Drupal website

To import translations, first we must make our website multilingual. Let us see how to download languages to the site.

1. Enable the **Language** and **Content translation** module. These are core modules.
2. Go to /admin/config/regional and language/language/add language.
    
     ![Add Language](https://www.specbee.com/sites/default/files/styles/large/public/migrated/add_language_2.png.avif?itok=-pWPvmsi)
3. Clicking on the dropdown gives you a list of languages. Select the language you want on the site and click on **Add language**. This will download the language for your site.

### 2. Enabling translation for entities

Once we have installed the languages we need, we must enable the translations for the entities before importing or adding the translations to the content. For this, go to **admin/config/regional/content translation**. Select the entities to which you want to enable the translation and click on **Save configurations**.

In this example, I am importing the blog content type and thus I will enable translation for blog content type.

 ![Language](https://www.specbee.com/sites/default/files/styles/large/public/migrated/Language_2_0.png.avif?itok=AgU8Eren)

 

 ### 3. Update the migration files

There are some changes that need be made on the yaml files to import the translations. Give the path of the CSV file of translated content as a base contents and translated contents are stored in different files. Changes in term translation.

 ![tid](https://www.specbee.com/sites/default/files/styles/large/public/migrated/tid_0.png.avif?itok=erilhMr2)

 

 Add a new key **tid** in the process section of the script with the **plugin** as **migration, source** as **id**, and **migration** value should be the **migration id** of its base content migration script.

For node migration add a new key **nid** in the process section. Here the **migration** key will have the value of the **migration id** of its base content migration script.

 ![Source Id](https://www.specbee.com/sites/default/files/styles/large/public/migrated/source_id_0.png.avif?itok=t-ujb4N1)

 

 Another key should be added is **translations** with the value set to **true**. This should be added in the destination section of all the translation migration scripts irrespective of the entities.

 ![Destination](https://www.specbee.com/sites/default/files/styles/large/public/migrated/destination_0.png.avif?itok=t7LBhbK-)

 

 Define the language to which the translation is imported using the **langcode** key. In this example I am importing Japanese translations, so the value will be **ja**.

 ![Langcode](https://www.specbee.com/sites/default/files/styles/large/public/migrated/langcode_0.png.avif?itok=KkOxM9Vz)

 

 These changes tell the script to take the id of the content from the base content migration from which these contents are treated as translations rather than a new node.

## Points to remember

- The importing process should go in order. For example, if the terms are referred to in the node, the terms should be imported first before the node contents.
- Enable the translation for the entities before importing the translations.
- The order of translation contents in the CSV file should be the same as the base content. That is, the base content and its translations should be in the same line in the CSV file.
- Import the base content first then the translation content. Else both will be treated as individual contents.

Having multilingual content allows you to reach a wider audience and create a better connect with the audience. Migrating multilingual content in Drupal does not have to be a tedious process if you use the right Drupal 8 modules and follow the steps as described in this article. Got questions on this or want help in [migrating your multilingual website to Drupal 8 (or 9)](https://www.specbee.com/services/drupal-migration-upgrade) ? We can help! Please [reach out to us here](https://www.specbee.com/contact) and we’ll get in touch with you asap!