Migrate from Ploi to fortrabbit

Published

Updated

🛠️

From Ploi to fortrabbit.

How to move a Laravel, Statamic or other PHP site from a server managed with Ploi to a fortrabbit app. The code moves through Git, the settings by hand, the database as a dump, the uploads with rsync.

Migrate from Ploi 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 Ploi to fortrabbit, following https://www.fortrabbit.com/raw/migrate/from-ploi.md
txt

Sign-in happens in the browser, see agent setup. The agent needs SSH access to the Ploi server to read the settings, dump the database and copy the uploads. 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.

Ploi settings and where they go

On PloiOn fortrabbit
Site code on the serverGit repository, deployed by the GitHub integration
.env of the siteEnvironment variables in the dashboard
Deploy script of the siteBuild commands and post-deploy commands
Server → Cron jobsCron jobs
Site → Queue, server → DaemonsWorkers
MySQL on the serverMySQL component
Uploads in the site directoryStorage component, files copied with rsync

1. Create the app

Create an app in the dashboard with the software template matching the 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. Copy the settings off Ploi

Log in with ssh ploi@<server-ip>. Ploi allows key-based SSH only, and root login is off.

  • Pull the .env with the Ploi CLI, ploi env:pull, or cat .env in the site directory. Copy every value except DB_*, APP_URL, REDIS_*, QUEUE_CONNECTION, CACHE_STORE (or CACHE_DRIVER) and SESSION_DRIVER into the environment variables of the fortrabbit environment.
  • Open the deploy script of the site. Lines like composer install and npm run build go into the build commands, php artisan migrate --force and cache commands into the post-deploy commands.
  • Open the cron jobs of the server. Ploi writes them to /etc/crontab, which also holds jobs of other sites on the same server. Each entry of this site becomes one cron job.
  • Open the queue workers of the site and the daemons of the server. Each process of this site 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 GitHub repository Ploi deploys from to the environment and push. The first deployment runs the build commands.

4. Move the database

Dump the database over SSH with the credentials from the .env:

mysqldump -u <user> -p <database> > dump.sql
shell

A recent Ploi database backup on S3 or another target works too. Import the dump into the MySQL component as described under MySQL export and import.

5. Copy the uploads

Find the upload folder of the framework, such as storage/app/public for Laravel or public/assets for Statamic. Pull it to the local machine with rsync, then push it to the environment, see rsync. Files on S3 stay where they are: keep the bucket credentials in the environment variables.

6. Switch the DNS

Test the app on its default domain, add the custom domain to the environment and point the records at the domain provider to fortrabbit, see external domain setup.

What stays on the Ploi server

  • Custom Nginx rules. fortrabbit runs Apache, so rewrites move into .htaccess.
  • Root-level software, system packages and daemons outside the app. fortrabbit has no root shell, see limits.
  • Mail sent with PHP mail(). Use SMTP or a transactional mail provider.

Once the site runs on fortrabbit, delete the site in Ploi. Delete the server at the cloud provider when no other site runs on it.