Moving site to new URL on same server
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!
-
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! 0 -
That would work just as well, but if you use the "Modify an Account" tool you don't have to copy over anything as it changes the name of the domain in place where the existing files are. 0 -
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. 0 -
That would work just as well, but if you use the "Modify an Account" tool you don't have to copy over anything as it changes the name of the domain in place where the existing files are.
I did this on my domain, which is on my server 1- I changed the domain of A to B, but the database details of B is identical to database A Will that cause any problems in the future or do I have to change the database details of B like: cpanel username, database name, username or even the database prefix, since I changed the domains. I am specifically worried about "APP_URL" in the .env file (Laravel framework), since it is pointing to A and not B, and the site is still working smoothly.. I have full root WHM access if that helps. Thanks!0 -
in cPanel database names and database usernames are usually prefixed with CPANELUSERNAME_, if you change the domain of the cPanel account the cPanel username does not change, so database will work as before after that change. 0 -
in cPanel database names and database usernames are usually prefixed with CPANELUSERNAME_, if you change the domain of the cPanel account the cPanel username does not change, so database will work as before after that change.
I understood that part, but how about the "APP_URL" (in .env file), even though it is set to the old domain the website is perfectly working fine... How is that possible ?0 -
I'm not sure about the inner workings of the Laravel system, so I don't have a good answer for that. 0
Please sign in to leave a comment.
Comments
8 comments