How7o
  • Home
  • Marketing
    MarketingShow More
    The Beginner’s Guide about Facebook Advertising
    6 Min Read
    64 Creative Marketing Ideas to Boost Your Business
    6 Min Read
  • OS
    OSShow More
    How to force quit frozen apps in Ubuntu
    Force Close an App in Ubuntu (xkill, System Monitor, kill -9)
    4 Min Read
  • Features
    FeaturesShow More
  • Guide
    GuideShow More
    Tips to Keep Your Cloud Storage Safe and Secure
    6 Min Read
  • Contact
  • Blog
Reading: cPanel to aaPanel Migration with rsync: Fix Permissions, SSH Port, and CSF Firewall
Share
Subscribe Now
How7oHow7o
Font ResizerAa
  • Marketing
  • OS
  • Features
  • Guide
  • Complaint
  • Advertise
Search
  • Categories
    • Marketing
    • OS
    • Features
    • Guide
    • Lifestyle
    • Wellness
    • Healthy
    • Nutrition
  • More Foxiz
    • Blog Index
    • Complaint
    • Sitemap
    • Advertise
Follow US
Copyright © 2014-2023 Ruby Theme Ltd. All Rights Reserved.
How7o > Blog > Server Management > cPanel to aaPanel Migration with rsync: Fix Permissions, SSH Port, and CSF Firewall
Server Management

cPanel to aaPanel Migration with rsync: Fix Permissions, SSH Port, and CSF Firewall

how7o
By how7o
Last updated: January 13, 2026
6 Min Read
Migrating files from cPanel to aaPanel using rsync
SHARE

How I Migrated Website Files from cPanel to aaPanel Using rsync (and Kept Correct www Permissions)

I’m in the middle of moving my website content from Discourse to WordPress, which means I’ve been rebuilding and rewriting posts on the new setup. But before any of that could happen, I had to solve a more “boring but critical” problem: moving the actual website files from a cPanel server to an aaPanel server without breaking permissions.

Contents
  • What I Wanted (and What Usually Goes Wrong)
  • Step 1: Confirm rsync Exists (Both Servers)
    • CentOS / AlmaLinux / Rocky
    • Ubuntu / Debian
  • Step 2: Use screen So the Transfer Doesn’t Die
  • Step 3: The rsync Command I Used (cPanel → aaPanel)
    • What these flags actually do (in plain English)
  • Step 4: The “Connection Refused” Problem (It Was CSF)
    • How I confirmed it
    • How I fixed it
  • Optional: Do a Safe Dry Run First
  • Quick Checks After the Copy (aaPanel Side)
  • FAQ / Common Tweaks
    • Should I add --delete?
    • Do I need to keep cPanel permissions?
    • How do I close/remove screen when done?
  • Final Notes

I decided to use rsync over SSH because it’s fast, reliable, and perfect for incremental transfers. I also wanted the files on aaPanel to have clean, standard permissions and the correct ownership (typically www:www), so the site would work immediately.

What I Wanted (and What Usually Goes Wrong)

  • Copy files from cPanel → aaPanel quickly
  • Keep permissions sane (folders 755, files 644)
  • Ensure correct ownership on aaPanel (web user like www)
  • Avoid disconnect issues during long transfers

The most common issues I ran into (and you might too):

  • SSH works from your PC, but fails from the cPanel server (hello, firewall rules)
  • “Connection refused” because you’re using the wrong SSH port or the port is blocked
  • Files copy, but the site breaks because ownership/permissions don’t match what aaPanel expects

Step 1: Confirm rsync Exists (Both Servers)

On both servers, I ran:

rsync --version
which rsync

If rsync wasn’t installed, here’s what I used:

CentOS / AlmaLinux / Rocky

dnf install -y rsync
# or
yum install -y rsync

Ubuntu / Debian

apt update && apt install -y rsync

Step 2: Use screen So the Transfer Doesn’t Die

Big transfers can take time. If your SSH session drops, your rsync command dies too—unless you run it inside screen (or tmux). I used screen.

screen -S rsync

To detach (leave it running): Ctrl + A, then press D (not Ctrl+D).

To reattach later:

screen -r rsync

Step 3: The rsync Command I Used (cPanel → aaPanel)

This is the exact pattern I used for my uploads folder migration:

rsync -avh --chown=www:www --chmod=Du=rwx,Dgo=rx,Fu=rw,Fgo=r -e "ssh -p 10015" /home/domainuser/public_html/uploads/ root@AA_PANEL_IP:/www/wwwroot/domain/uploads/

What these flags actually do (in plain English)

  • -a = “archive mode” (keeps structure, times, symlinks, etc.)
  • -v = verbose output (shows what’s happening)
  • -h = human-readable sizes
  • --chown=www:www = on the aaPanel side, set owner/group to www:www so the web server can work with the files
  • --chmod=Du=rwx,Dgo=rx,Fu=rw,Fgo=r = enforce standard permissions:
    • Folders: 755
    • Files: 644
  • -e "ssh -p 10015" = use SSH on port 10015

Important: aaPanel setups vary. Some servers use www-data instead of www. If your web user is www-data, change --chown=www:www to --chown=www-data:www-data.

Step 4: The “Connection Refused” Problem (It Was CSF)

Here’s the part that wasted my time: I could SSH to my aaPanel server from my laptop just fine, but from the cPanel server I got:

ssh: connect to host IP port 10015: Connection refused
rsync: connection unexpectedly closed (0 bytes received so far)

At first I assumed the aaPanel server was the issue, but the clue was: “works from my PC, fails from the server.” That usually points to a firewall rule. In my case, CSF was installed on the cPanel server and it was blocking the outgoing connection.

How I confirmed it

From the cPanel server, I tested the port:

nc -vz AA_PANEL_IP 10015

Then I checked CSF for blocks:

csf -g AA_PANEL_IP

How I fixed it

I whitelisted the aaPanel IP in CSF. After that, the connection worked and rsync ran normally.

If you use non-standard SSH ports, also make sure your outbound ports are allowed in CSF (TCP_OUT) so you don’t hit this again later.

Optional: Do a Safe Dry Run First

If you’re syncing into a folder that already has content, a dry-run is a lifesaver. It shows what would change without copying anything.

rsync -avhn --itemize-changes --chown=www:www --chmod=Du=rwx,Dgo=rx,Fu=rw,Fgo=r -e "ssh -p 10015" /home/domainuser/public_html/uploads/ root@AA_PANEL_IP:/www/wwwroot/domain/uploads/

Quick Checks After the Copy (aaPanel Side)

On the aaPanel server, I verified ownership and permissions:

ls -ld /www/wwwroot/domain/uploads
ls -l /www/wwwroot/domain/uploads | head

What I wanted to see:

  • Owner/group: www www (or whatever your web user is)
  • Folders like: drwxr-xr-x (755)
  • Files like: -rw-r--r-- (644)

FAQ / Common Tweaks

Should I add --delete?

Only if you want the destination to match the source exactly. --delete will remove files on aaPanel that don’t exist on cPanel. I usually avoid it until final cutover.

Do I need to keep cPanel permissions?

Not really. In most migrations, I prefer “known good” web permissions on the new server (755/644) plus correct ownership. That’s why I used --chmod and --chown.

How do I close/remove screen when done?

If rsync finished and you’re inside screen:

exit

Or kill it directly:

screen -S rsync -X quit

Final Notes

Once this file migration was stable, finishing the Discourse → WordPress move became much easier—because now the WordPress site had everything it needed (uploads, assets, theme files, etc.) on the new aaPanel server.

If you’re doing the same migration, my biggest advice is: use screen, do a dry run, and handle ownership/permissions intentionally. Those three steps save hours of “why is this broken?” later.

TAGGED:aapanelcPanelcsf firewallfile permissionsLinuxNginxrsyncscreenSSHwebsite migration

Sign Up For Daily Newsletter

Be keep up! Get the latest breaking news delivered straight to your inbox.
By signing up, you agree to our Terms of Use and acknowledge the data practices in our Privacy Policy. You may unsubscribe at any time.
Share This Article
Facebook Copy Link Print
Previous Article Return or throw an error in Laravel (JSON response vs exception) How to Manually Return or Throw an Error Exception in Laravel
Next Article Create custom exception class in Laravel (Artisan command + secure error handling) How to Create a Custom Exception Class in Laravel (With Clean JSON Responses)
Leave a Comment

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

FacebookLike
XFollow
PinterestPin
InstagramFollow

Subscribe Now

Subscribe to our newsletter to get our newest articles instantly!
Most Popular
How I Fixed Composer Dependency Errors
How I Fixed Composer Dependency Errors Using the –ignore-platform-reqs Flag (Step-by-Step Guide)
January 12, 2026
Transfer Discourse to a new server
How to Transfer Discourse to a New Server on AlmaLinux (Backup + Restore, Step-by-Step)
January 12, 2026
Installed Discourse on AlmaLinux
How I Installed Discourse on AlmaLinux (Docker Method, Step-by-Step)
January 12, 2026
Installing Docker on AlmaLinux guide
Install Docker on AlmaLinux: Step-by-Step (Docker CE + Compose)
January 12, 2026
Change welcome message on Ubuntu VPS server (MOTD + SSH banner)
Change Welcome Message on Ubuntu VPS (MOTD + SSH Banner)
January 12, 2026

You Might Also Like

Automatic logout timeout for command line in Ubuntu (TMOUT 300s)
Server Management

Automatic Logout Timeout for Command Line in Ubuntu (TMOUT 300s)

5 Min Read
Check if GD library is installed in PHP (phpinfo and extension_loaded)
Web Development

How to Check if GD Library Is Installed in PHP (3 Easy Methods)

5 Min Read
Check if Laravel scheduler is running (cron + php artisan schedule:run)
Web Development

How to Check if Laravel Scheduler Is Running (Cron + Logs)

6 Min Read
Create a Directory in Ubuntu
Server Management

Create a Directory in Ubuntu (mkdir Command + Examples)

4 Min Read

Always Stay Up to Date

Subscribe to our newsletter to get our newest articles instantly!
How7o

We provide tips, tricks, and advice for improving websites and doing better search.

Latest News

  • SEO Audit Tool
  • Client ReferralsNew
  • Execution of SEO
  • Reporting Tool

Resouce

  • Google Search Console
  • Google Keyword Planner
  • Google OptimiseHot
  • SEO Spider

Get the Top 10 in Search!

Looking for a trustworthy service to optimize the company website?
Request a Quote
Welcome Back!

Sign in to your account

Username or Email Address
Password

Lost your password?