Migration Guide

Moving an existing project to Virke? This guide helps you analyze your current setup and plan the migration.

Step 1: Analyze Your Project

Before migrating, you need a clear picture of your current stack. Use this prompt with an AI assistant (or work through it manually) in your project directory:

Analyze this project and give me a detailed summary of:

  1. Build system: What builds the site or app? (Vite, Astro, Next.js, plain HTML, etc.)
  2. Output: Where does the built output end up? (dist/, build/, out/, etc.)
  3. Runtime processes: Are there any background processes? (scrapers, workers, cron jobs, etc.)
    • What triggers them? (cron, manual, CI, etc.)
    • Where do they write data? (local files, database, API, JSON, etc.)
    • Does the site read this data at build time or runtime?
  4. Hosting: How is it currently deployed? (Vercel, Netlify, VPS, etc.)
  5. Dependencies: Any databases, APIs, or external services?
  6. Config files: List all config files (package.json, tsconfig.json, etc.)

Format the output as a migration checklist so I can convert this to Virke.

Step 2: Map to Virke Products

Once you have your project analysis, map each part to the right Virke product:

Your current setup Virke product Docs
Static site (HTML, CSS, JS) Virke Sites Sites docs
Server-side app or API Virke Run Run docs
Database (Postgres, MySQL, SQLite) Virke DB DB docs
Key-value store (Redis, etc.) Virke KV KV docs
File/object storage (S3, etc.) Virke OS3 OS3 docs
Cron jobs or scheduled tasks Virke Cron Cron docs
CI/CD pipeline GitHub integration or CI/CD

Step 3: Initialize Your Virke Project

# Install the CLI
bun install -g @virke/cli

# Authenticate
virke login

# Initialize in your project directory
virke init

This creates a virke.toml in your project root. See the config reference for all options.

Step 4: Configure and Deploy

Static sites

Set your build command and output directory in virke.toml:

[project]
name = "my-site"
type = "sites"

[build]
command = "bun run build"
output = "dist"

Then deploy:

virke deploy

Apps with background processes

If your project has scrapers, workers, or cron jobs, you'll likely need to split it:

  1. Static site — deploy as Virke Sites
  2. Background processes — migrate to Virke Cron for scheduled tasks, or Virke Run for always-on workers
  3. Data storage — use Virke DB or Virke KV instead of local files

Framework-specific guides

See Framework Support for setup guides for Next.js, SvelteKit, Remix, Astro, Hono, and Vite.

Common Migration Patterns

Local JSON files to Virke DB

If your build or scraper writes JSON files that the site reads at build time:

  1. Move the data into Virke DB
  2. Update the scraper to write to Virke DB via the SDK
  3. Read from Virke DB at build time or at the edge with Virke Run

Cron jobs to Virke Cron

If you run scheduled scripts (e.g., scrapers on a VPS cron):

  1. Wrap the script as a Virke Cron handler
  2. Define the schedule in virke.toml
  3. Deploy — Virke handles scheduling at the edge

Vercel/Netlify to Virke Sites

  1. Keep your existing build command
  2. Set the output directory in virke.toml
  3. Run virke deploy — your site is now on Fastly's edge network

Need Help?