Skip to main content
cPanel Technical Support has been heavily impacted by hurricane Beryl and our ability to respond to tickets has been hindered as a result. We appreciate your understanding and patience as we address these delays.

Moving site to new URL on same server

Comments

8 comments

  • cPRex Jurassic Moderator
    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
  • openroadsite
    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:
    0
  • cPRex Jurassic Moderator
    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
  • Rachel S
    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
  • firstdev123
    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
  • quietFinn
    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
  • firstdev123
    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
  • cPRex Jurassic Moderator
    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.