After moving wordpress some files still point to old directory

I moved my wordpress installation from:

/wordpress

Read More

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

Related posts

2 comments

  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.

Comments are closed.