Importing Customer‐Supplied People from a CSV File - RodrigoMattosoSilveira/EnterpriseRemoteSystems GitHub Wiki
- Prepare a CSV with the canonical header:
firstName,lastName,nickname,cpf,rg,cellular,email,statusId,notes,street1,street2,city,state,cep,country,bankName,bankNumber,checkingAccount,pixKey,emergencyName,emergencyCellular,emergencyEmail-
Validate the CSV locally first.
-
Confirm you have a current Production database backup.
-
Copy the CSV securely to the server, for example:
scp people.csv <server>:/tmp/people.csv- Identify the Production backend container, typically something like:
ers-prd-backend
- Confirm the importer binary exists:
docker exec -it <backend-container-name> ls -l /app/import-people- Copy the CSV into the backend container:
docker cp /tmp/people.csv <backend-container-name>:/tmp/people.csv- Run a dry run first, explicitly identifying the target Tenant:
docker exec -it <backend-container-name> \
/app/import-people \
-db /app/data/app.db \
-file /tmp/people.csv \
-tenant-id '<PRODUCTION-TENANT-ID>' \
-dry-runProceed only if the result shows:
Errors: 0
and the validated row count matches the number of CSV data rows.
- Run the real import:
docker exec -it <backend-container-name> \
/app/import-people \
-db /app/data/app.db \
-file /tmp/people.csv \
-tenant-id '<PRODUCTION-TENANT-ID>'Expected Summary
Rows read: <number>
Rows validated: <number>
Rows inserted: <number>
Errors: 0
- Verify the imported People in the ERS UI and, where useful, directly in SQLite. Then remove the temporary CSV:
docker exec -it <backend-container-name> rm -f /tmp/people.csv
rm -f /tmp/people.csv