Skip to content

Migrate between devices

For an application’s data to follow it between devices you own, the data has to live in platform-managed storage declared mobility: movable. A host bind mount (./data:/data, or a Compose named volume) is tied to the machine it was created on: the platform can’t quiesce, snapshot and restore it elsewhere.

The simplest way is to declare the storage when you first deploy, whether you deploy with edgible stack deploy or an AI assistant deploys for you through the Edgible MCP server. If the application is already running on a host bind mount, see An application already on a host bind mount.

  1. The volume is declared in spec.storage[] with mobility: movable. Volumes default to immovable, so set movable explicitly.
  2. The workload mounts the volume Edgible provides, not a path of its own. A compose file mounts it as ${EDGIBLE_STORAGE_<NAME>}.
  3. Both serving devices are online and run agent 1.4.9 or later.

Declare the volume in spec.storage[] and reference it from the workload. Save as app.yml:

app.yml
apiVersion: v3
kind: Application
metadata:
name: migration-app
organization: <your-org-id>
spec:
storage:
- name: data
type: persistent
size: 1Gi
mobility: movable
workloads:
- name: web
type: compose
composeFile: ./docker-compose.yml
ports:
- { name: http, containerPort: 8080, protocol: tcp }
storage:
- name: data
mountPath: /data
access:
- name: public
type: https
target: { workload: web, port: http }
hostname: { generated: true }
tls: { managedBy: edgible }
policies: { auth: { modes: [none] } }

Mount the volume in the compose file through its variable:

docker-compose.yml
services:
web:
image: ghcr.io/your-org/your-app:latest
ports:
- "127.0.0.1:8080:8080"
volumes:
- ${EDGIBLE_STORAGE_DATA}:/data

The agent creates the volume on the device and sets EDGIBLE_STORAGE_DATA to its path when it runs Compose. The variable is the storage name uppercased, with hyphens turned into underscores: app-data becomes ${EDGIBLE_STORAGE_APP_DATA}. Use the same container path as the workload’s mountPath. A compose file that binds a path of its own instead (./data:/data) keeps the data on the device, whatever spec.storage[] says.

edgible stack deploy embeds the compose file in the declaration (composeFile: base64:<yaml>), and an AI assistant writes it there directly. Either way the ${EDGIBLE_STORAGE_DATA} line goes in the compose content.

Deploy:

Terminal window
edgible stack deploy -f app.yml

See the Application YAML reference for the other mobility values.

Move it to another of your serving devices, carrying the movable volume:

Terminal window
edgible application move <app> --to <device> --storage data

The platform stops the application, snapshots the volume, ships it to the new device, restores it there and starts the application on it. The hostname stays the same. The old device keeps its copy of the data, so you can move back.

A move carries one volume. It never leaves data behind silently: if the application has storage the move doesn’t carry (a compose bind mount or volume included, declared or not), the move is refused with MOVE_WOULD_LOSE_DATA, names each volume, and changes nothing. Make the volume movable and name it with --storage, or accept the loss with --stateless: the application starts on the new device without that data, and the old device keeps its copy.

Terminal window
edgible application move <app> --to <device> --stateless

An application already on a host bind mount

Section titled “An application already on a host bind mount”

Data written to a host path stays on that device until it is copied into platform-managed storage. Change the declaration, then copy the data in:

  1. Find the volume. storage list shows each host-bind volume and its path as the compose file wrote it:

    Terminal window
    edgible application storage list --app <app>
  2. Declare the volume in spec.storage[] with mobility: movable, and change the compose volume line from the host path to ${EDGIBLE_STORAGE_<NAME>}, as in Declare movable storage at deploy. Redeploy. edgible application storage declare --app <app> prints spec.storage[] entries to start from; it doesn’t change the declaration itself.

  3. Copy the data in. The new volume starts empty, and the old host directory is still on the device. Push a copy of it into the volume, stopping the workload while it applies:

    Terminal window
    edgible application storage push --app <app> --storage-name data --path ./old-data --quiesce

    Run this wherever the data is. On the device itself, --path can be the old host directory.

  4. Move with --storage, as above.

edgible application storage promote copies a host-bind volume into platform-managed storage on the device and rewrites the compose file’s mount there. It only works when the declaration names a compose file by its path on the device. edgible stack deploy, edgible application create and AI assistants embed the compose file in the declaration instead (composeFile: base64:<yaml>), and the device writes that file again from the declaration on every deploy, so promote refuses those applications with STORAGE_PROMOTE_UNSUPPORTED before it stops anything. Change the declaration as above instead.

storage push ships local data into a volume on the application’s device: to seed a new volume from a backup, load a dataset, or copy in data from a host bind mount:

Terminal window
edgible application storage push --app <app> --storage-name data --path ./seed-data

By default the CLI packs --path with tar before shipping. Useful options:

OptionWhat it does
-p, --path <path>Local file or directory to push.
--no-packTreat --path as a pre-built tarball; don’t pack it.
--quiesceStop the workload across the apply step. Recommended for stateful apps so nothing writes mid-copy.
--apply-mode <mode>replace (default) swaps the volume contents; merge overlays the pushed data on top of what’s there.
--device-id <id>Target a specific device (defaults to the application’s first device).

List the application’s storage records to confirm the volume is platform-managed and movable:

Terminal window
edgible application storage list --app <app>

Add --json for machine-readable output.

Once the workload is running against the volume, confirm the app itself is healthy: read its live output with edgible application logs and check that its hostname’s certificate is still issued with edgible certs.

  • VM workloads need a storage-mounted disk. Inline diskImage paths can’t move; declare the disk via spec.storage[] and reference it from the workload’s storage[].
  • Host bind mounts don’t move. A move refuses to leave one behind unless you pass --stateless; redeploy with a declared volume to carry it.
  • Promote needs a compose file named by its path on the device. An embedded compose file is refused; declare the volume in the declaration instead.
  • The serving device must be online for declare, promote and push.