Migrate from cPanel hosting to fortrabbit
Published
Updated
📦
From cPanel to fortrabbit.
How to move a WordPress, Craft CMS, Laravel or other PHP site from shared hosting with cPanel to a fortrabbit app. The code moves into Git, the database as a dump, the uploads with rsync.
Migrate from cPanel 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 cPanel hosting to fortrabbit, following https://www.fortrabbit.com/raw/migrate/from-cpanel.md
Sign-in happens in the browser, see agent setup. The agent works best with SSH access to the cPanel account. Without SSH, download the files and the database export by hand first, see steps 2 and 6. 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.
cPanel features and where they go
| In cPanel | On fortrabbit |
|---|---|
File Manager, /home/<user>/public_html | Git repository, deployed by the GitHub integration |
.env, wp-config.php or other config files | Environment variables |
| Cron Jobs | Cron jobs |
| phpMyAdmin | MySQL component |
Uploads in public_html | Storage component, files copied with rsync |
| Email accounts | Stays with a mail provider |
| Zone Editor | DNS at the domain provider |
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. Download the files
With SSH enabled, log in with the cPanel username and pull the site with rsync, see download a website. Not every host allows SSH. Without it, download the home directory from Backup in cPanel, or use SFTP.
The main domain's files sit in /home/<user>/public_html. Addon domains and subdomains can use other folders.
3. Put the code into Git
A site on shared hosting is often not in Git. Create a repository from the downloaded files and leave out the uploads, vendor and the config file with the credentials. Push it to GitHub. Read the install guide for the CMS or framework in the fortrabbit docs first: it names the settings that move into environment variables.
4. Copy the settings
- Open the config file, such as
.envorwp-config.php. Copy every value except the database credentials and the site URL into the environment variables of the fortrabbit environment. - Open Cron Jobs in cPanel. Each entry becomes one cron job. Paths like
/home/<user>/public_htmlchange, see the directory structure. - Open
.htaccessinpublic_html. fortrabbit runs Apache too, so most rewrite rules stay as they are. PHP settings set in.htaccessorphp.inimove to the PHP settings in the dashboard.
5. Deploy the code
Connect the repository to the environment and push. Composer runs in the build commands.
6. Move the database
Open phpMyAdmin in cPanel, select the database and export it as SQL. With SSH, mysqldump works too. Import the dump into the MySQL component as described under MySQL export and import.
7. Copy the uploads
Push the upload folder, such as wp-content/uploads, to the environment with rsync.
8. Keep the mail
cPanel hosting usually bundles mailboxes, and fortrabbit has none. Before switching the DNS, move the mailboxes to a mail provider, or keep the old hosting plan for mail only and leave the MX records as they are. The app itself sends mail over SMTP or a transactional mail provider, since PHP mail() does not work on fortrabbit, see limits.
9. Switch the DNS
When the domain uses the nameservers of the old host, its records are in the Zone Editor of cPanel. Test the app on its default domain, add the custom domain to the environment and point the records to fortrabbit, see external domain setup. Moving the domain to a registrar or DNS provider first keeps DNS working after the hosting plan ends.
Cancel the hosting plan once the site, the mail and the DNS run without it.