> For the complete documentation index, see [llms.txt](https://docs.flexbase.in/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.flexbase.in/flexbase-mcp-ai-prompts/legacy-migration-prompts-md-file.md).

# Legacy Migration Prompts - md file

> Analyze legacy application source code, extract modules, features, validations, and domain services, and produce FlexBase-ready Markdown and JSON.

## How to Use

Point your AI agent at the legacy project folder. It will auto-detect the platform, load the appropriate analysis patterns, and extract all migration artifacts.

**Example prompts you can give your AI agent:**

```
Migrate this legacy application to FlexBase
```

```
Analyze this legacy codebase and extract all modules and features
```

```
Migrate this PowerBuilder application to FlexBase
```

```
Migrate this legacy application to FlexBase — extract stored procedures and triggers too
```

```
Convert this Java Spring Boot application to FlexBase
```

***

## Key Rules (Applied Automatically)

The agent loads migration conventions via MCP tools. Key rules:

* **All names PascalCase** — modules, features, validations, events, subscribers, domain services
* **Module names PLURAL** (e.g., `Orders`, `Customers`, `Payments` — NOT `OrderManagement`)
* **Feature names operation-centric** (e.g., `CreateOrder`, `UpdateOrder`, `GetOrderById`)
* **All `description` fields ≤150 characters**
* **Domain entities include `metadata.originalName`** — lowercase original table/source name
* **Events include conditions** — `OnSuccess` (primary) or `OnFailed` (primary)
* **Large files split automatically** — per-module Markdown and JSON files

***

## Supported Platforms

The agent auto-detects the legacy platform from project file signatures:

| Platform              | Detection                                |
| --------------------- | ---------------------------------------- |
| PowerBuilder          | `.pbl`, `.pbt`, `.pbproj` files          |
| .NET (C#/VB.NET)      | `.csproj`, `.sln`, `.vbproj` files       |
| Java / Spring         | `pom.xml`, `build.gradle` files          |
| Python / Django/Flask | `manage.py`, `requirements.txt` files    |
| PHP / Laravel/Symfony | `composer.json`, `artisan` files         |
| Ruby on Rails         | `Gemfile`, `config/routes.rb` files      |
| JavaScript / Node.js  | `package.json` with Express/Nest markers |

After detection, the agent reports the detected platform, UI framework, and analysis strategy.

***

## Extraction Modes

**With Database Access (Recommended):**

* Agent auto-discovers database connection from config files
* Complete entity definitions with FK relationships and column metadata
* FK chain analysis discovers junction tables and lookups

**Without Database Access (Artifact-Only):**

* Extracts from source code artifacts only
* Flags potential gaps for user review

***

## Prompts

The extraction prompts are organized into dedicated files:

| File                                                                                                            | Contents                                                         |
| --------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------- |
| [Legacy Migration → Markdown](/flexbase-mcp-ai-prompts/legacy-migration-prompts-md-file.md)                     | Markdown extraction (modules, features, events, domain services) |
| [Legacy Migration → JSON](/flexbase-mcp-ai-prompts/legacy-migration-prompts-json-file.md)                       | JSON generation                                                  |
| [PowerBuilder Project Analysis](/flexbase-mcp-ai-prompts/legacy-migration-pb-analysis-prompts.md)               | PB format detection & reading                                    |
| [Stored Procedure & Trigger Extraction](/flexbase-mcp-ai-prompts/legacy-migration-stored-procedures-prompts.md) | SP/trigger extraction and mapping                                |

***

## Recommended Workflow

1. **Auto-detect** the legacy platform (automatic)
2. **Extract to Markdown** first (review & refine)
3. **Generate JSON** from reviewed extraction
4. **Import JSON** into FlexBase Studio

***

## Related

* **BRD extraction:** [BRD → Markdown](/flexbase-mcp-ai-prompts/brd-extraction-prompts-md-file.md) | [BRD → JSON](/flexbase-mcp-ai-prompts/brd-extraction-prompts-json-file.md)
* **After extraction:** [Implementation Completion](/flexbase-mcp-ai-prompts/implementation-completion-prompts.md)
* **UI generation:** [Blazor](/flexbase-mcp-ai-prompts/blazor-fluent-ui-guide-prompts.md) | [Angular](/flexbase-mcp-ai-prompts/angular-ui-guide-prompts.md) | [React](/flexbase-mcp-ai-prompts/react-js-ui-guide-prompts.md)
