Epic 3: Historical Data Migration
Status
Last Updated: 2026-01-24 Completed: 2026-01-24
Progress Summary:
- β Phase 1: Data Analysis & Mapping - COMPLETE
- β Phase 2: Migration Implementation - 100% COMPLETE (All batch import tools ready)
- β Phase 3: Validation & Testing - READY (Migration tooling complete; production import to be scheduled by organizers)
Completed Batch Imports:
- β Companies (via frontend batch import modal)
- β Speakers (via frontend batch import modal)
- β Events (via frontend batch import modal)
- β Sessions (via frontend batch import modal)
- β Participants/Attendees (BAT-12, BAT-15 complete - API contract + integration)
Epic Overview
Epic Goal: Migrate 20+ years of historical BATbern event data from the existing Angular website to the new platform with 100% data integrity, preserving continuity and making the valuable content archive accessible.
Deliverable: Complete migration of 54+ historical events, speaker profiles, presentations, and company data from JSON files to PostgreSQL microservices with S3 storage for files.
Architecture Context:
- Migration Tool: Frontend batch import modals (changed from original Spring Batch approach)
- Source: Existing Angular website data (JSON/CSV files, presentations, images)
- Targets: Event Management, Speaker Coordination, Company Management Services
- Storage: AWS S3 for presentations, photos, and media with CDN
- Rationale for Frontend Approach: Simpler, reusable, consistent with existing patterns, better user control
Duration: 3 weeks (Weeks 19-21)
Prerequisites: Epic 2 complete (all entity CRUD APIs operational and ready to receive data)
Story 3.1: Historical Data Migration Service
(Formerly Story 1.15)
User Story: As a platform stakeholder, I want all 20+ years of historical BATbern event data migrated accurately, so that the new platform maintains continuity and preserves our valuable content archive.
Architecture Integration:
- Migration Tool: Dedicated Spring Boot application with Spring Batch
- Source Data: Existing Angular application data (JSON, files, images)
- Target Services:
- Event Management Service (events, sessions, timelines)
- Speaker Coordination Service (speaker profiles, bios, photos)
- Company Management Service (company affiliations, partner status)
- Attendee Experience Service (content metadata for search)
- File Storage: AWS S3 for all presentations, photos, and documents
- Validation: PostgreSQL-based validation reports and integrity checks
Migration Scope:
- 54+ Historical Events from ~2000-2024
- 500+ Speaker Profiles with photos and CVs
- 1000+ Presentations (PDF, PPTX files)
- Company Relationships and partner status history
- Photo Galleries for events
- Event Metadata (topics, locations, dates, attendance)
Phase 1: Data Analysis & Mapping (Week 18, Days 1-2)
Acceptance Criteria:
Data Inventory:
- Complete Audit: Catalog all existing data sources (JSON structure, file locations, image paths)
- Data Quality Assessment: Identify missing data, inconsistencies, duplicates, format issues
- Volume Metrics: Document exact counts (events, speakers, presentations, files, images)
- Sample Validation: Manually verify sample data for correctness
Domain Mapping: 5. Event Mapping: Map legacy event JSON to Event Management Service schema 6. Speaker Mapping: Map speaker profiles to Speaker Coordination Service schema 7. Company Mapping: Map company data to Company Management Service schema 8. File Mapping: Map file paths to S3 bucket structure and CDN URLs 9. Relationship Mapping: Define foreign key relationships across services
Migration Strategy: 10. Incremental Approach: Define batch processing strategy (events by year, parallel processing) 11. Rollback Plan: Document rollback procedures for failed migrations 12. Validation Strategy: Define validation rules and acceptance thresholds 13. Error Handling: Plan for partial failures, retries, and manual intervention
Deliverables:
Estimated Duration: 2 days
Phase 2: Migration Implementation (Actual: Frontend Batch Import Approach)
Implementation Approach: Instead of Spring Batch, the team implemented frontend batch import modals for better user control and consistency with existing patterns.
Acceptance Criteria:
Company Data Migration: β COMPLETE
- β Company Batch Import Modal: Upload JSON file with company data
- β Company Profiles: Create/update company records in Company Management Service
- β Logo Migration: Upload company logos to S3 with presigned URLs
- β Duplicate Detection: Check existing companies by name before import
- β Progress Tracking: Real-time progress bar with success/error counts
Speaker Data Migration: β COMPLETE 6. β Speaker Batch Import Modal: Upload JSON file with speaker data 7. β Speaker Profile Migration: Create/update user profiles with SPEAKER role 8. β Photo Migration: Upload speaker photos to S3 via presigned URLs 9. β Change Detection: Identify and update only changed fields 10. β Company Relationships: Link speakers to companies by companyId
Event Data Migration: β
COMPLETE
11. β
Event Batch Import Modal: Upload JSON file with event data
12. β
Event Migration: Create/update 54+ historical events in Event Management Service
13. β
Field Selection: Selectable fields for partial updates (title, description, topic, date, venue, organizer)
14. β
Topic Assignment: Automatic topic assignment based on event category
15. β
Archived Status: All historical events marked with workflowState: ARCHIVED
Session Data Migration: β COMPLETE 16. β Session Batch Import Modal: Upload JSON file with session data 17. β Session Migration: Create event sessions with speaker assignments 18. β Batch Processing: Group sessions by event for efficient API calls 19. β Speaker References: Link sessions to speakers via speakerId 20. β Metadata Migration: Preserve abstracts, PDFs, and session details
Participant Data Migration: β COMPLETE (Story 3.2 - BAT-12, BAT-15) 21. β Participant Batch Import Modal: Upload CSV file with participant attendance data 22. β User Creation: Create users with ATTENDEE role (idempotent get-or-create) 23. β Event Registrations: Create registrations for all events attended (status: attended) 24. β Batch Registration API: Backend endpoint for efficient bulk registration creation 25. β Synthetic Emails: Generate emails for participants without email addresses
Common Features Across All Batch Imports:
- React dropzone for file upload (JSON/CSV)
- Preview table showing items to import with status indicators
- Duplicate detection and handling (skip or update)
- Sequential processing with progress tracking
- Result summary (success, updated, failed, skipped counts)
- Error export for failed items
- React Query cache invalidation after import
Deliverables:
- β
Company batch import modal (
CompanyBatchImportModal.tsx) - β
Speaker batch import modal (
SpeakerBatchImportModal.tsx) - β
Event batch import modal (
EventBatchImportModal.tsx) - β
Session batch import modal (
SessionBatchImportModal.tsx) - β
Participant batch import modal (
ParticipantBatchImportModal.tsx) - BAT-12, BAT-15 - β
Batch registration API endpoint (
POST /events/batch_registrations) - BAT-12, BAT-15 - β³ Batch import pattern template (
docs/templates/frontend/batch-import-pattern.md) - Deferred
Actual Duration: ~6 weeks (distributed across development)
Phase 3: Data Integrity & Validation (Week 19-20, Days 11-15)
Acceptance Criteria:
Referential Integrity:
- Foreign Key Validation: Verify all event-speaker, speaker-company relationships
- Orphan Detection: Identify orphaned records (speakers without events, etc.)
- Duplicate Detection: Find and resolve duplicate entities
- Missing Data Reports: Generate reports of missing optional data
File Migration Validation: 5. File Count Verification: Confirm all files migrated (source count = target count) 6. File Integrity Check: SHA-256 checksum validation for all files 7. CDN Access Validation: Verify all CDN URLs are accessible 8. S3 Bucket Organization: Confirm proper S3 key structure and lifecycle policies
Search Index Building: 9. PostgreSQL Full-Text Indexes: Build search indexes for presentations and events 10. Speaker Search Index: Build speaker search indexes 11. Company Search Index: Build company autocomplete indexes 12. Search Validation: Verify search returns accurate results for sample queries
Data Validation Reports: 13. Migration Success Rate: Generate report showing success/failure counts per entity type 14. Data Quality Report: Document data quality issues found and resolved 15. Referential Integrity Report: Confirm 100% referential integrity 16. Performance Benchmarks: Confirm migration met <4 hour requirement
Deliverables:
Estimated Duration: 5 days (1 week)
Story 3.2: Participant/Attendee Batch Import
User Story: As an organizer, I want to import historical event participation data from a CSV file, so that all past attendees are properly recorded in the system with their event attendance history.
Business Context:
- Data Source:
/apps/BATspa-old/src/api/anmeldungen.csv- 2,307 participants, 57 events - Goal: Complete the historical data migration by adding participant attendance records
- Value: Preserve 20+ years of BATbern attendance history for analytics and attendee tracking
Acceptance Criteria:
CSV Upload & Parsing:
- Organizer can upload CSV file via drag-and-drop interface
- System validates CSV structure (62 columns: 5 metadata + 57 event participation flags)
- System shows preview table with participant details and event count
- CSV parser handles edge cases (BOM character, German characters, missing fields)
User Creation:
5. Create users with role ATTENDEE if they donβt exist (lookup by email)
6. Use existing users if email already exists (idempotent get-or-create)
7. Generate synthetic emails for participants without email: firstname.lastname@batbern.ch
8. Convert German characters in names (Γ€βae, ΓΆβoe, ΓΌβue, Γβss) for email generation
9. Anonymous users created with cognitoSync=false (ADR-005 compliance)
Event Registration Creation:
10. Create event registrations for all events participant attended (column value = β1β)
11. Event codes formatted as BATbern{N} where N is the column number (1-57)
12. Historical registrations marked with status attended
13. Skip participants with no events attended (all columns empty)
14. Handle duplicate registrations gracefully (skip if already exists)
Progress & Feedback: 15. Display progress bar showing participants processed 16. Show real-time statistics (success, partial, failed, skipped counts) 17. Export list of failed participants for manual review 18. Complete full import in under 10 minutes
Technical Implementation:
Frontend Components:
ParticipantBatchImportModal.tsx- Modal UI with CSV dropzoneuseParticipantBatchImport.ts- Business logic hookparticipantImport.types.ts- TypeScript interfacesparticipantImportUtils.ts- CSV parsing with Papa Parse library
Backend Batch API (Proposed):
Endpoint: POST /events/batch_registrations
Purpose: Create multiple event registrations for a participant in a single transaction
Request:
{
"participantEmail": "adrian.buerki@centrisag.ch",
"firstName": "Adrian",
"lastName": "BΓΌrki",
"registrations": [
{ "eventCode": "BATbern17", "status": "attended" },
{ "eventCode": "BATbern25", "status": "attended" },
{ "eventCode": "BATbern31", "status": "attended" },
{ "eventCode": "BATbern32", "status": "attended" }
]
}
Response:
{
"username": "adrian.buerki",
"totalRegistrations": 4,
"successfulRegistrations": 4,
"failedRegistrations": [],
"errors": []
}
Benefits of Batch API:
- 3x reduction in API calls: One batch call per participant instead of N individual calls
- Transactional safety: All-or-nothing per participant (rollback on failure)
- Better error handling: Detailed per-registration results with partial success tracking
- Faster import: 8-12 minutes (down from 25-40 minutes without batch)
- Idempotent operation: Get-or-create user, skip duplicate registrations
Implementation Files:
- Frontend:
ParticipantBatchImportModal.tsx,useParticipantBatchImport.ts, utils - Backend:
BatchRegistrationController.java,BatchRegistrationService.java, DTOs - API spec: Update
events-api.openapi.ymlwith batch registration endpoint
Data Volume:
- Participants: 2,307
- Total registrations: ~11,535-23,070 (avg 5-10 events per participant)
- API calls: ~4,600 (with batch endpoint) vs ~25,400 (without)
Deliverables:
- β CSV parser handling 62-column format with Papa Parse - BAT-13
- β Batch registration API endpoint in Event Management Service - BAT-14
- β Frontend batch import modal following existing patterns - BAT-13
- β Integration tests for batch registration API - BAT-14
- β E2E test for full participant import flow - BAT-15
- β³ Template extraction:
docs/templates/frontend/batch-import-pattern.md- Deferred - β³ All 2,307 participants imported with 100% data integrity - Ready for production use
Success Metrics:
- β API contract defined and validated - BAT-12
- β Frontend UI implemented with CSV handling - BAT-13
- β Backend batch endpoint implemented - BAT-14
- β Integration testing complete - BAT-15
- β³ Production import pending (infrastructure ready)
- β³ Data integrity validation pending (production import)
Estimated Duration: 2-3 days
Migration Monitoring & Error Handling
Real-Time Monitoring:
- Progress Dashboard: Spring Batch Admin dashboard showing job execution status
- ETA Calculations: Real-time estimates for migration completion
- Error Tracking: Real-time error log with failure reasons
- Resource Monitoring: CPU, memory, network usage during migration
Error Handling: 5. Retry Mechanisms: Automatic retry for transient failures (3 attempts) 6. Skip Policy: Skip records with validation errors, log for manual review 7. Manual Intervention: Process for manually correcting and re-running failed records 8. Rollback Procedures: Scripts to rollback partially migrated data
Performance Optimization: 9. Batch Size Tuning: Optimize chunk sizes for performance (100-500 records) 10. Parallel Processing: Run independent jobs in parallel (events, speakers, companies) 11. Database Connection Pooling: Configure adequate connection pools 12. S3 Multipart Upload: Use multipart upload for files >10MB
Deliverables:
Epic 3 Success Metrics
Data Migration Success (End of Week 20):
- β 100% of 54+ historical events migrated successfully
- β 100% of speaker profiles migrated with photos/CVs
- β 100% of presentations migrated to S3 with CDN URLs
- β 100% referential integrity validation pass rate
- β All company relationships established correctly
- β Search indexes built and verified functional
Technical Performance:
- Migration Time: Complete migration in <4 hours total runtime
- Data Integrity: 100% validation pass rate (zero data loss)
- File Upload Speed: >10MB/s average for S3 uploads
- Error Rate: <1% requiring manual intervention
- Search Performance: Migrated content searchable in <500ms
Business Value:
- Content Continuity: 20+ years of BATbern history preserved
- Public Website Ready: Historical content available for browsing (Epic 4)
- Search Functional: Attendees can discover historical presentations
- Speaker Profiles: Complete speaker history accessible
- Archive Complete: Platform ready for production launch
Quality Gates:
Dependencies & Prerequisites
Required Before Starting Epic 3:
- β Epic 2 complete (all entity CRUD APIs operational)
- β Company Management Service API ready
- β Event Management Service API ready
- β Speaker Coordination Service API ready
- β S3 buckets configured with CDN integration
- β PostgreSQL databases ready for data import
- β Caffeine in-memory caches configured for search
Enables Following Epics:
- Epic 4: Public Website (requires migrated events and content for display)
- Epic 5: Enhanced Organizer Workflows (historical data provides context)
- Epic 6: Speaker Portal (speaker history shows past participation)
Risk Management
Technical Risks:
- Risk: Large file uploads may timeout or fail
- Mitigation: Use multipart upload, implement retry logic, monitor progress
- Risk: Data quality issues may require extensive cleanup
- Mitigation: Phase 1 analysis identifies issues early, manual cleanup process
- Risk: Referential integrity violations due to inconsistent legacy data
- Mitigation: Fuzzy matching for speakers/companies, manual review queue
Schedule Risks:
- Risk: Migration taking longer than 3 weeks
- Mitigation: Prioritize event and speaker data first, defer non-critical media
- Mitigation: Parallel processing and performance optimization
- Risk: Data quality issues requiring extensive manual intervention
- Mitigation: Accept some data gaps, document for post-launch cleanup
Transition to Epic 4
Epic 3 Exit Criteria:
Handoff to Epic 4 (Public Website):
- Historical events available via Event Management API
- Event archive searchable via full-text search
- Presentations downloadable via S3/CDN
- Speaker profiles complete with photos
- Platform ready for public website launch
Notes & References
Original Story Location:
- Full story details:
docs/prd/epic-1-foundation-stories.mdStory 1.15 (archived) - Individual story file:
docs/stories/1.15-*.md
Data Sources:
- Existing Angular website data location: [(β¦/β¦/apps/BATspa-old)]
- JSON schema documentation: [(β¦/β¦/apps/BATspa-old/src/api)]
- Sample data for testing: [(β¦/β¦/apps/BATspa-old/src/api)]
Epic Reorganization Context:
- Date: 2025-10-12
- Reason: Isolate data migration as dedicated epic after CRUD foundation (Epic 2)
- Dependencies: Requires Epic 2 complete before migration can begin
- Enables: Public website (Epic 4) requires migrated historical data
This epic was created as part of the epic reorganization on 2025-10-12 to prioritize data migration immediately after entity CRUD foundation.