Skip to content
Ditchly
Menu

Last checked November 11, 2026

Not open source.

Move from Val Town to Cloudflare Workers

Copy the val, its env vars, SQLite, and blobs before the shutdown dates. A Worker does not import a val, and the free plan allows 10 ms of CPU.

How long: A day for one HTTP val, its secrets, and one database. Longer when several vals import each other or the blob store is large.

Take it out

  1. Step 1

    Use the November 10 dates, and export code before December 10

    Steve Krouse's November 10, 2026 post says new signups stopped that day, code goes read-only on December 10, 2026, and other services end January 10, 2027. The read-only line does not include SQLite and blob storage. The migration guide, updated November 7, 2026, says vals keep running until January 10, 2027. The GitHub guide on that site says to export the app and the val files it imports, including esm.town imports, and to replace those imports with local files. The vt CLI page still shows deno install -grAf jsr:@valtown/vt, then vt clone. That page says to prefer the plugin or MCP. Do the code export while you can still edit. A script you add on December 10 is too late. Leave env values, database dumps, and blob downloads out of the git repo.

  2. Step 2

    Copy every environment value while the account opens

    The runtime page says vals can read environment variables. Write down each name and value in a file that stays off GitHub. Cloudflare secrets are write-only after you save them, so this copy is the one you will type into wrangler secret put or the dashboard. The Workers secrets page says not to commit .dev.vars or .env.

  3. Step 3

    Dump SQLite and download blobs before January 10

    The SQLite admin page says the panel can dump the database as SQL and export a table as CSV. The blob page says scoped blobs can be listed and downloaded from the val sidebar, and that global blobs can be downloaded from blob settings. Do that before January 10, 2027. If you need the scripted export in Val Town's Cloudflare SQLite guide, add that HTTP file before December 10, 2026, because code is read-only after that. The guide says a raw SQLite file cannot be imported into D1, and it says to keep the SQL dump local. Pause writes while you export if the data must match. Turso is the database that guide names under Val Town SQLite. Exporting from Val Town does not move the app onto Turso by itself.

  4. Step 4

    Write down schedules, HTTP paths, and custom domains

    Copy each cron interval, the timezone you meant, and what the job changes. Copy each public path. The redirect guide, updated November 10, 2026, says a val.run redirect can be added in the val's HTTP settings or under Custom Domains in account or org settings, and that you can add and edit redirects only until December 10, 2026. Redirects you have set become permanent that day. A custom domain is DNS at the registrar, which that guide says you change yourself.

Put it in

  1. Step 1

    Put the code in a Worker, not a Deno project

    Create a Cloudflare account and a Worker. The TypeScript page says TypeScript is a first-class language. Point the HTTP val at a fetch handler that returns a Response. Replace esm.town and Deno-only imports with packages the Worker build can bundle. Val Town's migration guide says the Deno runtime's own maintainers stop supporting it after October 2027, and it points HTTP vals at a Worker fetch handler. This guide did not deploy one.

  2. Step 2

    Set secrets, then D1, then R2

    Add each saved value as a Worker secret. Bind a D1 database for the SQL dump and follow D1's import steps. Val Town's SQLite guide says to remove the dump-level BEGIN TRANSACTION and COMMIT, and that generated columns come back from the schema. Virtual tables such as FTS need their own plan. Create an R2 bucket for the blobs and upload the files you downloaded. D1 on the free plan, checked November 11, 2026, includes 5 GB and 10 databases. R2's free tier includes 10 GB-month of Standard storage.

  3. Step 3

    Recreate the schedule, then turn the old one off

    Add a scheduled handler and a cron expression in the Wrangler config. Cloudflare's cron page says triggers use UTC and that a change can take up to 15 minutes to show up. Val Town's cron guide says an elapsed interval is not the same thing as a wall-clock expression, and it says to disable the Val Town schedule before you enable the Cloudflare one. Make a repeat run safe if the job sends email or writes rows. The Workers free plan allows 10 milliseconds of CPU per invocation, which includes a cron run. A job that needs more CPU needs the paid plan, whose page lists a $5 monthly minimum.

  4. Step 4

    Redirect val.run only after the new URL answers

    Confirm the Worker URL, then add the val.run redirect. The redirect guide says the val stops receiving requests as soon as the redirect is set, and that the path and query are kept unless you turn that off. Do this before December 10, 2026. If the val is a webhook, update the provider's URL directly. The same guide says many webhooks will not follow a redirect. For a custom domain, change DNS at the registrar.

What you lose

  • Deno code does not run unchanged

    Vals run on Deno, including npm: and https: imports. A Worker is a different runtime. The Val Town guide tells you to leave Deno rather than wait on it. Deno Deploy is a separate shutdown and is not a place this guide sends the val.

  • D1 takes a SQL dump, not the sqlite file

    D1 has SQLite's SQL semantics. Val Town's import notes say a raw SQLite file cannot be imported directly. Row counts after the import are the check that the dump arrived.

  • The free plan's CPU cap is 10 milliseconds

    The Workers pricing page, updated October 2, 2026, gives the free plan 100,000 requests a day and 10 milliseconds of CPU time per invocation. A val that parsed a file or walked a table can exceed that and fail until you move to the paid plan.

  • There is no browser editor to keep editing in

    The Worker lives in files you deploy with Wrangler or git. The pages checked for this guide do not show a Val Town editor. The February 1, 2027 open-source date in the shutdown post is after January 10, 2027, when the service ends. It does not keep the val online.

  • Redirects freeze on December 10, and webhooks need a new URL

    You cannot add or edit a val.run redirect after December 10, 2026. Webhook senders often ignore redirects. Custom domains follow the DNS you set at the registrar, not the val.run redirect.

Copy the val off Val Town before December 10, 2026, then run it as a Cloudflare Workers fetch handler. The checklist is where the score comes from. The listing has the price. Netlify Functions are next on that list if you want Postgres instead of D1. Vercel Functions have Blob and cron, and the pricing page does not list SQLite. Render is a Node service. Windmill is the open-source script runner, and it does not host the site. Glitch is an earlier host shutdown, with its own alternatives.

https://ditchly.co/migrate/val-town-to-cloudflare-workers