Migrate from DigitalOcean App Platform to fortrabbit

Published

Updated

🌊

From App Platform to fortrabbit.

How to move a Laravel or other PHP app from DigitalOcean App Platform to a fortrabbit app. The code moves through Git, the settings from the app spec, the database as a dump, the files stay in Spaces or move to the storage component.

Migrate from DigitalOcean App Platform with a coding agent

Claude Code, Codex, Cursor and other coding agents can run this migration. Paste this prompt into the agent, in the project folder:

Read https://www.fortrabbit.com/agents.md and set up fortrabbit. Then move this site from DigitalOcean App Platform to fortrabbit, following https://www.fortrabbit.com/raw/migrate/from-digitalocean-app-platform.md
txt

Sign-in happens in the browser, see agent setup. The agent uses the doctl CLI to read the app spec and the database connection. The steps below are what the agent follows, and what to do by hand without one. The agent changes nothing on the old host: a person deletes the old setup once the site runs on fortrabbit.

App Platform components and where they go

On App PlatformOn fortrabbit
Repository of the web serviceSame repository, deployed by the GitHub integration
App-level and component-level environment variablesEnvironment variables
build_commandBuild commands
PRE_DEPLOY and POST_DEPLOY jobsPost-deploy commands
SCHEDULED jobsCron jobs
Worker componentsWorkers
Managed MySQL databaseMySQL component
Spaces bucketKeep the bucket, or the storage component

1. Create the app

Create an app in the dashboard with the software template matching the CMS or framework. Its default domain works with HTTPS right away, so the whole move can be tested before DNS changes. Lower the TTL of the domain's DNS records now, see migrate to fortrabbit.

2. Export the app spec

The app spec holds every component, command and variable. Download it under Settings → App Spec, or with doctl:

doctl apps spec get <app-id> --format yaml
shell
  • Copy every environment variable except the bindable database ones, such as ${db.DATABASE_URL}, into the environment variables of the fortrabbit environment. Copy encrypted values from their source, such as a password manager.
  • build_command goes into the build commands. PRE_DEPLOY and POST_DEPLOY jobs, such as php artisan migrate --force, go into the post-deploy commands.
  • Each SCHEDULED job becomes a cron job. App Platform runs them every 15 minutes at the shortest. php artisan schedule:run needs a cron job every minute.
  • Each worker component becomes a worker.

fortrabbit has no Redis. A Laravel app sets the queue, cache and session drivers to database or file, see Laravel queues and scheduler.

3. Deploy the code

Connect the same GitHub repository to the environment and push. A Dockerfile is not used on fortrabbit: the build commands replace it.

4. Move the database

Add the IP address of the machine running the dump to the trusted sources of the Managed Database, then dump it:

mysqldump -u doadmin -p -h <host> -P 25060 --single-transaction --set-gtid-purged=OFF <database> > dump.sql
shell

Import the dump into the MySQL component as described under MySQL export and import. A PostgreSQL database needs converting to MySQL first, since fortrabbit runs MySQL only.

5. Move the files

App Platform has no persistent disk, so uploads live in a Spaces bucket. Keep the bucket and its credentials in the environment variables, or download it with an S3 client and push the files to the storage component with rsync.

6. Switch the DNS

Test the app on its default domain, add the custom domain to the environment and point the records to fortrabbit, see external domain setup. Domains on DigitalOcean DNS change in the DigitalOcean control panel.

Once the app runs on fortrabbit, delete the app on App Platform, then the database cluster.