Importing Customer‐Supplied People from a CSV File - RodrigoMattosoSilveira/EnterpriseRemoteSystems GitHub Wiki

  1. 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
  1. Validate the CSV locally first.

  2. Confirm you have a current Production database backup.

  3. Copy the CSV securely to the server, for example:

scp people.csv <server>:/tmp/people.csv
  1. Identify the Production backend container, typically something like:
ers-prd-backend
  1. Confirm the importer binary exists:
docker exec -it <backend-container-name> ls -l /app/import-people
  1. Copy the CSV into the backend container:
docker cp /tmp/people.csv <backend-container-name>:/tmp/people.csv
  1. 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-run

Proceed only if the result shows:

Errors: 0

and the validated row count matches the number of CSV data rows.

  1. 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
  1. 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
⚠️ **GitHub.com Fallback** ⚠️