Summary
A partial import — import-ldif with --includeBranch and/or --excludeBranch — silently destroys all existing entries outside of the imported scope, then aborts with:
The import has been aborted because the entry '...ou=people' does not have a parent entry
leaving the backend without the pre-existing data.
Steps to reproduce
- Import a full base DN, e.g.
dc=example,dc=com with several branches (ou=people, ou=groups, ...).
- Run a partial re-import of one branch:
import-ldif --backendID userRoot --includeBranch ou=people,dc=example,dc=com --ldifFile people.ldif
Expected (and 2.x behaviour): only ou=people,dc=example,dc=com is replaced by the LDIF content; the base entry and the sibling branches are preserved.
Actual: the import aborts with the "does not have a parent entry" error above (the parent dc=example,dc=com no longer exists at phase-2 time), and the entries outside the include branch are gone.
Root cause
Since the import was rewritten around OnDiskMergeImporter (DJ 3.x), the importer deletes the whole entry container (beforePhaseOne → entryContainer.delete()) before rebuilding it from the filtered LDIF content. The 2.x importer used to migrate the entries outside of the imported scope into the new container (MigrateExistingTask / MigrateExcludedTask in the old jeb/Importer.java, removed in OPENDJ-2337): --includeBranch defines the scope of the replacement, everything else in the base DN must be preserved.
How it was found
Running the slow TestNG group (excluded from CI): TestImportAndExport.testImportExport fails on the include-branch: ou=people,dc=example,dc=com case with STOPPED_BY_ERROR.
Summary
A partial import —
import-ldifwith--includeBranchand/or--excludeBranch— silently destroys all existing entries outside of the imported scope, then aborts with:leaving the backend without the pre-existing data.
Steps to reproduce
dc=example,dc=comwith several branches (ou=people,ou=groups, ...).Expected (and 2.x behaviour): only
ou=people,dc=example,dc=comis replaced by the LDIF content; the base entry and the sibling branches are preserved.Actual: the import aborts with the "does not have a parent entry" error above (the parent
dc=example,dc=comno longer exists at phase-2 time), and the entries outside the include branch are gone.Root cause
Since the import was rewritten around
OnDiskMergeImporter(DJ 3.x), the importer deletes the whole entry container (beforePhaseOne→entryContainer.delete()) before rebuilding it from the filtered LDIF content. The 2.x importer used to migrate the entries outside of the imported scope into the new container (MigrateExistingTask/MigrateExcludedTaskin the oldjeb/Importer.java, removed in OPENDJ-2337):--includeBranchdefines the scope of the replacement, everything else in the base DN must be preserved.How it was found
Running the
slowTestNG group (excluded from CI):TestImportAndExport.testImportExportfails on theinclude-branch: ou=people,dc=example,dc=comcase withSTOPPED_BY_ERROR.