forcedotcom / forcedotcom/SFDX-Data-Move-Utility
[ISSUE] - Self Reference Target CSV (Account_update_target.csv) gets overwritten with Relationship Update
- Dominant language
- TypeScript
- Stars
- 548
- Forks
- 93
- PR merge metrics
- No merged PRs in 30d
Description
**Issue title**
Self Reference Target CSV (Account_update_target.csv) gets overwritten with Relationship Update
**Issue summary**
Account_update_target.csv is overwritten with the relationship update due to self reference lookup upsert for Account sObject using Account.ParentId.
**Steps to reproduce**
Pre steps:
- Ensure source csv contains existing parent account, an existing child account for update, and a new child account to insert.
1. Run sf sfdmu run --sourceusername csvfile --targetusername hnz-so --path ./data/Account/ --diagnostic --anonymise
2. Log file seems to create multiple times Account_update_target.csv files, overwriting the previous results.
3. First log of this is when the actually upsert/update DML performs, showing success and failure of the source update DML
4. Subsequent logs of these overwrites the first log of this file, only showing the last relationship upsert instead (which I assume is from both the update of existing, and insert of new child records of same sObject), leaving no way to understand the results of the update DML success or failure.
This article most likely describes the issue and process the tool takes but provides no guidance on how to best fix it. https://forcedotcom.github.io/SFDX-Data-Move-Utility/faq/sfdmu-data-insertion-and-limitations/can-child-records-with-a-self-lookup-field-be-inserted-in-a-single-job/
**Expected behavior**
Expected behaviour is either:
1. Account_update_target.csv does not show relationship update results, only shows the original update DML results for success or errors
2. Another file, maybe Account_update_target_relationship.csv is generated into of overwriting the DML result target CSV file generated.
**Actual behavior**
Target CSV file "Account_update_target.csv" is overwritten, containing only the relationship upsert results instead of DML upsert results. This makes it impossible to know what records succeeded or failed as that result file is overwritten. This relationship result CSV contains less column fields, only showing the below:
- Id, RecordTypeId, ParentId, Errors
**Log file (required)**
[2026-07-09__12_32_14.log](https://github.com/user-attachments/files/29831341/2026-07-09__12_32_14.log)
export.json
[export.json](https://github.com/user-attachments/files/29831345/export.json)
source
[Account_source.csv](https://github.com/user-attachments/files/29831347/Account_source.csv)
[RecordType_source.csv](https://github.com/user-attachments/files/29831352/RecordType_source.csv)
target
[Account_insert_target.csv](https://github.com/user-attachments/files/29831356/Account_insert_target.csv)
[Account_update_target.csv](https://github.com/user-attachments/files/29831359/Account_update_target.csv)
Contributor guide
Assessment
This issue has not been assessed yet.