Skip to content

fix: Changed the mapper path from contentDir to backupDir for taxonom…#2438

Merged
cs-raj merged 1 commit intov2-beta-devfrom
fix/DX-5129
Feb 27, 2026
Merged

fix: Changed the mapper path from contentDir to backupDir for taxonom…#2438
cs-raj merged 1 commit intov2-beta-devfrom
fix/DX-5129

Conversation

@cs-raj
Copy link
Contributor

@cs-raj cs-raj commented Feb 27, 2026

Fix: Taxonomy fields removed during content-types import (contentDir vs backupDir)

Problem

During import, taxonomy fields on content types were being removed instead of preserved. That led to:

  • Content type schemas losing taxonomy field definitions
  • Entry import failing when entries referenced those taxonomy fields

Root cause

The import flow uses two base paths after backup:

  • contentDir – original export folder (user-provided path)

  • backupDir – copy created by backupHandler (e.g. _backup_123)

  • The taxonomies module writes its success file to backupDir/mapper/taxonomies/success.json.

  • The extensions module writes pending extensions to backupDir/mapper/extensions/pending_extensions.js.

  • Content-types was reading both from contentDir (mapper/taxonomies/success.json and mapper/extensions/pending_extensions.js).

So content-types never saw the files written in the current run. For taxonomies, lookUpTaxonomy got missing/empty data, treated every taxonomy as “not in stack,” and stripped taxonomy fields from schemas.

Solution

Content-types now reads mapper outputs from the same base as the modules that write them:

  1. Taxonomy success
    taxonomiesPath is built from importConfig.backupDir instead of importConfig.contentDir, so it points to backupDir/mapper/taxonomies/success.json.

  2. Pending extensions
    extPendingPath is built from importConfig.backupDir instead of importConfig.contentDir, so it points to backupDir/mapper/extensions/pending_extensions.js.

Rule used: mapper and any file written during import → backupDir; export content (read-only source) → contentDir.

Changes

  • packages/contentstack-import/src/import/modules/content-types.ts
    • taxonomiesPath: contentDirbackupDir
    • extPendingPath: contentDirbackupDir

Verification

  • Taxonomy fields on content types are preserved during import.
  • Entry import succeeds when entries use taxonomy fields.
  • Pending extensions are correctly picked up when content-types runs after the extensions module.

@cs-raj cs-raj merged commit 90cda88 into v2-beta-dev Feb 27, 2026
10 checks passed
@cs-raj cs-raj deleted the fix/DX-5129 branch February 27, 2026 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants