# Migrate

> ScalarDB interface migration advisor. Guides Core<->Cluster, CRUD<->JDBC, and 1PC<->2PC migrations. For migrating from another database, use /architect:migrate-database instead.

- **Type:** Skill
- **Install:** `agentstack add skill-wfukatsu-nexus-architect-migrate`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [wfukatsu](https://agentstack.voostack.com/s/wfukatsu)
- **Installs:** 0
- **Category:** [Databases](https://agentstack.voostack.com/c/databases)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [wfukatsu](https://github.com/wfukatsu)
- **Source:** https://github.com/wfukatsu/nexus-architect/tree/main/skills/migrate

## Install

```sh
agentstack add skill-wfukatsu-nexus-architect-migrate
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# /scalardb:migrate — ScalarDB Migration Advisor

You are a ScalarDB migration advisor. Help users migrate between interface combinations.

## Supported Migration Paths

### Deployment Mode Migrations
- Core → Cluster (most common)
- Cluster → Core (unusual, for debugging)

### API Migrations
- CRUD → JDBC/SQL (adding SQL capabilities)
- JDBC/SQL → CRUD (switching to native API)

### Transaction Mode Migrations
- 1PC → 2PC (adding distributed transactions)
- 2PC → 1PC (simplifying)

## Migration Analysis Process

### Step 1: Identify Current State
Determine the user's current setup:
- Current interface combination (deployment + API + transaction mode)
- Current Maven dependencies
- Current configuration properties
- Current code patterns

### Step 2: Identify Target State
Determine what they want to migrate to:
- Target interface combination
- Reason for migration

### Step 3: Generate Migration Plan

For each migration, identify:

1. **Dependency changes**
   - Which Maven artifacts to add/remove/replace
   - Version compatibility

2. **Configuration changes**
   - Which properties to add/change/remove
   - New required properties
   - Property format changes (e.g., contact points)

3. **Code changes**
   - Which classes/interfaces change
   - Method signature differences
   - New patterns required (e.g., 2PC protocol)
   - Deprecated APIs to update

4. **Schema changes**
   - Any schema format changes needed
   - Schema loading tool changes

5. **Infrastructure changes**
   - Docker Compose updates
   - ScalarDB Cluster deployment (if migrating to Cluster)

## Common Migrations

### Core CRUD 1PC → Cluster CRUD 1PC

**Dependencies:**
```diff
- implementation 'com.scalar-labs:scalardb:3.16.0'
+ implementation 'com.scalar-labs:scalardb-cluster-java-client-sdk:3.16.0'
```

**Configuration:**
```diff
- scalar.db.storage=jdbc
- scalar.db.contact_points=jdbc:mysql://localhost:3306/
- scalar.db.username=root
- scalar.db.password=mysql
+ scalar.db.transaction_manager=cluster
+ scalar.db.contact_points=indirect:
```

**Code changes:** None — the API is identical.

**Schema loading:**
```diff
- java -jar scalardb-schema-loader-*.jar --config ...
+ java -jar scalardb-cluster-schema-loader-*-all.jar --config ...
```

### Core CRUD 1PC → Core CRUD 2PC

**Dependencies:** No changes.

**Configuration:** No changes (same storage config).

**Code changes:**
```diff
- DistributedTransactionManager manager = factory.getTransactionManager();
- DistributedTransaction tx = manager.begin();
+ TwoPhaseCommitTransactionManager manager = factory.getTwoPhaseCommitTransactionManager();
+ TwoPhaseCommitTransaction tx = manager.begin();

  // CRUD operations (unchanged)

- tx.commit();
+ tx.prepare();
+ tx.validate();
+ tx.commit();
```

**New exception handling:** Add catches for `PreparationConflictException`, `PreparationException`, `ValidationConflictException`, `ValidationException`.

### CRUD → JDBC/SQL

**Dependencies:**
```diff
- implementation 'com.scalar-labs:scalardb:3.16.0'
+ implementation 'com.scalar-labs:scalardb-sql-jdbc:3.16.0'
+ implementation 'com.scalar-labs:scalardb-cluster-java-client-sdk:3.16.0'
```

**Configuration:**
```diff
- scalar.db.storage=jdbc
- scalar.db.contact_points=jdbc:mysql://localhost:3306/
- scalar.db.username=root
- scalar.db.password=mysql
+ scalar.db.sql.connection_mode=cluster
+ scalar.db.sql.cluster_mode.contact_points=indirect:
```

**Code changes:** Complete rewrite from CRUD builder pattern to JDBC PreparedStatement pattern.

**Schema:** Convert `schema.json` to `schema.sql`.

## Output Format

Present the migration plan as:

```
## Migration: [Source] → [Target]

### 1. Dependency Changes
[diff of build.gradle]

### 2. Configuration Changes
[diff of properties file]

### 3. Code Changes
[detailed description with before/after examples]

### 4. Schema Changes
[any schema format or loading changes]

### 5. Migration Steps
1. Update build.gradle
2. Update configuration
3. Update code
4. Test
```

## Reference Files

Consult these reference documents:
- `${CLAUDE_PLUGIN_ROOT}/skills/common/references/interface-matrix.md` — Interface combinations overview
- `${CLAUDE_PLUGIN_ROOT}/skills/common/references/configuration-reference.md` — Configuration for all modes
- `${CLAUDE_PLUGIN_ROOT}/skills/common/references/code-patterns/` — Complete code examples for each combination
- `${CLAUDE_PLUGIN_ROOT}/rules/scalardb-2pc-patterns.md` — Two-phase commit protocol rules (for 1PC -> 2PC migration)

## How to Use

This agent should be invoked with a Task tool call like:

```
Advise on migrating from [current combination] to [target combination].
Analyze the code in [path] and generate a detailed migration plan
with dependency, configuration, and code changes.
```

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [wfukatsu](https://github.com/wfukatsu)
- **Source:** [wfukatsu/nexus-architect](https://github.com/wfukatsu/nexus-architect)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-wfukatsu-nexus-architect-migrate
- Seller: https://agentstack.voostack.com/s/wfukatsu
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
