moving wordpress from a subdomain

9 replies
I have a problem with a WP database and decided to do a clean install on it. I installed wordpress on a subdomain, imported all the posts etc. from the mother site into it etc..

Now, I have pretty much exactly what I want on the subdomain. I am just nervous about moving it over. Technically, if I:

1. move all the files from the subdomain into the public html folder
2. delete the main database (the one now serving the root domain)

Should the site (currently on the subdomain) work on the root domain?

Do I need to do anything to the database or wordpress on current subdomain site?

Please let me know.
#moving #subdomain #wordpress
  • Profile picture of the author topnichewebsites
    Are you stilling looking to get this done ?
    Signature
    http://pixelcovers.com/ <- eBook add eCovers

    https://www.unicommercesolutions.com <- WordPress Websites and Maintenance
    {{ DiscussionBoard.errors[7025434].message }}
    • Profile picture of the author jmartinez
      Are you sure the problem was with the database and not any of your themes, plugins, etc... ?

      If all you need to do is use a different database, the first thing I would look into is changing the database settings in wp-config.php. Have it point to the new database you setup. Nothing gets deleted and you can switch back if you need to. All your files stay intact. I haven't worked with wordpress in a little while, but I'm guessing the database settings are in that file. If they are also stored in the database, then that will need to be updated. But, I'd look into simply switching the database.

      If you have the same problem with the new db, then it could be that your database is fine and then it's just one of your files. Most likely a plugin or theme file. You could remove each plugin, and copy in the replacement plugin files one at a time. Same thing with your theme.

      You could just switch everything like you are planning, but some of what I suggested may be a safer way to test a few things out and it may fix it. Although, it may take a little more time experimenting. Just depends on what you want to do. I'd look into the plugins and theme first since that may be the problem. Try just switching themes and see if everything works. Then you know it's in the theme.
      {{ DiscussionBoard.errors[7027436].message }}
      • Profile picture of the author fortony
        That's a good idea. If I move the wp-config file to the public html folder, it should automatically be on the new database?


        Originally Posted by jmartinez View Post

        Are you sure the problem was with the database and not any of your themes, plugins, etc... ?

        If all you need to do is use a different database, the first thing I would look into is changing the database settings in wp-config.php. Have it point to the new database you setup. Nothing gets deleted and you can switch back if you need to. All your files stay intact. I haven't worked with wordpress in a little while, but I'm guessing the database settings are in that file. If they are also stored in the database, then that will need to be updated. But, I'd look into simply switching the database.

        If you have the same problem with the new db, then it could be that your database is fine and then it's just one of your files. Most likely a plugin or theme file. You could remove each plugin, and copy in the replacement plugin files one at a time. Same thing with your theme.

        You could just switch everything like you are planning, but some of what I suggested may be a safer way to test a few things out and it may fix it. Although, it may take a little more time experimenting. Just depends on what you want to do. I'd look into the plugins and theme first since that may be the problem. Try just switching themes and see if everything works. Then you know it's in the theme.
        Signature

        Give your glass products the strength of 9H tempered glass with Dglass Coat. https://dglasscoat.com/

        {{ DiscussionBoard.errors[7027666].message }}
  • Profile picture of the author Johan Efendi
    Originally Posted by fortony View Post

    I have a problem with a WP database and decided to do a clean install on it. I installed wordpress on a subdomain, imported all the posts etc. from the mother site into it etc..

    Now, I have pretty much exactly what I want on the subdomain. I am just nervous about moving it over. Technically, if I:

    1. move all the files from the subdomain into the public html folder
    2. delete the main database (the one now serving the root domain)

    Should the site (currently on the subdomain) work on the root domain?

    Do I need to do anything to the database or wordpress on current subdomain site?

    Please let me know.
    First thing, just backup the database related

    If your problem just moving from root into subdomain, i think its not necessary to clean install. just move all your files and a little tweaking on your wordpress options table
    {{ DiscussionBoard.errors[7027583].message }}
  • Profile picture of the author Abledragon
    Here's the step-by-step- process for moving WordPress up to the root:

    Move WordPress from a Sub-Folder to the Root | WealthyDragon

    Cheers,

    Martin.
    Signature
    WealthyDragon - Earning My Living Online
    {{ DiscussionBoard.errors[7028060].message }}
  • Profile picture of the author RenderTheWeb
    Hey,

    Okay from my understanding you have a WordPress blog installed on domain.com/blog and you are wanting to move it to blog.domain.com.

    You need to do a database backup and a clean install of WordPress in the domain you want to use it on. After that restore the database on the domain you want to use.

    Subfolder - www.domain.com/blog
    Sub-domain - blog.domain.com

    However you want you just need to restore the content in the correct section and things will be okay. Make sure you verify and confirm before you delete anything and even then you should have a back up.

    You can't just move the config file unless you know what you're doing and you make corrections in the file itself.
    {{ DiscussionBoard.errors[7028096].message }}
  • Profile picture of the author fortony
    Thanks for all the help, although some people did not really look at the question.

    If anyone else needs to clean up a WP database, it is fairly easy to just export posts etc. and then import them into a new site you setup. Then, just transfer the files over to the root and delete the old database.

    One thing to watch out for that threw me at first is to make sure you have the right site address set (in Settings/General)
    Signature

    Give your glass products the strength of 9H tempered glass with Dglass Coat. https://dglasscoat.com/

    {{ DiscussionBoard.errors[7034761].message }}
  • Profile picture of the author armastevs
    I've had to move several of my sites, wordpress has documentation about it here

    codex.wordpress .org/Changing_The_Site_URL

    One of the most important things is changing
    update_option('siteurl','new url');
    update_option('home','new url');
    in the functions.php of your theme
    {{ DiscussionBoard.errors[7036019].message }}
    • Profile picture of the author Johan Efendi
      Originally Posted by armastevs View Post

      I've had to move several of my sites, wordpress has documentation about it here

      codex.wordpress .org/Changing_The_Site_URL

      One of the most important things is changing


      in the functions.php of your theme
      don't forget to change upload_path option too if you change folder location
      {{ DiscussionBoard.errors[7038304].message }}

Trending Topics