# Azure Migration Guide

Guide for migrating from Microsoft Azure to Sankofa Phoenix.

## Overview

Sankofa Phoenix provides a superior alternative to Azure with:

- **Sovereign infrastructure**: Own your hardware
- **Better features**: More flexible, granular, better UX
- **No vendor lock-in**: Open source, self-hosted
- **Lower costs**: No per-user licensing
- **Superior billing**: Per-second granularity vs hourly

## Migration Strategy

### Phase 1: Assessment

1. **Inventory Azure resources**
   - List all VMs, storage, networks
   - Document configurations
   - Identify dependencies

2. **Map to Sankofa equivalents**
   - Azure VMs → Phoenix VMs
   - Azure Storage → Phoenix Storage (Ceph/MinIO)
   - Azure Networking → Phoenix Networking
   - Azure AD → Keycloak (Phoenix Identity Spine)

3. **Identify migration blockers**
   - Azure-specific services
   - Proprietary features
   - Licensing dependencies

### Phase 2: Identity Migration

#### From Azure AD to Keycloak

1. **Export users from Azure AD**
   ```powershell
   Get-AzureADUser | Export-Csv users.csv
   ```

2. **Import to Keycloak**
   - Use Keycloak import API
   - Map Azure AD groups to Keycloak groups
   - Preserve user attributes

3. **Configure SSO**
   - Set up SAML/OIDC provider in Keycloak
   - Update applications to use Keycloak
   - Test authentication flows

### Phase 3: Resource Migration

#### VMs

1. **Export VM configurations**
   - Document VM specs
   - Export disk images
   - Note network configurations

2. **Create in Sankofa**
   ```graphql
   mutation {
     createResource(input: {
       name: "vm-name"
       type: VM
       siteId: "site-id"
       metadata: {
         vcpu: 4
         memory: 8192
         disk: 100
       }
     }) {
       id
       status
     }
   }
   ```

#### Storage

1. **Export data from Azure Storage**
   - Use Azure CLI or SDK
   - Download blobs/files

2. **Import to Phoenix Storage**
   - Upload to MinIO/Ceph
   - Preserve directory structure
   - Update application configs

#### Networking

1. **Document network topology**
   - VNets, subnets, NSGs
   - Load balancers
   - VPN connections

2. **Recreate in Phoenix**
   - Use Proxmox networking
   - Configure VLANs
   - Set up Cloudflare tunnels

### Phase 4: Application Migration

1. **Update API endpoints**
   - Change from Azure APIs to Phoenix APIs
   - Update authentication
   - Test functionality

2. **Update configurations**
   - Environment variables
   - Connection strings
   - Service endpoints

3. **Deploy to Phoenix**
   - Use GitOps (ArgoCD)
   - Deploy via Crossplane
   - Verify functionality

## Feature Mapping

| Azure Service | Sankofa Phoenix Equivalent | Notes |
|---------------|----------------------------|-------|
| Azure AD | Keycloak | Sovereign, self-hosted |
| Azure VMs | Phoenix VMs (Proxmox) | More flexible |
| Azure Storage | Phoenix Storage (Ceph/MinIO) | S3-compatible |
| Azure Networking | Phoenix Networking | Cloudflare tunnels |
| Azure Cost Management | Phoenix Billing | Per-second vs hourly |
| Azure RBAC | Phoenix Permissions | More granular |
| Azure Monitor | Prometheus/Grafana | Open source |

## Benefits of Migration

1. **Cost Savings**
   - No per-user licensing
   - Per-second billing (vs hourly)
   - Reserved capacity discounts

2. **Better Control**
   - Own your infrastructure
   - No vendor lock-in
   - Custom configurations

3. **Superior Features**
   - Per-second billing
   - Real-time cost tracking
   - ML-based forecasting
   - Blockchain-backed billing

4. **Sovereignty**
   - Complete data control
   - No Microsoft dependencies
   - Self-hosted everything

## Migration Checklist

- [ ] Inventory Azure resources
- [ ] Map to Sankofa equivalents
- [ ] Export users from Azure AD
- [ ] Import to Keycloak
- [ ] Configure SSO
- [ ] Export VM configurations
- [ ] Create VMs in Sankofa
- [ ] Migrate storage data
- [ ] Recreate network topology
- [ ] Update applications
- [ ] Test functionality
- [ ] Cut over traffic
- [ ] Decommission Azure resources

## Support

For migration assistance, contact:
- Documentation: [docs/tenants/](./)
- Support: support@sankofa.nexus

