replit-upgrade-migration
Upgrade Replit Nix channels, migrate between database types, and update deployment targets. Use when upgrading Nix channel versions, migrating from Replit DB to PostgreSQL, switching deployment types, or updating system dependencies. Trigger with phrases like "upgrade replit", "replit nix upgrade", "migrate replit database", "replit version update", "replit channel update".
Best use case
replit-upgrade-migration is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Upgrade Replit Nix channels, migrate between database types, and update deployment targets. Use when upgrading Nix channel versions, migrating from Replit DB to PostgreSQL, switching deployment types, or updating system dependencies. Trigger with phrases like "upgrade replit", "replit nix upgrade", "migrate replit database", "replit version update", "replit channel update".
Teams using replit-upgrade-migration 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-upgrade-migration/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How replit-upgrade-migration Compares
| Feature / Agent | replit-upgrade-migration | 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?
Upgrade Replit Nix channels, migrate between database types, and update deployment targets. Use when upgrading Nix channel versions, migrating from Replit DB to PostgreSQL, switching deployment types, or updating system dependencies. Trigger with phrases like "upgrade replit", "replit nix upgrade", "migrate replit database", "replit version update", "replit channel update".
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 Upgrade & Migration
## Current State
!`cat .replit 2>/dev/null | head -15 || echo 'No .replit found'`
!`cat replit.nix 2>/dev/null || echo 'No replit.nix found'`
## Overview
Guide for upgrading Replit environments: Nix channel updates, package version bumps, database migrations (KV to PostgreSQL, dev to prod), deployment type changes, and Node.js/Python runtime upgrades.
## Prerequisites
- Existing Replit App with `.replit` and `replit.nix`
- Git version control (recommended)
- Backup of critical data before migration
## Instructions
### Step 1: Upgrade Nix Channel
Nix channels determine available package versions. Upgrade to get newer runtimes.
```toml
# .replit — before
[nix]
channel = "stable-23_05"
# .replit — after (2024-2025 stable)
[nix]
channel = "stable-24_05"
```
After changing the channel, reload the shell (exit Shell tab and re-enter). Then verify:
```bash
node --version # Should show newer version
python3 --version # Should show newer version
```
### Step 2: Upgrade Node.js or Python Runtime
```nix
# replit.nix — update runtime packages
# Before (Node 18)
{ pkgs }: {
deps = [
pkgs.nodejs-18_x
pkgs.nodePackages.typescript
];
}
# After (Node 20)
{ pkgs }: {
deps = [
pkgs.nodejs-20_x
pkgs.nodePackages.typescript-language-server
pkgs.nodePackages.pnpm
];
}
```
```toml
# .replit — update modules to match
modules = ["nodejs-20:v8-20230920-bd784b9"]
```
**Verify after upgrade:**
```bash
node --version # v20.x.x
npm --version # 10.x.x
npm test # Run tests to catch breaking changes
```
### Step 3: Migrate from Replit KV to PostgreSQL
When your app outgrows the 50 MiB KV database limit:
```typescript
// scripts/migrate-kv-to-postgres.ts
import Database from '@replit/database';
import { Pool } from 'pg';
const kv = new Database();
const pool = new Pool({
connectionString: process.env.DATABASE_URL,
ssl: { rejectUnauthorized: false },
});
async function migrate() {
// Create table
await pool.query(`
CREATE TABLE IF NOT EXISTS kv_data (
key TEXT PRIMARY KEY,
value JSONB NOT NULL,
migrated_at TIMESTAMPTZ DEFAULT NOW()
)
`);
// Read all KV entries
const keys = await kv.list();
console.log(`Migrating ${keys.length} keys...`);
let migrated = 0;
let errors = 0;
for (const key of keys) {
try {
const value = await kv.get(key);
await pool.query(
'INSERT INTO kv_data (key, value) VALUES ($1, $2) ON CONFLICT (key) DO UPDATE SET value = $2',
[key, JSON.stringify(value)]
);
migrated++;
} catch (err: any) {
console.error(`Failed to migrate key "${key}": ${err.message}`);
errors++;
}
}
console.log(`Migration complete: ${migrated} migrated, ${errors} errors`);
}
migrate().then(() => pool.end());
```
### Step 4: Switch Deployment Type
```toml
# .replit — change deployment target
# From Autoscale (scales to zero):
[deployment]
deploymentTarget = "autoscale"
run = ["sh", "-c", "npm start"]
# To Reserved VM (always-on):
[deployment]
deploymentTarget = "cloudrun"
run = ["sh", "-c", "npm start"]
# To Static (frontend only):
[deployment]
deploymentTarget = "static"
publicDir = "dist"
```
After changing: click "Deploy" to create a new deployment with the new type.
### Step 5: Migrate Large Files to Object Storage
```typescript
// Move large values from KV to Object Storage
import Database from '@replit/database';
import { Client } from '@replit/object-storage';
const kv = new Database();
const storage = new Client();
async function migrateToObjectStorage(prefix: string) {
const keys = await kv.list(prefix);
for (const key of keys) {
const value = await kv.get(key);
const content = typeof value === 'string' ? value : JSON.stringify(value);
await storage.uploadFromText(`migrated/${key}`, content);
await kv.delete(key);
console.log(`Migrated: ${key}`);
}
}
```
### Step 6: Pre-Migration Checklist
```markdown
## Before Any Upgrade
- [ ] Git commit current working state
- [ ] Back up Replit KV data: export all keys to JSON file
- [ ] Back up PostgreSQL: pg_dump or Replit snapshot
- [ ] Note current deployment URL and settings
- [ ] Run full test suite: npm test
- [ ] Document current .replit and replit.nix content
## After Upgrade
- [ ] Reload shell (exit and re-enter Shell tab)
- [ ] Verify runtime versions
- [ ] npm install / pip install (rebuild packages for new runtime)
- [ ] Run full test suite
- [ ] Test in Workspace Webview
- [ ] Deploy and verify production health check
- [ ] Monitor for 24 hours for regressions
```
## Error Handling
| Error | Cause | Solution |
|-------|-------|----------|
| `Package not found` after channel upgrade | Package renamed or removed | Search Nix packages: `nix-env -qaP \| grep name` |
| `node-gyp` build failure | Native addon incompatible | Update the addon or add Nix system deps |
| PostgreSQL connection refused | Pool not using SSL | Add `ssl: { rejectUnauthorized: false }` |
| Old deployment still running | Didn't redeploy | Click "Deploy" to apply new config |
## Resources
- [Replit App Configuration](https://docs.replit.com/replit-app/configuration)
- [Nix on Replit](https://docs.replit.com/programming-ide/nix-on-replit)
- [PostgreSQL on Replit](https://docs.replit.com/cloud-services/storage-and-databases/postgresql-on-replit)
- [Deployment Types](https://docs.replit.com/hosting/deployments)
## Next Steps
For CI integration during upgrades, see `replit-ci-integration`.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".