Support » Fixing WordPress » Moving site from subdomain to add-on domain

  • Resolved ge0shigh

    (@ge0shigh)


    I’ve been developing a site on a subdomain (which was the default location when I purchased the domain) but now want to push it to its own domain (i.e., it’s at targetdomain.maindomain.com and I want to move it to targetdomain.com).

    I’ve found “Moving Directories On Your Existing Server” on this page:
    http://codex.wordpress.org/Moving_WordPress#When_Your_Domain_Name_or_URLs_Change

    This feels slightly dangerous for what must be a fairly common thing to want to do. Is there some more recent information, or an easier way?

    If this is what I have to do, here are some specific questions:

    Step 7: (Do not try to open/view your site now!)… If I change the WordPress Address (URL) and Site Address (URL) on the old site to the new URL, is it possible to still access the old site if something goes wrong? I guess I would need to access the files from cpanel only since there’s no way to login again?

    Step 8: Move your WordPress core files… I assume I would do this using a tool such as cpanel?

    Step 9: Now, try to open your site… Will my old WP admin login credentials be valid when I try to login to the new URL? Also, the text says “try to open”. Does this mean there is some chance it won’t?

    And some general questions:

    – Should I install WP on the new site first before I move the files, or will copying those files also install WP?

    – If I’ve used a plugin on the old site to create tables and have those referenced from pages using shortcode, do I need to be sure I’ve installed the plugin before I move the files? Or will the plugins come over too?

    Thanks, I know these are a lot of questions, but I don’t want to lose any work I’ve done or have anything go wrong.

Viewing 13 replies - 1 through 13 (of 13 total)
  • Moderator James Huff

    (@macmanx)

    Halfelf Minion 🚀

    It’s not dangerous, it’s actually straightforward.

    Just change the setting, move the files, and replace any URLs in post/page content. You’re doing the web equivalent of moving a piece of furniture into a different room. 🙂

    Since you’re actually changing the domain, follow this instead: http://codex.wordpress.org/Moving_WordPress#Changing_Your_Domain_Name_and_URLs

    For your specific questions:

    is it possible to still access the old site if something goes wrong?

    Yes, but you’ll need to movie the files back and change URLs back directly in the database to do it: https://codex.wordpress.org/Changing_The_Site_URL#Changing_the_URL_directly_in_the_database

    I assume I would do this using a tool such as cpanel?

    The file manager in cPanel, or via FTP or SFTP.

    Will my old WP admin login credentials be valid when I try to login to the new URL?

    Of course, you’re just moving it, not modifying anything else.

    Also, the text says “try to open”. Does this mean there is some chance it won’t?

    Well, if you did it wrong, it won’t open. 🙂

    Should I install WP on the new site first before I move the files, or will copying those files also install WP?

    You’re moving all the files, including WordPress’s core files. Not need to install again.

    If I’ve used a plugin on the old site to create tables and have those referenced from pages using shortcode, do I need to be sure I’ve installed the plugin before I move the files? Or will the plugins come over too?

    You’re moving all of the files, not leaving any behind.

    Thanks for your prompt and thorough help. I’ve completed the process, except for the search and replace, since there is a note at the bottom of the instructions that says: “Only perform a search and replace on the wp_posts table.”

    There are two remaining problems:

    1) I’ve used the TablePress plugin to format tables, which contains graphics with links to other pages on the site. These still point to the old site. Should I do a search and replace using the recommended tools to fix those?

    2) The pages don’t display the same as before. I’m using the Twenty Twelve theme. At the new URL the text fills up the entire browser window and the font displays larger. At the old URL, there is white space around page and the text is smaller.

    Otherwise, everything seems to have transferred.

    Hum, the large text is happening only in Firefox. In IE, and Chrome, it looks fine. In Firefox, I open the new URL and the text is large and no white space. Then I click on a graphic that links to the old URL, and the old page looks fine…

    Moderator James Huff

    (@macmanx)

    Halfelf Minion 🚀

    I’ve used the TablePress plugin to format tables, which contains graphics with links to other pages on the site. These still point to the old site. Should I do a search and replace using the recommended tools to fix those?

    Yes. If your hosting provider offers shell access and WP-CLI, use http://wp-cli.org/commands/search-replace/

    If they don’t, use https://wordpress.org/plugins/better-search-replace/

    Hum, the large text is happening only in Firefox. In IE, and Chrome, it looks fine. In Firefox, I open the new URL and the text is large and no white space.

    What is the URL of the site?

    Thanks, James.

    The new site is:
    http://staycybersecure.com/

    The old site is
    http://staycybersecure.ocelotdesign.com/

    It looks like css changes I made didn’t make it over, such as removing box shadow from images.

    Moderator James Huff

    (@macmanx)

    Halfelf Minion 🚀

    Did you move all of the files over?

    Did you make the changes directly to the theme, a child theme, or use a custom CSS plugin?

    Moderator James Huff

    (@macmanx)

    Halfelf Minion 🚀

    The site looks fine to me in Firefox 36. Make sure you clear your browser’s cache.

    Directly to the theme.

    As for how the text and whitespace looks in Firefox: I just tried it on another computer. The pages look fine in IE and Chrome there, but all of the pages seem to have large text, no whitepace on Firefox.

    Moderator James Huff

    (@macmanx)

    Halfelf Minion 🚀

    I see plenty of whitespace in Firefox 36, and the text is just fine too: https://cloudup.com/cu-NOTi0Vkv

    Have you tried clearing your browser’s cache yet?

    I just cleared it. It looks okay. But I don’t know why staycybersecure.com looks different from staycybersecure.ocelotdesign.com in Firefox but they look identical IE and Chrome.

    Moderator James Huff

    (@macmanx)

    Halfelf Minion 🚀

    Okay, James, thanks for your expert help. Very much appreciated.

    Moderator James Huff

    (@macmanx)

    Halfelf Minion 🚀

    You’re welcome!

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Moving site from subdomain to add-on domain’ is closed to new replies.