$conf, $runtime; function_exists('chdir') AND chdir(APP_PATH); $r = 'mysql' == $conf['cache']['type'] ? website_set('runtime', $runtime) : cache_set('runtime', $runtime); } function runtime_truncate() { global $conf; 'mysql' == $conf['cache']['type'] ? website_set('runtime', '') : cache_delete('runtime'); } register_shutdown_function('runtime_save'); ?>installation - After moving wordpress some files still point to old directory|Programmer puzzle solving
最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

installation - After moving wordpress some files still point to old directory

matteradmin9PV0评论

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

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

Share Improve this question asked Feb 7, 2014 at 15:20 Lisandro VaccaroLisandro Vaccaro 9954 gold badges12 silver badges28 bronze badges
Add a comment  | 

2 Answers 2

Reset to default 1

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

You can leave all your files in /wordpress/ and simply make WordPress appear to be in root. See http://codex.wordpress/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.

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/whatever', 'http://www.newdomain');
update wp_posts set guid = replace(guid,'http://dev.old-domain/whatever', 'http://www.newdomain');
update wp_options set option_value = replace(option_value,'http://dev.old-domain/whatever', 'http://www.newdomain');
update wp_comments set comment_author_url = replace(comment_author_url,'http://dev.old-domain/whatever', 'http://www.newdomain');
update wp_comments set comment_content = replace(comment_content,'http://dev.old-domain/whatever', 'http://www.newdomain');
update wp_links set link_url = replace(link_url,'http://dev.old-domain/whatever', 'http://www.newdomain');
update wp_postmeta set meta_value = replace(meta_value,'http://dev.old-domain/whatever', 'http://www.newdomain');
update wp_usermeta set meta_value = replace(meta_value,'http://dev.old-domain/whatever', 'http://www.newdomain');
update wp_commentmeta set meta_value = replace(meta_value,'http://dev.old-domain/whatever', 'http://www.newdomain');

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.

Post a comment

comment list (0)

  1. No comments so far