diff --git a/src/applications/transactions/bulk/management/PhabricatorBulkManagementExportWorkflow.php b/src/applications/transactions/bulk/management/PhabricatorBulkManagementExportWorkflow.php index 154c266da2..53d8441f91 100644 --- a/src/applications/transactions/bulk/management/PhabricatorBulkManagementExportWorkflow.php +++ b/src/applications/transactions/bulk/management/PhabricatorBulkManagementExportWorkflow.php @@ -114,6 +114,10 @@ final class PhabricatorBulkManagementExportWorkflow $iterator = $file->getFileDataIterator(); if (strlen($output_path)) { + // Empty the file before we start writing to it. Otherwise, "--overwrite" + // will really mean "--append". + Filesystem::writeFile($output_path, ''); + foreach ($iterator as $chunk) { Filesystem::appendFile($output_path, $chunk); }