Project Migration Guide

Moving a project from local development to the remote MigrationCoordinator at mc.shareddev.com

Prerequisites

The server's SSH key is added at the GitHub account level (SharedDev01 → Settings → SSH keys). It works for all repos under the account automatically. No per-repo deploy key needed.

Step 1: Register the Project

1aUpdate the project's .mcp.json

Point the project to the production coordinator:

{
  "mcpServers": {
    "MigrationCoordinator": {
      "type": "http",
      "url": "https://mc.shareddev.com/rpc",
      "headers": {
        "Mcp-Session-Id": "YourProjectName",
        "X-Api-Key": "your-production-api-key"
      }
    }
  }
}
The API key can be found in the .mcp.json of any project already connected (e.g., MigrationSystem). Make sure .mcp.json is in .gitignore.

1bRegister via Claude Code

From a Claude Code session in the project, the agent will call:

mc_register_project(name: "YourProjectName", github_repo: "SharedDev01/YourRepo")

This creates the project in the coordinator database. All other MCP tools will be blocked until an administrator configures the project settings in the dashboard.

Step 2: Configure Project Settings

2Fill in settings on the dashboard

Go to mc.shareddev.com → click the project → Settings tab.

FieldValueExample
Reference DB Connection SQL auth connection to the reference database on the server Server=localhost;Database=YourProject_ref;User Id=migcoord;Password=...;TrustServerCertificate=True;
Migrations Folder Absolute path on the server /repos/YourProject/database/migrations
Baseline MDF Path Absolute path on the server /repos/YourProject/database/baseline/YourProject.mdf
GitHub Repository Owner/RepoName SharedDev01/YourRepo
Use SQL authentication (User Id + Password), not Windows/Trusted authentication. The server runs Linux — Trusted_Connection does not work.
The config will save successfully even though the reference database doesn't exist yet. You'll see a yellow warning — that's expected. The database will be created in the next steps.

Step 3: Sync from Git

3Click "Sync from Git" on the project dashboard

Go to the project's main page (Dashboard tab). You should see a Maintenance section with buttons.

Click Sync from Git. This will:

  1. Clone the repo to /repos/YourProject/ on the server (first time)
  2. Or pull the latest default branch (subsequent syncs)
  3. The baseline .mdf and migration files will be on the server
The code auto-detects the default branch (main, master, etc.). You don't need to rename branches.

Step 4: Recreate Reference Database

4Click "Recreate Reference DB"

This will:

  1. Copy the baseline .mdf to the SQL Server data directory
  2. Attach it as YourProject_ref
  3. Apply any pending migration scripts
  4. Fix file permissions (Linux)

After this, the deployment status banner should show green with the migration count.

Step 5: Migrate Ticket Sequence (Optional)

5Copy the ticket sequence from the local coordinator

If the project was previously registered on the local coordinator (port 8620) and has issued ticket IDs, you need to copy the sequence to avoid ID conflicts.

On the local coordinator database:

SELECT t.LastTicketId FROM dbo.TicketSequences t
JOIN dbo.Projects p ON t.ProjectId = p.ProjectId
WHERE p.Name = 'YourProjectName'

On the remote coordinator database (MigrationCoordinator_prod):

INSERT INTO dbo.TicketSequences (ProjectId, LastTicketId)
SELECT ProjectId, <value-from-above> FROM dbo.Projects WHERE Name = 'YourProjectName'
Skip this step if the project is new or has never used mc_get_ticket_id on the local coordinator.

Step 6: Test

6Verify everything works from Claude Code

Step 7: Retire from Local Coordinator (Optional)

7Remove from local coordinator

Once verified, the project can be removed from the local coordinator (port 8620). This is optional — leaving it is harmless.


Common Issues

ErrorCauseFix
Project 'X' is not registered Project not registered on the remote coordinator Call mc_register_project from Claude Code
Project 'X' is registered but not fully configured Admin hasn't filled in project settings yet Go to dashboard → Settings and fill in all fields
Cannot open database "X_ref" Reference database doesn't exist yet Click "Sync from Git" then "Recreate Reference DB"
Trusted_Connection / SSPI error Using Windows auth on Linux Use SQL auth: User Id=migcoord;Password=...;
git clone failed: terminal prompts disabled Repo not accessible via SSH Ensure the SSH key is added to the GitHub account
couldn't find remote ref main Default branch is master, not main Fixed automatically — code detects default branch. If it still fails, check the repo's default branch in GitHub settings
Maintenance buttons not visible Baseline MDF path not configured Fill in the Baseline MDF Path in Settings and save

MigrationCoordinator — Project Migration Guide — Last updated March 2026