replit-migration-deep-dive
Migrate to Replit from Heroku, Railway, Vercel, or local development environments. Use when moving an existing app to Replit, migrating databases, or converting Docker/buildpack apps to Replit's Nix-based system. Trigger with phrases like "migrate to replit", "heroku to replit", "move to replit", "replit migration", "railway to replit", "convert to replit".
Best use case
replit-migration-deep-dive is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Migrate to Replit from Heroku, Railway, Vercel, or local development environments. Use when moving an existing app to Replit, migrating databases, or converting Docker/buildpack apps to Replit's Nix-based system. Trigger with phrases like "migrate to replit", "heroku to replit", "move to replit", "replit migration", "railway to replit", "convert to replit".
Teams using replit-migration-deep-dive should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/replit-migration-deep-dive/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How replit-migration-deep-dive Compares
| Feature / Agent | replit-migration-deep-dive | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Migrate to Replit from Heroku, Railway, Vercel, or local development environments. Use when moving an existing app to Replit, migrating databases, or converting Docker/buildpack apps to Replit's Nix-based system. Trigger with phrases like "migrate to replit", "heroku to replit", "move to replit", "replit migration", "railway to replit", "convert to replit".
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
AI Agents for Coding
Browse AI agent skills for coding, debugging, testing, refactoring, code review, and developer workflows across Claude, Cursor, and Codex.
Best AI Skills for Claude
Explore the best AI skills for Claude and Claude Code across coding, research, workflow automation, documentation, and agent operations.
ChatGPT vs Claude for Agent Skills
Compare ChatGPT and Claude for AI agent skills across coding, writing, research, and reusable workflow execution.
SKILL.md Source
# Replit Migration Deep Dive
## Current State
!`cat .replit 2>/dev/null | head -10 || echo 'No .replit found'`
!`cat Procfile 2>/dev/null || echo 'No Procfile (not Heroku)'`
!`cat Dockerfile 2>/dev/null | head -10 || echo 'No Dockerfile'`
!`cat railway.json 2>/dev/null || echo 'No railway.json'`
## Overview
Comprehensive guide for migrating existing applications to Replit from Heroku, Railway, Vercel, Render, or local development. Covers converting configuration files, migrating databases, adapting to Replit's Nix-based environment, and setting up Replit-native features.
## Prerequisites
- Source application with working deployment
- Access to current database for export
- Git repository with application code
- Replit Core or Teams plan
## Migration Paths
| From | Complexity | Duration | Key Changes |
|------|-----------|----------|-------------|
| Local dev | Low | 1-2 hours | Add .replit + replit.nix |
| Heroku | Medium | 2-4 hours | Procfile to .replit, addons to Replit services |
| Railway | Low-Medium | 1-3 hours | railway.json to .replit |
| Vercel | Low | 1-2 hours | Usually frontend-only, use Static deploy |
| Docker | Medium | 3-6 hours | Dockerfile to replit.nix |
## Instructions
### Step 1: Import from GitHub
```markdown
1. Go to replit.com > Create Repl > Import from GitHub
2. Paste your repository URL
3. Replit auto-detects language and creates default config
4. Review and adjust .replit and replit.nix
```
### Step 2: Convert from Heroku
**Procfile to .replit:**
```bash
# Heroku Procfile
web: npm start
worker: node worker.js
release: node migrate.js
```
```toml
# Equivalent .replit
run = "npm start"
entrypoint = "index.js"
[deployment]
run = ["sh", "-c", "node migrate.js && npm start"]
build = ["sh", "-c", "npm ci --production"]
deploymentTarget = "autoscale"
[env]
NODE_ENV = "production"
```
**Heroku addons to Replit services:**
| Heroku Addon | Replit Equivalent |
|-------------|-------------------|
| Heroku Postgres | Replit PostgreSQL (Database pane) |
| Heroku Redis | Upstash Redis (external) or Replit KV |
| Heroku Scheduler | Replit Automations or external cron |
| Papertrail | Replit deployment logs + external |
| SendGrid | Same (use API key in Secrets) |
| Cloudinary | Replit Object Storage or same |
**Environment variables:**
```bash
# Export from Heroku
heroku config -s > heroku-env.txt
# Import to Replit: copy each line into Secrets tab
# Or use Replit Secrets tool (lock icon in sidebar)
```
### Step 3: Convert from Railway
**railway.json to .replit:**
```json
// railway.json
{
"build": { "builder": "NIXPACKS" },
"deploy": {
"startCommand": "npm start",
"healthcheckPath": "/health"
}
}
```
```toml
# Equivalent .replit
run = "npm start"
[deployment]
run = ["sh", "-c", "npm start"]
build = ["sh", "-c", "npm ci"]
deploymentTarget = "autoscale"
```
### Step 4: Convert from Docker
**Dockerfile to replit.nix:**
```dockerfile
# Dockerfile
FROM node:20-slim
RUN apt-get update && apt-get install -y python3 postgresql-client
WORKDIR /app
COPY package*.json ./
RUN npm ci --production
COPY . .
CMD ["node", "dist/index.js"]
```
```nix
# Equivalent replit.nix
{ pkgs }: {
deps = [
pkgs.nodejs-20_x
pkgs.python311
pkgs.postgresql
];
}
```
```toml
# .replit
run = "node dist/index.js"
[deployment]
run = ["sh", "-c", "node dist/index.js"]
build = ["sh", "-c", "npm ci --production && npm run build"]
deploymentTarget = "autoscale"
```
### Step 5: Database Migration
**Export from source:**
```bash
# From Heroku Postgres
heroku pg:backups:capture
heroku pg:backups:download
pg_restore -d LOCAL_DB latest.dump
# From Railway
railway run pg_dump > backup.sql
# From any PostgreSQL
pg_dump --format=custom DATABASE_URL > backup.dump
```
**Import to Replit PostgreSQL:**
```bash
# In Replit Shell, after provisioning PostgreSQL in Database pane:
# Option 1: SQL file
psql "$DATABASE_URL" < backup.sql
# Option 2: Custom format dump
pg_restore -d "$DATABASE_URL" backup.dump
# Option 3: Schema only (recreate, then migrate data app-level)
psql "$DATABASE_URL" < schema.sql
node scripts/migrate-data.js
```
**Migrate from non-PostgreSQL (MongoDB, etc.):**
```typescript
// scripts/migrate-from-mongo.ts
import { MongoClient } from 'mongodb';
import { Pool } from 'pg';
const mongo = new MongoClient(process.env.MONGO_URL!);
const pg = new Pool({ connectionString: process.env.DATABASE_URL });
async function migrate() {
await mongo.connect();
const users = await mongo.db('app').collection('users').find().toArray();
await pg.query(`
CREATE TABLE IF NOT EXISTS users (
id TEXT PRIMARY KEY,
email TEXT UNIQUE,
name TEXT,
data JSONB,
created_at TIMESTAMPTZ
)
`);
for (const user of users) {
await pg.query(
'INSERT INTO users (id, email, name, data, created_at) VALUES ($1, $2, $3, $4, $5)',
[user._id.toString(), user.email, user.name, JSON.stringify(user), user.createdAt]
);
}
console.log(`Migrated ${users.length} users`);
await mongo.close();
await pg.end();
}
migrate();
```
### Step 6: Post-Migration Checklist
```markdown
## After Migration
### Configuration
- [ ] .replit configured with correct run and build commands
- [ ] replit.nix includes all system dependencies
- [ ] All env vars moved to Replit Secrets
- [ ] PORT reads from environment variable
- [ ] App listens on 0.0.0.0 (not localhost)
### Database
- [ ] PostgreSQL provisioned in Database pane
- [ ] Data imported and verified
- [ ] Connection string uses DATABASE_URL env var
- [ ] SSL configured: { rejectUnauthorized: false }
### Testing
- [ ] App runs successfully in Workspace ("Run")
- [ ] Health endpoint works: /health returns 200
- [ ] All API endpoints functional
- [ ] Auth flow works (if using Replit Auth)
- [ ] File uploads work (if using Object Storage)
### Deployment
- [ ] Deployed successfully (Autoscale or Reserved VM)
- [ ] Custom domain configured (if applicable)
- [ ] SSL certificate provisioned
- [ ] Post-deploy health check passes
### Cleanup
- [ ] Old platform deprovisioned after verification period
- [ ] DNS records updated (if custom domain)
- [ ] CI/CD updated to point to Replit
- [ ] Team notified of new deployment URL
```
## Error Handling
| Issue | Cause | Solution |
|-------|-------|----------|
| Missing system package | Not in replit.nix | Add to deps (e.g., pkgs.openssl) |
| Build failure | Different build env | Adapt build command for Replit |
| DB connection refused | Wrong SSL config | Add ssl: { rejectUnauthorized: false } |
| Port binding error | Hardcoded port | Read from process.env.PORT |
| Static files not served | Wrong public directory | Set publicDir in deployment config |
## Resources
- [Import from GitHub](https://docs.replit.com/hosting/deployments/deploying-a-github-repository)
- [Import from Bolt](https://docs.replit.com/getting-started/quickstarts/import-from-bolt)
- [Import from Lovable](https://docs.replit.com/getting-started/quickstarts/import-from-lovable)
- [Nix on Replit](https://docs.replit.com/programming-ide/nix-on-replit)
- [Replit Deployments](https://docs.replit.com/hosting/deployments)
## Next Steps
For advanced troubleshooting after migration, see `replit-advanced-troubleshooting`.Related Skills
workhuman-upgrade-migration
Workhuman upgrade migration for employee recognition and rewards API. Use when integrating Workhuman Social Recognition, or building recognition workflows with HRIS systems. Trigger: "workhuman upgrade migration".
wispr-upgrade-migration
Wispr Flow upgrade migration for voice-to-text API integration. Use when integrating Wispr Flow dictation, WebSocket streaming, or building voice-powered applications. Trigger: "wispr upgrade migration".
windsurf-upgrade-migration
Upgrade Windsurf IDE, migrate settings from VS Code or Cursor, and handle breaking changes. Use when upgrading Windsurf versions, migrating from another editor, or handling configuration changes after updates. Trigger with phrases like "upgrade windsurf", "windsurf update", "migrate to windsurf", "windsurf from cursor", "windsurf from vscode".
windsurf-migration-deep-dive
Migrate to Windsurf from VS Code, Cursor, or other AI IDEs with full configuration transfer. Use when migrating a team to Windsurf, transferring Cursor rules, or evaluating Windsurf against other AI editors. Trigger with phrases like "migrate to windsurf", "switch to windsurf", "windsurf from cursor", "windsurf from copilot", "windsurf evaluation".
webflow-upgrade-migration
Analyze, plan, and execute Webflow SDK upgrades (webflow-api v1 to v3) with breaking change detection, API v1-to-v2 migration, and deprecation handling. Trigger with phrases like "upgrade webflow", "webflow migration", "webflow breaking changes", "update webflow SDK", "webflow v1 to v2".
webflow-migration-deep-dive
Execute major Webflow migrations — from other CMS platforms to Webflow CMS, between Webflow sites, or large-scale content re-architecture using the Data API v2 bulk endpoints, strangler fig pattern, and data validation. Trigger with phrases like "migrate to webflow", "webflow migration", "import into webflow", "webflow replatform", "move content to webflow", "webflow bulk import", "wordpress to webflow".
vercel-upgrade-migration
Upgrade Vercel CLI, Node.js runtime, and Next.js framework versions with breaking change detection. Use when upgrading Vercel CLI versions, migrating Node.js runtimes, or updating Next.js between major versions on Vercel. Trigger with phrases like "upgrade vercel", "vercel migration", "vercel breaking changes", "update vercel CLI", "next.js upgrade on vercel".
vercel-migration-deep-dive
Migrate to Vercel from other platforms or re-architecture existing Vercel deployments. Use when migrating from Netlify, AWS, or Cloudflare to Vercel, or when re-platforming an existing Vercel application. Trigger with phrases like "migrate to vercel", "vercel migration", "switch to vercel", "netlify to vercel", "aws to vercel", "vercel replatform".
veeva-upgrade-migration
Veeva Vault upgrade migration for REST API and clinical operations. Use when working with Veeva Vault document management and CRM. Trigger: "veeva upgrade migration".
veeva-migration-deep-dive
Veeva Vault migration deep dive for enterprise operations. Use when implementing advanced Veeva Vault patterns. Trigger: "veeva migration deep dive".
vastai-upgrade-migration
Upgrade Vast.ai CLI, migrate API versions, and handle breaking changes. Use when upgrading vastai CLI, detecting deprecations, or migrating between API versions. Trigger with phrases like "upgrade vastai", "vastai migration", "vastai breaking changes", "update vastai CLI".
vastai-migration-deep-dive
Migrate GPU workloads to or from Vast.ai, or between GPU providers. Use when switching from AWS/GCP/Azure GPU instances to Vast.ai, migrating between GPU types, or re-platforming ML infrastructure. Trigger with phrases like "migrate to vastai", "vastai migration", "switch to vastai", "vastai from aws", "vastai from lambda".