Join 3,501 readers in helping fund MetaFilter (Hide)


Move my new Wordpress site from subdirectory to root?
October 18, 2012 5:55 PM   Subscribe

Blog/website tech support needed! How can I move my newly designed Wordpress site from a subdirectory to the root, while somehow archiving the old indexhibit site which currently dwells on the root? I only have a couple of days in which to do this!

More info: I'm an artist and composer with a website. My current website runs on Indexhibit (v.1, not v.2). Over the past year I've gotten frustrated with the lack of flexibility, blogging and technical support, and I spent the last six months designing and building a new website from the ground up in Wordpress, on the same domain. I've done this by installing Wordpress in its own subdirectory, "domainname.org/blog" and using a plugin that requires a password to see it.

I am almost, almost done! Which is exciting. But I realize I have no idea how to:

(a) somehow preserve/archive my indexhibit site, just for old times (is it possible to make it viewable only on my computer?), and
(b) even more importantly, move the new website from "domainname.org/blog" to "domainname.org"

I will be getting some press on Sunday night, and want to have the site up and running well by then. I realize that time is of the essence.

Any ideas? I had thought to move my hosting from Bluehost to A Small Orange, however their tech people seemed a little clueless. I'm wondering if anyone here, especially those who have used indexhibit or other smaller cms's, might be able to point me to tutorials. It's hard to find stuff about indexhibit - which is one of the reasons I'm switching!
posted by betsbillabong to Computers & Internet (11 answers total) 2 users marked this as a favorite
 
The explanation I got via email from my tech support person who did it all for me, so, no, I can't really help if you can't follow this:

Hmm. That's certainly do-able; the only reason it
might be a little tricky is that (I think) Wordpress has its root
directory in a couple of places in the config, and this would change the
root directory. I'd have to find and fix those parts of the
configuration.

Otherwise, the steps would be:

1. Move the entire /blog directory out of the public_html folder.

2. Rename the public_html folder to "archive".

3. Create a new public_html folder.


4. Move the contents of the /blog directory into the new public_html
folder.

5. Move the archive into the public_html folder under
/archive.

6. Fix things. :-) For example, any links in the archive
would probably be broken. Some really clever regex work might be able to
handle most of them.

--
Don't forget to back everything up first. Yes, he had to do voodoo magic on my config files or something. On the upside, I fixed my own broken links.
posted by Michele in California at 6:21 PM on October 18, 2012


I know nothing about your current CMS, but I don't see why this wouldn't work.

1. Rename the current index page.
2. Follow the directions provided on your Wordpress settings page to serve the site from the root directory. Basically, all you do is move index.php up to public_html and edit the path to header.php in that file as it will be incorrect after you move it. And change the setting in Wordpress settings to indicate that you want the site to load from root.

Wordpress will load when people go to yoursite.com and all your old stuff will still be there. It might even load just fine if you point your browser to yoursite.com/renamedindexfile. That will depend on how the existing cms works.
posted by COD at 6:31 PM on October 18, 2012


You could use HTTrack to create a local static copy of the old site. Then you could upload it to a subfolder or just keep it local.
posted by backwards guitar at 6:34 PM on October 18, 2012


Wordpress is made to hinge on the variables contained in the database entries and the wp-config.php file. Otherwise, it's just a set of scripts that look at each other in relative position to one another (i.e. "I know this file is 3 folders down in the hierarchy from me, wherever I'm at, right now...").

You'll need access to PhpMyAdmin, or some other way of accessing your mySQL database.

So, copy the root directory, and the entire folder structure, to the directory you want.

Then, enter the database and look at the table wp_options. One of the first options should be the URL of the site. Change it to the new, appropriate, value for the site.

Once you've done that, you should be able to access the http://www.newurl.com/wp-admin page, log in, and go the Settings page and make sure everything is correct there as well.
posted by thanotopsis at 8:26 PM on October 18, 2012


You shouldn't have to mess with the WordPress database directly, if you don't want to/aren't comfortable doing so. You can go to your wp-admin and change the "WordPress Address" and "Site Address" values under Settings > General (i.e., remove the /blog or whatever subdirectory). This will break WordPress, but don't worry. You'll just need to move all your WordPress files up one level to the root and things should work again. Make sure your ftp program or web-based file manager shows you all/hidden files, as there may be a .htaccess or other config files that you'll need for everything to function normally.

You'll probably want to have archived and removed the files from your old CMS before moving WordPress in; I don't know anything about Indexhibit, though, so I can't give you specific advice about that part of your question.
posted by maniactown at 11:00 PM on October 18, 2012


How can I move my newly designed Wordpress site from a subdirectory to the root, while somehow archiving the old indexhibit version 1 site which currently dwells on the root?

So I think what you have in your root is:
    /blog/ (wordpress is in here!)
    favicon.ico
    robots.txt
    (other non cms files)
I don't know anything about Indexhibit, and unfortunately there's not much documentation on their site I can see. But I'm hoping that it can tolerate being put into a subdirectory, so here's the plan:

Step 1: Create a new directory for the indexhibit files, call it "v1", and move all the existing Indexhibit files into "v1"
    /blog/
    /v1/
        (bunch of existing files, folders for Indexhibit)
        index.php (for Indexhibit)
    favicon.ico
    robots.txt
    ...etc
Step 2: Set your wordpress like this: Giving WordPress Its Own Directory. Rename the "blog" directory to "wordpress" in the process, if you follow the instructions you should now have:
    /wordpress/
    /v1/
        (bunch of existing files, folders for Indexhibit)
        index.php (for Indexhibit)
    favicon.ico
    robots.txt
    index.php (copied from wordpress directory and edited per step 9)
    .htaccess (copied from wordpress directory)


You should be fully set up at this point. Now, if you added content files like: http://example.com/blog/uploads/2012/07/image.jpg or whatever, you'll need to edit that content to fix that. Usually all it takes is to use the Search and Replace plugin for http://example.com/blog/uploads/ and replace with http://example.com/wordpress/uploads/ and you're done.

If your theme uses such hard coded paths, then those will need to change too, but most themes are made to be flexible and be installable regardless.

I like this setup for WordPress because it can live alongside static files if it needs to, and you can easily do a complete reinstall of wordpress by renaming wordpress to wordpress_OLD and starting over. WordPress is much simpler to upgrade than it used to be, but it's still a habit I like.

Now, all that said, best practice is to download your *whole* site first to a safe place, and get database backups for whatever databases WordPress and Indexhibit use. If anything should go wrong, you want to be able to revert back to a "known good" state. Your hosting company (sometimes) can be helpful about such things if you give them warning, but typically in shared hosting environments you're on your own for a process like this.

If you have any questions about the steps, or want someone you can message while you do this so it's not so scary, feel free to MeMail me. I've done dozens of such migrations - very straightforward.
posted by artlung at 1:14 AM on October 19, 2012


Simples and as maniactown has described and you should be able to save your current CMS as Michele describes. No need to get into the database or go renaming anything.

Also, be sure to not end up with both an "index.php" and "index.html" in your home directory. This will cause problems with some configurations.
posted by humboldt32 at 1:43 AM on October 19, 2012


Thanks, everyone, especially artlung! I feel a lot more confident now. I am about to start trying, finally, and will post back here if there are any problems.
posted by betsbillabong at 1:17 PM on October 20, 2012


Success! But not without a little fear and trembling.

I had a few problems. The most important of which was, I read the instructions artlung linked to overly quickly, and was trying to edit my .htaccess file, which of course did not work. And then I started trying to do it the way that Bluehost had recommended that I do it, which was a confusing edit of .htaccess. Oddly, the server kept reverting .htaccess back to what it had been (I think perhaps Wordpress does this automatically).

Anyhow! After a MeFi inquiry from artlung as to how it was going, he gently reminded me that I was supposed to edit the index.php file and not .htaccess. Duh. So I went and did that and all seemed well.

Except for the fact that the images on my website were all broken. Actually, not the featured and slideshow and background images, but all of the others. And for that I must wholeheartedly recommend the plugin, Velvet Blues Update URLs. What a lifesaver! You simply put in your old site URL and your new one, and it searches and replaces and fixes everything for you.

Everything is working well now. Check it out! I still have some odds and ends to tidy up but I'm pretty happy with it. Thank you all so much, and thanks especially to artlung for handholding support via MeFi Mail.

http://www.betseybiggs.org
posted by betsbillabong at 6:11 PM on October 20, 2012


So glad it worked out. One last thing, you mentioned getting press - one of the things I do and advise for all my clients is to install a caching plugin - WP Super Cache is the one I use typically - easy to use and works great. Most sites don't get enough traffic to really need it, but it's a good idea if you're expecting a spike in traffic.
posted by artlung at 8:39 PM on October 21, 2012 [1 favorite]


Thanks - I had that on my list of things to do. There's still a bunch of work I need to do to make it perfect, but at least for now I feel like it's good enough. Thanks all, and especially artlung!
posted by betsbillabong at 1:03 PM on October 22, 2012 [1 favorite]


« Older My coworker is having a birthd...   |  Help me find a (cheap!) Blu-ra... Newer »
This thread is closed to new comments.