• I have a wordpress site, and want to built a new one. I want a second install of wp in a location eg https://www.mysite.com/new which is linked to the same database. so When I’m testing it I can see all the pre existing posts. Also if I edit those posts it edits on both sites. Can someone tell me how to do this please? thanks.

Viewing 7 replies - 1 through 7 (of 7 total)
  • I can’t see how this would be possible, without modifying WordPress php code extensively.

    Because the test system’s folder will be different, so you cannot share the wp_options database table, which must specify your WordPress folder.

    Thread Starter zefdesign

    (@zefdesign)

    Hmm ok. what is the best way of having a test site then? just making another then importing and exporting db?

    I wanted to avoid that because I didnt know if it was posible to import specific posts from db.

    My favourite way to make test sites, be they WordPress or other things like phpBB, is to copy all the files and the database to an “as isolated as I can make it” “as identical as I can make it” Test Environment. Quite frankly, your desire to have “write access” from your test system to your production system puzzles me. And sounds like a disaster waiting to happen. But, what do I know? I started in the days of punch cards.

    But I do understand your desire to keep your Test Environment up to date with your Production Environment. I do that by periodically updating the database in the Test Environment.

    For an extended discussion of Test Environments “going on right now”, please see https://www.ads-software.com/support/topic/328067?replies=9

    Thread Starter zefdesign

    (@zefdesign)

    Thanks that was helpful. The reason is the new site I am building will have new categories and custom fields to make it functional. Therefore once they are added i’ll need to update the new website with them, without losing new posts.

    Thread Starter zefdesign

    (@zefdesign)

    Anyone got any other ideas?

    “I didnt know if it was posible to import specific posts from db.”
    Well, you can certainly do that. Export from one WordPress installation and Import on the other. But the tricky part is in between those two steps, when you have to edit the Exported file, to get rid of all the posts except the few you want to import. Which means you have to understand the format of the Export/Import file.

    This is better than doing a Database backup (SQL statements) and finding the new posts. I’ve never checked it out, but WordPress may keep associated information elsewhere (in other tables besides the Posts table). Import takes care of this for you.

    Thread Starter zefdesign

    (@zefdesign)

    Right. That means what I plan should be possible…

    I want to complete the new website and edit some of the pre existing posts. then import all of that to the currently running site without losing new posts.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Test wp site displays posts from current site (same db)’ is closed to new replies.