Importing Alumni
This guide covers how to import new alumni into the system from TSV (tab-separated) files.
Before You Begin
Important: Read Alumni_Database/IMPORT-FROM-ALMABASE.md for complete details on the import process and field mappings.
Preparing the Import File
Create a TSV file with these columns (tab-separated):
| Column | Description | Required |
|---|---|---|
| First Name | Given name | Yes |
| Last Name | Family name | Yes |
| Email address (or empty) | No | |
| State | Two-letter state code or country | No |
| City | City name | No |
| Class Year | 4-digit year (e.g., 1992) | Yes |
Running the Import
Single Alumni
./import_one_alumni.sh "First Last email@example.com CA San Francisco 1992"
Batch Import from TSV
while IFS=$'\t' read -r FIRST LAST EMAIL STATE CITY YEAR; do
./import_one_alumni.sh "$FIRST $LAST $EMAIL $STATE $CITY $YEAR"
done < alumni_to_import.tsv
Parallel Import (Faster)
count=0
while IFS=$'\t' read -r FIRST LAST EMAIL STATE CITY YEAR; do
./import_one_alumni.sh "$FIRST $LAST $EMAIL $STATE $CITY $YEAR" &
((count++ % 8 == 0)) && wait
done < alumni_to_import.tsv
wait
What the Import Does
- Creates WordPress user with
um_alumnirole - Sets username as
firstname.lastname(orfirstname.lastname.YYYYif conflict) - For users without email: creates placeholder
firstname.lastname.YYYY@noemail.antiochians.org - Sets Ultimate Member metadata
- Syncs to MailerPress (if real email)
- Geocodes location (if city/state provided)
Checking for Existing Users
Before importing, filter out users who already exist:
# Get existing emails ./wp-cli-php83.sh user list --field=user_email --role=um_alumni | sort -u > existing.txt # Filter import file cut -f3 import_file.tsv | sort -u | comm -23 - existing.txt > new_emails.txt
After Import
- Verify user count:
./wp-cli-php83.sh user list --role=um_alumni --format=count - Run geocoding:
./wp-cli-php83.sh um-maps geocode-all - Check MailerPress sync:
./wp-cli-php83.sh um-mailerpress stats
Troubleshooting
- "User already exists" - Email is already in the system
- "Invalid email" - Email format is incorrect
- Duplicate usernames - Script auto-appends class year