Migrate from ServerPilot to fortrabbit

Published

Updated

🛠️

From ServerPilot to fortrabbit.

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

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

Sign-in happens in the browser, see agent setup. The agent needs SSH access as the system user of the app 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.

ServerPilot setup and where it goes

On ServerPilotOn fortrabbit
/srv/users/<user>/apps/<app>Git repository, deployed by the GitHub integration
.env or wp-config.php in the app directoryEnvironment variables
GitHub Actions with rsync, or manual uploadsBuild commands and post-deploy commands
crontab -l of the system userCron jobs
MySQL on the serverMySQL component
Uploads in the app directoryStorage component, files copied with rsync

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. Copy the settings

Log in over SSH as the system user of the app. ServerPilot gives each app its own system user by default.

  • Open the config file in /srv/users/<user>/apps/<app>, such as .env or wp-config.php. Copy every value except the database credentials and the app URL into the environment variables of the fortrabbit environment.
  • Run crontab -l. ServerPilot has no cron screen, so each entry here becomes one cron job.
  • Check for a GitHub Actions workflow that deploys the app. Its composer install and build steps go into the build commands.

3. Deploy the code

Connect the GitHub repository to the environment and push. Code that is not in Git yet goes into a new repository first, without uploads, vendor and credentials.

4. Move the database

Dump the database over SSH with the credentials from the config file:

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

Import the dump into the MySQL component as described under MySQL export and import.

5. Copy the uploads

Pull the upload folder, such as public/wp-content/uploads, to the local machine with rsync, then push it to the environment, see rsync.

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. ServerPilot hosts no DNS.

What stays on the ServerPilot server

  • Custom Nginx config in /etc/nginx-sp/vhosts.d/. fortrabbit runs Apache, so rewrites move into .htaccess.
  • Redis or other software installed on the server. fortrabbit has no root shell, see limits.

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