# Importing the converted Unicohstech database

The destination must be a completely empty MySQL 8 database. Back up any existing database first.

## phpMyAdmin

1. Create or select the empty destination database.
2. Open **Import** and select `unicohstech_converted.sql`.
3. Choose UTF-8 and SQL format, then start the import.
4. Confirm that phpMyAdmin reports success and run the checks below.

## Command line

```bash
mysql --default-character-set=utf8mb4 -u DATABASE_USER -p DATABASE_NAME < unicohstech_converted.sql
```

## Post-import checks

```sql
SELECT COUNT(*) FROM users;
SELECT COUNT(*) FROM students;
SELECT COUNT(*) FROM course_registrations;
SELECT COUNT(*) FROM results WHERE status = 'published';
SELECT issue_code, COUNT(*) FROM migration_issues GROUP BY issue_code ORDER BY issue_code;
SELECT SUM(amount) FROM payments WHERE status = 'successful';
```

Compare these results with `migration-report.json`. The converted dump intentionally credits no historical payments because every payment-table row in the supplied source was unconfirmed. Review `migration-issues.csv` before manually confirming any payment.

Create the new super-admin after import with `api/database/bootstrap_admin.php`. The old administrator accounts and plaintext recovery passwords were not migrated.
