---
raw: true
title: Move from Val Town
description: Move vals to Spacefast before Val Town closes. HTTP vals become Functions routes and scheduled vals become crons
---

Val Town closes on January 10, 2027, and code on Val Town becomes read-only on December 10, 2026 ([Val Town's announcement](https://blog.val.town/winding-down), checked 2026-11-14). Get your code out first, then have your AI move it to Spacefast.

## Move your vals

1. **Get the code**

    Copy your vals and the vals they import into a folder. Val Town's [migration guides](https://docs.val.town/migration) cover exporting to GitHub.

2. **Ask your AI**

    Connect Spacefast to your agent ([Agents](/docs/agents/) lists the ways), open the folder, and send:

    **Publish Val Town vals on Spacefast.**

    > Publish the project in this folder on Spacefast. It used to run on Val Town. Keep it working the same way and send me the link.

3. **Set the secrets**

    Set each environment variable your vals read on the Space, with `sf env set` or `sf env import`. See [Environment variables](/docs/environment-variables/).

4. **Choose who can open it**

    A team's new Spaces start private unless the team changed its default. Make the Space public or create a share link in [Spacefast Share](/docs/share/) once it works.

## Where each kind of val goes

| On Val Town | On Spacefast |
| --- | --- |
| HTTP val | A [Functions](/docs/functions/) route. A module in `functions/` exports a handler per HTTP method, or a root `handler.ts` default-exports `{ fetch }` and answers the whole Space |
| Scheduled val | A [cron](/docs/crons/) in `sf.jsonc`: a scheduled `GET` against a Functions route on your own Space |
| SQLite tables | The Space's [database](/docs/database/), through the D1-shaped `env.DB` binding |
| Environment variables | [Environment variables](/docs/environment-variables/) on the Space, read from the handler's `env` argument |
| Static pages | Published files. See the [plain HTML recipe](/docs/recipes/html/) |

Handlers take a standard `Request` and return a standard `Response`, which is the shape HTTP vals use too.

## What to check

- **Imports and runtime calls.** Replace `esm.town` imports with local files or npm packages, and replace `Deno.env.get` with the handler's `env` argument. The [Functions](/docs/functions/) page lists the supported module types.
- **SQL.** Queries move from SQLite to the Space's database through `env.DB`. Check SQLite-specific syntax, and load existing rows through the [SQL console](/docs/database/#the-sql-console).
- **Schedules.** A five-field crontab schedule is an advanced cron, which comes with Boost. For now every crontab runs at its closest simple schedule until advanced scheduling is enabled, and a Space can declare at most 8 crons. A cron runs approximately on schedule, with no retries. See [Crons](/docs/crons/).
- **Outbound requests.** A worker's `fetch()` reaches any public host once the Space is claimed. See [Functions outbound HTTP](/docs/functions/#outbound-http).
