$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'); ?>customization - Creating a WP Test site without uploads etc|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)

customization - Creating a WP Test site without uploads etc

matteradmin7PV0评论

I would like to create a test site for a huge wordpress live site (a news site). It has tons of images in /wp-content/uploads and /wp-content/gallery, and other folders of /wp-content are also packed with stuff, so duplicating all that takes a very very long time.

How can I setup a test site by copying the live site without the /wp-content folder but just linking to it somehow? Nothing needs to be changed or uploaded in /wp-content, just to see and read.

Thanks!

I would like to create a test site for a huge wordpress live site (a news site). It has tons of images in /wp-content/uploads and /wp-content/gallery, and other folders of /wp-content are also packed with stuff, so duplicating all that takes a very very long time.

How can I setup a test site by copying the live site without the /wp-content folder but just linking to it somehow? Nothing needs to be changed or uploaded in /wp-content, just to see and read.

Thanks!

Share Improve this question asked Feb 15, 2019 at 9:05 Mister WoyngMister Woyng 1114 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

Create a hard or symbolic link. However, you would of course need to take care that testing doesn't affect the contents of wp-content.

Another approach would be to put wp-content (or a copy) into its own file system partition (or just make a .img file from it). Then dd (or its Windows analog) should duplicate it fairly quickly.

As an aside, its worth asking if you really need a complete copy of the large set of files in wp-content. Unless you're doing performance testing, perhaps a well-chosen subset would suffice.

added:
One thing to check is whether anything important behaves differently with a symbolic link. The one case that comes to mind is recursive deletion of the test directory tree. IIRC it will detect the existence of the symlink and delete it but not recurse into it, avoiding unintentional deletion of part of the production set-up. So here the difference is actually a good thing. (But I'd double-check the correctness of this.) (This might also be a reason to do a soft (symbolic) link instead of a hard link.)

Post a comment

comment list (0)

  1. No comments so far