Moving site to new URL on same server

Operating System & Version
CentOS v7.9.2009
cPanel & WHM Version
v100.0.11

openroadsite

Registered
Mar 24, 2022
2
0
1
North Carolina, USA
cPanel Access Level
Root Administrator
Hi everyone,

I have a site on my server that I'd like to move to a new URL.

My understanding of this process is that the recommended approach is to back up my files and databases, then copy everything over to the new account. But since they are both on the same server, isn't there an easier way? Can I just run a shell command or something to copy the contents from one account directory to the other?

The reason I'm hesitant to do this backup/download/upload process is because my site is about 40 gigs in size. It will take forever to get that copied and I don't even know if the download will complete. Is there a way to dump it on the server itself? Most of the posts I see are from one server to another, but are there shortcuts if I'm just moving within the same server?

I have full root WHM access if that helps. Thanks!
 
Last edited by a moderator:

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
14,307
2,238
363
cPanel Access Level
Root Administrator
Hey there! Are you changing the directory structure or do you just want to change the name of the site? If the files are all under one account and you just need to update the domain name, there's a tool that can help:

Modify an Account: Modify an Account | cPanel & WHM Documentation

Using that tool will update the settings on the cPanel side of things, such as the Apache entries, domain name, DNS, and relevant configuration files on the system to use the new domain.

What *won't* happen automatically is any updates to your site code. If you have relative links throughout your code it shouldn't be an issue, but if you're using WordPress or a similar CMS, you'll need to update the configuration there to reflect the new domain name.

Let me know if that helps or if you have more questions!
 

openroadsite

Registered
Mar 24, 2022
2
0
1
North Carolina, USA
cPanel Access Level
Root Administrator
Hey there! Are you changing the directory structure or do you just want to change the name of the site? If the files are all under one account and you just need to update the domain name, there's a tool that can help:

Modify an Account: Modify an Account | cPanel & WHM Documentation

Using that tool will update the settings on the cPanel side of things, such as the Apache entries, domain name, DNS, and relevant configuration files on the system to use the new domain.

What *won't* happen automatically is any updates to your site code. If you have relative links throughout your code it shouldn't be an issue, but if you're using WordPress or a similar CMS, you'll need to update the configuration there to reflect the new domain name.

Let me know if that helps or if you have more questions!
Thank you so much for the prompt reply!

I did intend to change the structure of the site but with this option I'm thinking I just copy it over as it is today and then modify the structure once it's on the new account. Would that work or is there a different option I should consider?
 

Rachel S

Member
Apr 28, 2022
23
5
3
United States
cPanel Access Level
Website Owner
If you want to change the filesYou can directly move the file from the command line using the MV command.

It will easily move your files and directories of your site, no matter how big the site is.
If you want to move the file from "fileA" to the current working directory to the /tmp directory you will run, you need to use:
"mv fileA /tmp"
OR
You can change the domain name using the cPanel tool, moving the site to a new URL on the same server.