Skip to main content
Home
GrN.dk

Main navigation

  • Articles
  • Cases
  • Services
  • Your Digital Project Manager
  • About Greg Nowak
  • Image Gallery
  • Contact
User account menu
  • Log in

Join my community / free newsletter — sign up here

Breadcrumb

  1. Home

Drupal 8: How to Change Existing Content Language Safely

Illustrated infographic summarizing: Drupal 8: How to Change Existing Content Language Safely

By Greg Nowak. Updated 11 August 2026.

If an inherited Drupal 8 site contains Swedish pages labelled as English, changing the default language will not repair those records. Existing content keeps language metadata in several entity and field tables, where it can influence editing forms, Views, search, feeds, URL handling, and integrations.

Treat the change as a small data migration: define the intended result, inspect the actual schema, test a repeatable script in staging, and arrange editorial sign-off. This is especially important because Drupal 8 has received no security support since November 2021. A language repair may be justified, but it should sit inside a plan for moving the site to a supported Drupal release.

Are You Relabelling Content or Translating It?

Start with the business requirement. If a Swedish article was mistakenly stored with langcode = 'en', you may need to relabel its source language as sv. If the organisation wants separate English and Swedish versions, that is content translation—not a database replacement.

Drupal’s current multilingual documentation explicitly warns against changing the site’s default language after content has been added. It also explains that translations share an entity ID while language-specific values are stored separately. That structure is why a broad search-and-replace is unsafe.

What you find Likely requirement Recommended route
Swedish-only content incorrectly labelled en Relabel the existing source content Controlled data repair in staging, followed by production
Both en and sv rows for the same entity Preserve real translations Stop and map each translation before writing SQL
Editors need both languages going forward Introduce a translation workflow Configure Content Translation by entity type, bundle, and field
Custom entities or integrations use language filters Repair a wider data contract Include application and integration testing in the scope
A decision matrix for choosing between relabelling, translation, and a broader migration.

Inventory the Database Before Writing the Repair

Clone production and take a complete backup before investigating. Then identify every table containing Drupal’s common language metadata columns. On MySQL or MariaDB, this discovery query provides a useful starting point:

SELECT TABLE_NAME, COLUMN_NAME
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_SCHEMA = DATABASE()
  AND COLUMN_NAME IN (
    'langcode',
    'default_langcode',
    'content_translation_source'
  )
ORDER BY TABLE_NAME, COLUMN_NAME;

Review nodes, taxonomy terms, revisions, custom field tables, reusable blocks, menu links, redirects, aliases, and custom entities. Not every discovered column should be changed. In particular, default_langcode and content_translation_source express translation state; they are not interchangeable with a simple human-language label.

Before changing en to sv, check whether a Swedish row already exists for the same entity. This basic node query should return no rows for a straightforward relabelling:

SELECT en.nid
FROM node_field_data en
INNER JOIN node_field_data sv
  ON sv.nid = en.nid
 AND sv.langcode = 'sv'
WHERE en.langcode = 'en';

Run an equivalent check for taxonomy terms and every other translated entity type. A result indicates a collision: blindly updating the English row could violate a key, overwrite a translation, or leave the entity inconsistent.

Use SQL as a Reviewed Migration, Not a Global Replacement

For a simple site with no existing Swedish translations, the reviewed script may begin with the following core tables. This is a shape to adapt to the site’s schema, not a universal script:

UPDATE node
SET langcode = 'sv'
WHERE langcode = 'en';

UPDATE node_field_data
SET langcode = 'sv'
WHERE langcode = 'en';

UPDATE node_revision
SET langcode = 'sv'
WHERE langcode = 'en';

UPDATE node_field_revision
SET langcode = 'sv'
WHERE langcode = 'en';

UPDATE taxonomy_term_data
SET langcode = 'sv'
WHERE langcode = 'en';

UPDATE taxonomy_term_field_data
SET langcode = 'sv'
WHERE langcode = 'en';

UPDATE taxonomy_term_revision
SET langcode = 'sv'
WHERE langcode = 'en';

UPDATE taxonomy_term_field_revision
SET langcode = 'sv'
WHERE langcode = 'en';

Translated field values also live in tables such as node__field_*, node_revision__field_*, and their taxonomy equivalents. Inventory and update each applicable table explicitly. Keeping the SQL in version control makes peer review, staging rehearsal, and production repetition much safer than pasting commands into an interactive console.

Run the Change as Planned Maintenance

Arrange a content freeze so editors, imports, queues, and integrations do not write competing records. Use the project-local Drush version from the Drupal root, and select the correct alias or --uri on multisite installations. Because legacy projects may pin an older Drush release, confirm the available syntax with vendor/bin/drush help sql:query.

vendor/bin/drush @site sql:dump \
  --result-file=../before-language-change.sql

vendor/bin/drush @site sql:query \
  --file=change-language.sql

vendor/bin/drush @site cache:rebuild

A language-row repair does not itself require updatedb. Run database updates only when the maintenance window also includes a code deployment with pending Drupal update hooks. Rebuild any external search index separately if it stores language metadata.

Test the Journeys the Business Depends On

  • Compare record counts by language before and after the migration.
  • Open representative nodes, terms, revisions, and translated field values.
  • Create new content and confirm its bundle uses the intended language default.
  • Test editing, preview, publishing, moderation, revision rollback, and translation screens.
  • Check Views, menus, aliases, redirects, search, feeds, JSON responses, and language-filtered integrations.
  • Review logs, then obtain sign-off from an editor who understands the affected content.

The safest outcome is not merely “the SQL ran.” It is that editors can work normally, customer-facing journeys remain intact, and the team knows how to restore the previous state. If you need someone to turn an uncertain Drupal language problem into a scoped maintenance plan, bring Greg in before production is changed.

Related on GrN.dk

  • Drupal CMS 2.0 Speeds Marketing Site Rebuilds, but It Is Not Autopilot
  • Google’s AI Search toggle needs a test plan, not a gut decision
  • Google’s August 18, 2026 Content API Cutoff: Feed Cleanup Before Merchant API Migration

Need help with this kind of work?

Plan a safe Drupal language repair Get in touch with Greg.

Sources

  • Install a language | Drupal Multilingual Guide
  • Content Translation module overview
  • Drupal 8 is now end-of-life
  • Drush sql:query command
  • Drush sql:dump command
Last modified
2026-08-11

Tags

  • Drupal 8
  • Multilingual Drupal
  • Drupal Migration
  • Drush
  • Legacy Drupal

Review Greg on Google

Greg Nowak Google Reviews

 

Written recommendations from Trafik og Veje, Aarhus Municipality (2011) and AgroTech (2010) — read them on LinkedIn.

Illustrated infographic summarizing: From Supplier PDFs to Product Data: Where AI Needs a Second Check
From Supplier PDFs to Product Data: Where AI Needs a Second Check
2026-09-07

Supplier files need more than extraction. Here’s how to check coverage, match SKUs, resolve unclear units and prices, and test product data before a catalogue import.

Illustrated infographic summarizing: Shorter TLS Certificates: Will Your Renewal Setup Keep Up?
Shorter TLS Certificates: Will Your Renewal Setup Keep Up?
2026-09-06

Shorter TLS certificates leave less room for renewal problems. Check domain validation, scheduling, deployment and the certificate your customers actually receive.

Illustrated infographic summarizing: Your AI Image Has Content Credentials. Will Your Website Keep Them?
Your AI Image Has Content Credentials. Will Your Website Keep Them?
2026-09-05

AI image credentials can disappear during routine website processing. Learn how to test your CMS, optimizer, CDN, and publishing workflow end to end.

Illustrated infographic summarizing: What Are Customers Asking? Let AI Find the Patterns in Support Tickets
What Are Customers Asking? Let AI Find the Patterns in Support Tickets
2026-09-04

AI-based ticket analysis can uncover recurring complaints, product defects and gaps in documentation—without the company needing yet another chatbot.

Illustrated infographic summarizing: OpenAI Has Machine Identity Now. Which Jobs Should Lose API Keys?
OpenAI Has Machine Identity Now. Which Jobs Should Lose API Keys?
2026-09-03

OpenAI’s X.509 workload identity can replace API keys for the right workloads. This practical framework helps teams decide where to start safely.

Illustrated infographic summarizing: WordPress 7.1 Exposes AI-Ready Actions. Who Gets to Run Them?
WordPress 7.1 Exposes AI-Ready Actions. Who Gets to Run Them?
2026-09-02

WordPress 7.1 helps AI agents discover and invoke site abilities. Here is how to keep exposure, authentication and permission firmly separate.

Illustrated infographic summarizing: From Sales Meeting to CRM: Automate Follow-Up Without Compromising Data Quality
From Sales Meeting to CRM: Automate Follow-Up Without Compromising Data Quality
2026-09-01

How to use AI for meeting notes and follow-up while fixed rules protect CRM data, customer matching and the sales pipeline from errors and premature changes.

Illustrated infographic summarizing: Your AI Gateway Can Name the User. Decide What That Log Is For
Your AI Gateway Can Name the User. Decide What That Log Is For
2026-08-31

Identity-aware AI Gateway logs can sharpen security and cost control, but only when attribution, access, retention, guardrails, and response are clearly defined.

Illustrated infographic summarizing: Zero Data Retention Is a Workflow Audit, Not a Checkbox
Zero Data Retention Is a Workflow Audit, Not a Checkbox
2026-08-30

Zero Data Retention covers the provider, not every copy in your stack. See how to audit endpoints, logs, storage, deletion and project-level controls.

Illustrated infographic summarizing: MCP 2026-07-28 Is an Auth Migration, Not a Version Bump
MCP 2026-07-28 Is an Auth Migration, Not a Version Bump
2026-08-29

MCP’s July 2026 release removes protocol sessions and tightens OAuth. Here’s a practical plan for migrating clients, servers and enterprise access safely.

More articles

Built by AI — available for your business. The daily articles on this site are researched, written and illustrated by an autonomous AI pipeline. At nowa.dk I install the same kind of AI automation in businesses at fixed prices — site in Danish, English version here, and web/marketing agencies have a dedicated page.

RSS feed

Footer

  • All articles
  • Contact

GrN.dk — AI automation, web platforms, web optimization, data handling and logistics.

© 2026 GrN.dk · LinkedIn · Contact · AI automation in Danish: nowa.dk

Behind GrN.dk: Individual Entrepreneur Codecrafter · Tax ID 305669096 · Bakhtrioni St. 22, 0194 Tbilisi, Georgia · official business register