# School Data Migration Guide

## Introduction
This guide will help you migrate your school's data from your existing system to our platform. The migration wizard is designed to be simple and error-free.

## Before You Start

### What You'll Need
- Your student records (Excel/CSV format preferred)
- Staff information
- Fee structures and payment history
- Class and subject lists
- At least 30 minutes of uninterrupted time

### Data Preparation Tips
1. **Clean your data first** - Remove duplicates, fix spelling errors
2. **Use our templates** - Download templates below for each data type
3. **Check required fields** - Ensure all mandatory fields are filled
4. **Format dates as YYYY-MM-DD** - Example: 2026-03-30
5. **Phone numbers** - Use Ghana format: 0244123456 or 233244123456

## Step-by-Step Migration Process

### Step 1: Choose Your Data Source
Select how you want to provide your data:
- **CSV/Excel Files** - Upload spreadsheets (recommended)
- **GESMIS Export** - For government schools using GESMIS
- **OneRoster Format** - For international schools

### Step 2: Upload Your Files
1. Download the appropriate template for each data type
2. Fill in your data (follow the examples)
3. Upload files by dragging them to the upload area
4. You can upload multiple files at once

### Step 3: Validate & Cleanse
The system will automatically check your data for:
- Missing required fields
- Invalid phone numbers
- Incorrect date formats
- Duplicate records
- Class name mismatches

You'll see a report showing:
- ✅ Valid records (ready to import)
- ⚠️ Warnings (minor issues to review)
- ❌ Errors (must fix before import)

### Step 4: Preview & Map Fields
Review a sample of your data and ensure each column maps correctly:
- System will auto-match fields
- You can manually adjust mappings
- Preview shows how data will appear

### Step 5: Import
Click "Start Import" and monitor progress:
- Progress bar shows completion
- Live log shows each step
- Don't close the browser until complete

## After Migration

### Verification Checklist
- [ ] Count students in system matches your records
- [ ] Sample student details are correct
- [ ] Fee structures appear correctly
- [ ] Staff list is complete
- [ ] Test a few payments

### Common Issues & Solutions

| Issue | Solution |
|-------|----------|
| "Duplicate student ID" | Remove duplicates from your file |
| "Class not found" | Create the class first in system |
| "Invalid phone number" | Format as 0244123456 or 233244123456 |
| "Date format error" | Use YYYY-MM-DD (e.g., 2026-03-30) |

### Need Help?
Contact our support team:
- Email: support@schoolsystem.com
- Phone: 024-XXX-XXXX
- Office hours: Mon-Fri, 8am-5pm

## Templates Download

| Template | Purpose | Required Fields |
|----------|---------|-----------------|
| [Students Template](templates/students_template.csv) | Student records | student_id, first_name, last_name, class |
| [Staff Template](templates/staff_template.csv) | Staff information | staff_id, full_name |
| [Fees Template](templates/fees_template.csv) | Fee structures | class_name, fee_type, amount, due_date |
| [Payments Template](templates/payments_template.csv) | Payment history | student_id, fee_type, amount_paid, payment_date |
| [Subjects Template](templates/subjects_template.csv) | Subjects & classes | subject_name, class_name |

## Quick Reference

### File Format Requirements
- **File type**: CSV (Comma Separated Values)
- **Encoding**: UTF-8
- **First row**: Column headers
- **Max file size**: 50MB
- **Max rows per file**: 50,000

### Required Field Formats
- **Dates**: YYYY-MM-DD (2026-03-30)
- **Phone**: 0244123456 or 233244123456
- **Amounts**: 500.00 (use decimal point)
- **Names**: John Doe (proper capitalization)

### Ghana-Specific Handling
- Phone numbers automatically formatted to international format
- Ghanaian name prefixes (Nana, Obaapa) properly capitalized
- Support for GESMIS export format
- Mobile Money payment integration available

## Best Practices

1. **Start with a small test batch** (10-20 records)
2. **Keep original files** as backup
3. **Review validation reports** carefully
4. **Fix issues before re-uploading**
5. **Run test queries** after import

## Support
For assistance during migration, please contact our migration team:
- **Email**: migration@schoolsystem.com
- **Phone**: 024-XXX-XXXX
- **Live Chat**: Available in dashboard