# Migrate from cPanel hosting to fortrabbit

Source: https://www.fortrabbit.com/migrate/from-cpanel
Published: 2026-10-31
Updated: 2026-10-31


## 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:



```txt
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](/agents). 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](https://docs.fortrabbit.com/platform/deployment/github-app) |
| `.env`, `wp-config.php` or other config files | [Environment variables](https://docs.fortrabbit.com/platform/settings/env-vars) |
| Cron Jobs | [Cron jobs](https://docs.fortrabbit.com/platform/jobs/crons) |
| 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](https://docs.fortrabbit.com/dev/how-to/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](https://docs.fortrabbit.com/dev/how-to/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](https://docs.fortrabbit.com/guides) first: it names the settings that move into environment variables.

## 4. Copy the settings

- Open the config file, such as `.env` or `wp-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_html` change, see the [directory structure](https://docs.fortrabbit.com/platform/code-access/directories).
- Open `.htaccess` in `public_html`. fortrabbit runs Apache too, so most rewrite rules stay as they are. PHP settings set in `.htaccess` or `php.ini` move 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](https://docs.fortrabbit.com/platform/deployment/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](https://docs.fortrabbit.com/platform/mysql/export-import).

## 7. Copy the uploads

Push the upload folder, such as `wp-content/uploads`, to the environment with [rsync](https://docs.fortrabbit.com/dev/how-to/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](https://docs.fortrabbit.com/platform/concepts/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](https://docs.fortrabbit.com/platform/domains/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.

---

- [Migrate to fortrabbit](/dev/how-to/migrate-to-fortrabbit)
- [Download a website](/dev/how-to/download-a-website)
- [PHP hosting without cPanel](/php-hosting/without-cpanel)
