Help Moving Wordpress Site from One Domain to New Domain on Same Host

by razul
12 replies
  • WEB DESIGN
  • |
Hello,

Is it easy?

I have read this: https://codex.wordpress.org/Changing_The_Site_URL

But there are many options, all different. I really hope an expert could tell me the pros and cons of each method.

Like is there really a single method I should use that will cause the least amount of problems now and in the future

Thank you very much for any help
#domain #host #moving #site #wordpress
  • Profile picture of the author topnichewebsites
    There lots of ways to do this

    1. Manually edit your files and database
    2. Use a plugin like importbuddy to copy and restore
    3. Outsource it to someone for a few bucks

    All the above can be done in minutes, let me know if you need more help or info
    Signature
    http://pixelcovers.com/ <- eBook add eCovers

    https://www.unicommercesolutions.com <- WordPress Websites and Maintenance
    {{ DiscussionBoard.errors[7398540].message }}
  • Profile picture of the author razul
    awesome. thank you. since I'm not changing hosts, this is really simple isn't it?

    do i just change some variables in the database via myphpadmin?
    Signature
    iMarketingForBeginners.com -> Get your Free Affiliate Marketing Guide

    For the love of Chango: Use the "Thanks" button instead of spamming/plaguing a thread with your thank you posts
    {{ DiscussionBoard.errors[7398614].message }}
    • Profile picture of the author Istvan Horvath
      Originally Posted by razul View Post

      awesome. thank you. since I'm not changing hosts, this is really simple isn't it?

      do i just change some variables in the database via myphpadmin?
      Not really. I, for example, have a reseller account with my host and every domain has its own cPanel and database. Which means, I have to "move" the WP files and the database from one location to the other if changing domains...

      Actually, for what you want to do, the Codex page you linked to is not correct.
      This is what you need:
      https://codex.wordpress.org/Moving_WordPress
      Signature

      {{ DiscussionBoard.errors[7398982].message }}
      • Profile picture of the author razul
        Originally Posted by Istvan Horvath View Post

        Not really. I, for example, have a reseller account with my host and every domain has its own cPanel and database. Which means, I have to "move" the WP files and the database from one location to the other if changing domains...

        Actually, for what you want to do, the Codex page you linked to is not correct.
        This is what you need:
        https://codex.wordpress.org/Moving_WordPress
        awesome, thank you.

        mine are all in the same cpanel. I just want to move from one addon domain to another addon domain all within the same hosting/cpanel account.

        I'll check your link for this. thank you
        Signature
        iMarketingForBeginners.com -> Get your Free Affiliate Marketing Guide

        For the love of Chango: Use the "Thanks" button instead of spamming/plaguing a thread with your thank you posts
        {{ DiscussionBoard.errors[7400587].message }}
  • Profile picture of the author Istvan Horvath
    Sorry, I cannot help: never had addon domains... have no idea how they work. I always find them very complicated
    Signature

    {{ DiscussionBoard.errors[7400690].message }}
  • Profile picture of the author f00gee
    point the addon domain to the same directory as your wp install. going to the domain should bring up the blog. now you just need to update wp.

    On the Settings->General screen in a single site installation of WordPress, there are two fields named "WordPress address (URL)" and "Site address (URL)".
    Signature

    Mike @ InterServer.net
    Web, VPS and Dedicated Hosting

    {{ DiscussionBoard.errors[7400891].message }}
    • Profile picture of the author razul
      Originally Posted by f00gee View Post

      point the addon domain to the same directory as your wp install. going to the domain should bring up the blog. now you just need to update wp.

      On the Settings->General screen in a single site installation of WordPress, there are two fields named "WordPress address (URL)" and "Site address (URL)".
      Thanks. Then will my old domain but automatically redirected?

      So the new domain folder will have no contents in it? Because it's just pointing to the old domain folder? Correct?

      Thanks for the help.
      Signature
      iMarketingForBeginners.com -> Get your Free Affiliate Marketing Guide

      For the love of Chango: Use the "Thanks" button instead of spamming/plaguing a thread with your thank you posts
      {{ DiscussionBoard.errors[7401765].message }}
  • Profile picture of the author Kingfish85
    Ok, here's what you need to do if everything is staying on the same hosting account -

    1. You don't need to change anything in the database itself other than the URL for the site.

    2. None of the info inside the WP-Config.php file needs to change either, since it's still running as the same user & the mySQL database/user is tied to the same account.

    3. Create your addon domain - then move all of your files into that addon domains' directory.

    4. Make sure you enter the new domain URL into the database tables.

    5. Point the new domain to the same namservers as what you're using for the main hosting account.

    Since the addon domain is on the same account, the domain itself will know to look for it - when you create an addon domain, it automatically adds the necessary DNS records on the account.

    If you have any problems, feel free to shoot me a PM or ask away here on the thread. As always, run a full backup from inside cPanel before making any changes.
    Signature

    |~| VeeroTech Hosting - sales @ veerotech.net
    |~| High Performance CloudLinux & LiteSpeed Powered Web Hosting
    |~| cPanel & WHM - Softaculous - Website Builder - R1Soft - SpamExperts
    |~| Visit us @veerotech Facebook - Twitter - LinkedIn

    {{ DiscussionBoard.errors[7401955].message }}
    • Profile picture of the author razul
      Originally Posted by Kingfish85 View Post

      Ok, here's what you need to do if everything is staying on the same hosting account -

      1. You don't need to change anything in the database itself other than the URL for the site.

      2. None of the info inside the WP-Config.php file needs to change either, since it's still running as the same user & the mySQL database/user is tied to the same account.

      3. Create your addon domain - then move all of your files into that addon domains' directory.

      4. Make sure you enter the new domain URL into the database tables.

      5. Point the new domain to the same namservers as what you're using for the main hosting account.

      Since the addon domain is on the same account, the domain itself will know to look for it - when you create an addon domain, it automatically adds the necessary DNS records on the account.

      If you have any problems, feel free to shoot me a PM or ask away here on the thread. As always, run a full backup from inside cPanel before making any changes.
      Awesome. Thank you so much for taking the time to write that detailed response.

      My addon domain is ready to go, ive put the correct nameservers on it, and ive installed it via the cpanel. A folder has been created in filezilla. I have downloaded my entire FTP and exported my database as backups & completed a cpanel backup – thanks for the reminder tho.

      So just slightly modifying your steps, how does this sound:

      1. In WordPress (WP) Change the WordPress Address (URL) to the new URL that you want to use.

      2. In WP Change the Site Address (URL) to the same value. Save changes

      3. Go into myphpadmin and change in the appropriate database siteurl and home to my new URL without the trailing slash (or maybe this will happen from steps 1 & 2?)

      4. Via Filezilla, move entire contents of old domain folder to new domain folder (or should I modify the database after this step? Or doesn’t matter?)

      5. Then my newsite should be fine?

      6. Shold I do this? Install the “search and replace” plugin to find all the instances of my old URL in the new domain’s database and replace them with the new domain URL

      7. Then to do the best 301 redirect from my old url to my new url I’ll change the .htaccess file in the OLD domain’s folder and add this to the very start of the file:

      a.
      #Options +FollowSymLinks
      RewriteEngine on
      RewriteRule ^(.*)$ http://www.ENTER-YOUR-NEW-DOMAIN-HERE.COM/$1 [R=301,L]


      b. So that will mean everything get’s redirected 1 to 1? E.g. old.com/post123 redirects to new.com/post123

      c. I really do not want everything redirected to my new domain’s homepage

      8. Is that it? How does that sound? Thanks for your advice.


      Also, I read this, is it true:
      you can just repoint the domains, which is personally what I would do.

      If it's on the same server you don't need to move the files and you don't need to move the database.All you need to do is edit the apache config and point the virtual host for the new domain to the directory where your files are. And then go to the wordpress config and tell it what the new external URL is. Doing it like this will take you 2-3 minutes in total and it's lot safer than moving files around and risking to break stuff.


      Thanks again
      Signature
      iMarketingForBeginners.com -> Get your Free Affiliate Marketing Guide

      For the love of Chango: Use the "Thanks" button instead of spamming/plaguing a thread with your thank you posts
      {{ DiscussionBoard.errors[7402183].message }}
      • Profile picture of the author Kingfish85
        Originally Posted by razul View Post


        Also, I read this, is it true:
        you can just repoint the domains, which is personally what I would do.


        Yes, this is what you can do.

        Originally Posted by razul View Post

        If it's on the same server you don't need to move the files and you don't need to move the database.All you need to do is edit the apache config and point the virtual host for the new domain to the directory where your files are. And then go to the wordpress config and tell it what the new external URL is. Doing it like this will take you 2-3 minutes in total and it's lot safer than moving files around and risking to break stuff.
        Originally Posted by razul View Post

        No problem.

        ^This will work as well, but it's not the correct way to do it. If you edit the apache config, you're telling apache to look for the contents in a different place.

        Normal: site123.com --> looks in site123.com directory

        Apache edit: site123.com --> looks in oldsite.com directory

        It will work, but physically moving the files into the correct directory is the "right" way to do this. Not to mention, while minute, it will create additional processing that Apache will need to do. From what I outlined above, the Apache edit is merely telling Apache to look in a different place.

        If you're going to move the site, move it the correct way. It will save you and your next web host from a major headache if you decide to move and they restore a cPanel backup which then breaks it when the backup gets restored.

        Don't forget to run your backup before making any changes. There is a possibility some plugins may need to be re-enabled after moving. We run into this frequently when restoring accounts from other servers.
        Signature

        |~| VeeroTech Hosting - sales @ veerotech.net
        |~| High Performance CloudLinux & LiteSpeed Powered Web Hosting
        |~| cPanel & WHM - Softaculous - Website Builder - R1Soft - SpamExperts
        |~| Visit us @veerotech Facebook - Twitter - LinkedIn

        {{ DiscussionBoard.errors[7402217].message }}
        • Profile picture of the author razul
          Originally Posted by Kingfish85 View Post

          It will work, but physically moving the files into the correct directory is the "right" way to do this.
          Thanks again man!

          Yeah I want to do it the "right" way. So i'll ignore that other shortcut stuff. So if I follow the numbered steps I wrote (based on yours), will that be fine?

          Was my 301 redirect code fine?

          Thank you
          Signature
          iMarketingForBeginners.com -> Get your Free Affiliate Marketing Guide

          For the love of Chango: Use the "Thanks" button instead of spamming/plaguing a thread with your thank you posts
          {{ DiscussionBoard.errors[7402269].message }}
  • Profile picture of the author razul
    So I did it after a fair bit of research and help from above (thanks!), here are the actual steps I took to complete the move. I hope it can help someone in the future.

    Actual Steps Taken

    • Buy domain set it up
    • Create WP on new domain
    • In FTP Delete it's contents
    • Go to old dom and activate themfuse
    • Then go to general settings and change site and home to new domain without trailing slash
    • ftp: Upload old dom contents to new dom empty folder
    • Wait for upload
    • Test site
    • Do 301 redirect, Add this to the very start of the old dom's .htaccess file
    • Check redirect is working
    • Install search and replace plugin
    • Then do search and replace for: olddom.com to newdom.com
    • Double check all gone - sometimes not
      • If not, record the positions and delete them manually.
      • in hindsight, need to do this step differently because of the Data Serialization problem encountered (and lost my text widgets)
    • Check Everything - not once, not twice but 5 Times.
      Check the links. Check the posts. Check the navigation bar. Check the images. Check the opt-in forms to see if they still work. Check everything to make sure your site is an exact replica of the old one....and make sure that the Search and Replace actually worked by seeing where the links take you. Here's another issue that you might encounter.
    • Read this: https://support.google.com/webmaster...n&answer=83105
    • Let Google Know About The Change
      I highly recommend going to your Google webmasters account and submitting a change of address. To do this, click on your verified site and on the left hand menu, click on Site Configuration. (Screenshot to the right)
      Under Site Configuration, you're going to click on Change of Address. Just enter your new domain, verify it and you're done!
    • index both sites again. so google knows. use linklicious. submit new sitemaps too;
    • copy email to this doc
    Findings:
    Conclusion:
    * Everything worked out well in the end. I recovered my text widgets contents from my database backup.

    * the redirects worked. so everything is going as planned!


    Woooooo!
    Signature
    iMarketingForBeginners.com -> Get your Free Affiliate Marketing Guide

    For the love of Chango: Use the "Thanks" button instead of spamming/plaguing a thread with your thank you posts
    {{ DiscussionBoard.errors[7405921].message }}

Trending Topics