# mojoPortal 1.0.0-alpha — Embedded Server Portal

A modernized, self-contained ASP.NET Framework 4.8.1 portal system optimized for embedded deployment into servers. Features a comprehensive legacy data migration system for resurrecting existing portal installations.

**Version:** 1.0.0-alpha | **Status:** Alpha Testing | **Platform:** .NET Framework 4.8.1 with SQLite

---

## What's New in 1.0.0-alpha

### 🆕 Migration System
- **Resurrecting Legacy Portals** — Complete legacy database migration with preservation of pages, modules, permissions, and settings
- **Three-Phase Process** — Inspect → Analyze → Execute with real-time progress tracking
- **DevAdmin Integration** — "Siphon" button for quick migration access from the running program
- **Comprehensive Documentation** — Essay-style guide with verification steps and troubleshooting

### Core Portal Features
- Hierarchical page management with parent-child relationships
- Extensible module system with built-in modules
- Role-based permissions for granular access control
- Comprehensive admin interface
- Full-text search integration
- Content workflow and versioning
- Clean URL support

### Developer Features
- DevAdmin tools (Server Variables, Query Tool)
- Migration Analyzer API
- Audit logging for all migrations
- Parameterized queries (SQL injection prevention)

---

## Quick Start

### Prerequisites
- IIS or IIS Express
- .NET Framework 4.8.1 Runtime
- Visual Studio 2019+ (for development)
- SQLite support (included)

### Deployment
1. Clone repository to: `C:\___Fire\SqliteMojo`
2. Map IIS to: `C:\___Fire\SqliteMojo\Web`
3. Access portal at: `https://phosend.com/Portal`
4. Admin at: `https://phosend.com/Portal/Admin`
5. DevAdmin at: `https://phosend.com/Portal/DevAdmin`

### Quick Migration
1. Copy legacy database to: `Web/Data/sqlitedb/legacy.db.config`
2. Navigate to: `https://phosend.com/Portal/DevAdmin/Default.aspx`
3. Click: **"Siphon (Migration)"** button
4. Choose: **"Execute Full Migration"** or analyze first
5. Verify results in Admin → Pages

---

## Project Structure

```
Web/
├── Admin/
│   ├── MigrationExecutor.aspx    # Migration executor UI
│   ├── MigrationInspector.aspx   # Legacy database inspector
│   └── MigrationAnalyzer.ashx    # Migration API backend
├── DevAdmin/
│   ├── Default.aspx              # DevAdmin home (with Siphon button)
│   ├── ServerVariables.aspx      # System information
│   └── QueryTool.aspx            # Database query interface
├── Data/sqlitedb/
│   ├── mojo.db.config            # Active portal database
│   ├── legacy.db.config          # Source database (if migrating)
│   └── MIGRATION_GUIDE.md        # Comprehensive migration docs
└── [Portal content and configuration]

mojoPortal.Data.SQLite/
├── LegacyDataMigrationEngine.cs  # Core migration logic
└── LegacyMigrationHelper.cs      # Migration analysis helper
```

---

## Features

### Original mojoPortal Features
- [Blog](https://www.mojoportal.com/docs/blog)
- [Image Gallery](https://www.mojoportal.com/docs/image-gallery)
- [Forum](https://www.mojoportal.com/docs/forums)
- [Contact Form](https://www.mojoportal.com/docs/contact-form)
- [Newsletter](https://www.mojoportal.com/docs/newsletter)
- [WebStore](https://www.mojoportal.com/docs/webstore)
- [Content Workflow](https://www.mojoportal.com/docs/content-workflow)
- [Content Versioning](https://www.mojoportal.com/docs/content-versioning)
- [Integrated Site Search](https://www.mojoportal.com/docs/site-search)
- [Users](https://www.mojoportal.com/docs/managing-users), [Roles and Permissions](https://www.mojoportal.com/docs/roles-permissions)
- Calendar, Survey, and more

### 1.0.0-alpha New Features
- **Comprehensive Migration System** — Resurrect legacy portal data automatically
- **DevAdmin Integration** — One-click access to migration tools
- **Real-Time Progress Tracking** — Watch migration as it happens
- **Audit Logging** — Complete record of all migrated items
- **Error Recovery** — Graceful handling of incompatibilities
- **Comprehensive Documentation** — Essay-style guides with examples

---

## Migration System Overview

### Three-Phase Process

**Phase 1: Inspection**
```
/Admin/MigrationInspector.aspx
Analyze legacy database without any changes
View: Pages, modules, settings, statistics
Risk: None (read-only)
```

**Phase 2: Analysis**
```
/Admin/MigrationExecutor.aspx → "Analyze Only"
Preview what will be migrated and identify issues
View: Module mappings, warnings, statistics
Risk: None (read-only)
```

**Phase 3: Execution**
```
/Admin/MigrationExecutor.aspx → "Execute Full Migration"
Perform actual migration with real-time progress
View: Item-by-item log, final summary, statistics
Risk: Additive only (existing items skipped)
```

### What Gets Migrated
- ✅ Pages (hierarchy, metadata, permissions)
- ✅ Modules (settings, associations, ordering)
- ✅ Permissions (view/edit roles)
- ✅ Site Settings (configuration values)
- ✅ Audit Information (creation/modification dates)
- ✅ Module Type Mapping (by FeatureGuid)

---

## Documentation

| Document | Purpose |
|----------|---------|
| **VERSION.md** | Version info, release notes, upgrade path |
| **MIGRATION_GUIDE.md** | Complete legacy migration walkthrough |
| **Web/Data/sqlitedb/MIGRATION_GUIDE.md** | Detailed migration guide (same location) |
| Source Comments | Implementation details |

---

## Administration

### Access Points
- **Portal Home:** `/Portal`
- **Admin Menu:** `/Portal/Admin`
- **Pages Management:** `/Portal/Admin/Pages/Default.aspx`
- **Migration Inspector:** `/Portal/Admin/MigrationInspector.aspx`
- **Migration Executor:** `/Portal/Admin/MigrationExecutor.aspx`
- **DevAdmin Tools:** `/Portal/DevAdmin/Default.aspx` (includes Siphon button)

### Common Tasks
1. **Create Pages:** Admin → Pages → Add Page
2. **Manage Modules:** Admin → Modules → Configure
3. **Set Permissions:** Page/Module Edit → Roles
4. **Migrate Legacy DB:** DevAdmin → "Siphon" → Execute
5. **Verify Migration:** Admin → Pages (check hierarchy)

---

## Database

### Self-Contained SQLite
- No external database server required
- Database file: `Web/Data/sqlitedb/mojo.db.config`
- Auto-initializes on first run
- Easy backup (copy file)

### Migration Support
- Automatic legacy database detection
- Guided migration process
- Comprehensive error recovery
- Audit trail of all operations

---

## Security

- ✅ Parameterized SQL queries (no injection)
- ✅ Role-based access control
- ✅ Admin authentication required
- ✅ Audit logging of admin actions
- ✅ Authorization checks on all operations

---

## Performance

| Operation | Expected Time |
|-----------|---|
| Page Load | < 1 second |
| Admin Operations | < 2 seconds |
| Small Migration | 5-30 seconds |
| Large Migration | 2-5 minutes |

---

## Deployment Information

### Directory Structure
```
C:\___Fire\SqliteMojo\Web   ← IIS mapped to this directory
    │
    ├── Admin/              ← Admin interface & migration tools
    ├── DevAdmin/           ← Developer admin tools
    ├── Data/sqlitedb/      ← SQLite databases
    └── [Portal pages]
```

### Portal Access (via https://phosend.com)
- Portal: `https://phosend.com/Portal`
- Admin: `https://phosend.com/Portal/Admin`
- DevAdmin: `https://phosend.com/Portal/DevAdmin`
- Migration: `https://phosend.com/Portal/DevAdmin/Default.aspx` → "Siphon" button

---

## Testing & Feedback

### Alpha Testing Status
This release (1.0.0-alpha) is actively undergoing testing and refinement. Please report:

- ✅ **Successful deployment landmarks**
- ✅ **Migration completion milestones**
- ✅ **Performance metrics and observations**
- ⚠️ **Errors or unexpected behavior**
- 💡 **Feature requests and improvements**

### How to Report
- Include web content snippets when relevant
- Share complete error messages and logs
- Provide exact reproduction steps
- Attach migration logs if applicable

---

## Roadmap

- **1.0.0** — Stable release after alpha feedback
- **1.0.1** — Performance optimizations
- **1.1.0** — Multi-site migration support
- **1.2.0** — Database adapter support (SQL Server, MySQL)
- **2.0.0** — Modernized UI framework

---

## Learn More

For detailed information:
- **Getting Started:** See MIGRATION_GUIDE.md
- **Deployment:** See VERSION.md for deployment details
- **Administration:** Admin menu in the running portal
- **Original mojoPortal:** [www.mojoportal.com](https://www.mojoportal.com)

---

**mojoPortal 1.0.0-alpha** — Embedding portal solutions into servers, one deployment at a time. 🚀

*Alpha Version | .NET Framework 4.8.1 with SQLite | Feedback Welcome*
