3

I moved my wordpress installation from:

/wordpress

to

/html/website

The process was extremely traumatic and even though I followed the instructions closely the site went down a few minutes, after trying everything to get it back up I got to the point that the site works but I cannot remove the old directory since some files seem to still be pointing to it. If I change it's name to /wordpress2 to see if my website still has dependencies in it I get the error message:

Warning: require_once(/home/content/77/11193277/html/wordpress/wp-includes/pomo/translations.php) [function.require-once]: failed to open stream: No such file or directory in /home/content/77/11192277/html/wordpress/wp-includes/pomo/mo.php on line 10

Showing it's still pointing to it, how can I fix it? I want to remove the old folder

1

Did you follow these docs?: http://codex.wordpress.org/Moving_WordPress

You can leave all your files in /wordpress/ and simply make WordPress appear to be in root. See http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory#Using_a_pre-existing_subdirectory_install

If /html/website is really web root, you don't use that string in any configurations, you use mydomain.com.

  • Yes I followed those docs. The web root is /, the wordpress installation is in html/website, I had to copy index.php and .htaccess to the root and point to it. However for some reason that wordpress installation points to the other one. – Lisandro Vaccaro Feb 7 '14 at 15:37
  • Read the link I posted about Using a preexisting subdirectory install. – markratledge Feb 7 '14 at 15:39
1

First, this kind of things should be done by developers. So I strongly suggest you that if maybe you're not planning to be a dev (aka studying), then just hire a dev. Sometimes the web is not free at all ;)

That said, per se, to move a wp website it's not that difficult task. First, always make a bakup of both files and database. In fact, I usually maintain 2 versions of my projects: the 'staging' one and the 'production' one, each with its own DB. Hopefully, you should also version control both versions with GIT or the like.

Then, when you're moving your website, just make a query of this kind:

update wp_posts set post_content = replace(post_content,'http://dev.old-domain.com/whatever', 'http://www.newdomain.com');
update wp_posts set guid = replace(guid,'http://dev.old-domain.com/whatever', 'http://www.newdomain.com');
update wp_options set option_value = replace(option_value,'http://dev.old-domain.com/whatever', 'http://www.newdomain.com');
update wp_comments set comment_author_url = replace(comment_author_url,'http://dev.old-domain.com/whatever', 'http://www.newdomain.com');
update wp_comments set comment_content = replace(comment_content,'http://dev.old-domain.com/whatever', 'http://www.newdomain.com');
update wp_links set link_url = replace(link_url,'http://dev.old-domain.com/whatever', 'http://www.newdomain.com');
update wp_postmeta set meta_value = replace(meta_value,'http://dev.old-domain.com/whatever', 'http://www.newdomain.com');
update wp_usermeta set meta_value = replace(meta_value,'http://dev.old-domain.com/whatever', 'http://www.newdomain.com');
update wp_commentmeta set meta_value = replace(meta_value,'http://dev.old-domain.com/whatever', 'http://www.newdomain.com');

Sometimes you'll need to add some table (you'll know because of errors coming out, or just inspecting your original db).

Then (or before), move the files. Be sure to also move the .htaccess file if present (if you're using permalinks, you've got one), and maybe do a rapid check of its contents.

Then (or before), edit the wp-config.php file with the new settings, if needed.

That's all.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.