wordpress: 2 blogs using the same db *and* the same content
June 25, 2010 6:03 PM   Subscribe

Is this nuts? I want to have 2 installations of (self-hosted) wordpress which both show the same content - therefore use the same db.

I have a blog with a lot of content in it. I want to create a second blog which is essentially a distillation of the first blog and shows a quick snippet of posts and then links to the first blog. (Insert boring reason why here.)

The way I want to do this is to setup a second blog and then modify DB_NAME in wp-config.php to point to the db of the first blog. I'd never modify content from the second blog - that install would be for display only.

Is this crazy? Am I going to bork the db of the first blog? Am I missing something completely obvious?

The 'share a wp database' googling I've done finds solutions for hosting 2 different blogs with different content in a single database. This is different, and I'm not having good luck finding any helpful information.

Help me hivemind :)

Thank you.
posted by thatone to Computers & Internet (10 answers total)
Response by poster: Adding: the database user for the second blog would have limited privileges...
posted by thatone at 6:18 PM on June 25, 2010

I assume theres some reason you can't just make a new page in the 'main' blog that gives this condensed display?
posted by jjb at 6:24 PM on June 25, 2010

Response by poster: jjb, Yes, that would be the easy answer for sure.
posted by thatone at 6:24 PM on June 25, 2010

I can't come up with anything fundamentally wrong with the idea. If you think about it, the database is already handling multiple concurrent copies of wordpress accessing the data even if you have only one install -- consider what happens when two people hit the blog at the same time or nearly the same time. That's two separate instances of the PHP interpreter running simultaneously, each connected to the database and executing queries simultaneously. All the locking and integrity type stuff (ACID) to make that work has to be right for the case of a single installation of WP, so I don't see how two copies is really any different.

If you want to sleep better at night make a full backup dump of the DB (using phpMyAdmin or mysqldump) before starting and at regular intervals, but you should be doing that anyway regardless.
posted by Rhomboid at 7:17 PM on June 25, 2010

thatone, I don't know if it's important for you, but it may create a problem from the SEO standpoint: Google doesn't like different websites with identical content, and may ding you out of it search results. Something to keep in mind...
posted by cst at 7:28 PM on June 25, 2010

I've done this before. It works fine. Any given WP installation doesn't care what DB it's pointed to, so long as the dbname/hostname/username/password are correct.

The only even remotely tricky bit is that you can't do this as a regular installation. With a regular install from scratch, WP goes into the database and creates all those lovely tables. If you try to do a regular install with an existing database, it will crap out with a "this blog already exists" error.

(Such was the case when I did this a few years ago, anyway - the newer versions may let you proceed. It's worth a try.)

When I did this, I just used a two-step process. First I installed WP on a fresh (throw-away) database just as I usually would. Then I manually edited the wp_config file to point to the database I wanted it to use.
posted by ErikaB at 7:32 PM on June 25, 2010

Why not scrape the feed from the first blog into the second? I'm sure you could set the feed (or a seperate feed you make just for this) that would take an excerpt and then throw a link to the original article at the end. I've seen it done for evil enough, might as well get some good out of the technology.
posted by theichibun at 7:46 PM on June 25, 2010

Best answer: The part you are missing is that the options table has the blog url and the home values. These can only be one thing, not two. So it can serve to one url, not two.

I'd look at using a plugin such as Feedwordpress.
posted by markx2 at 3:17 AM on June 26, 2010

What, ideally, would the urls be for this?


or two completely different domains? or what?

and do you want completely different looks?
posted by artlung at 6:10 AM on June 26, 2010

Response by poster: Thank you markx2 - I was afraid of that.

Thanks for your help everyone!
posted by thatone at 9:21 AM on June 28, 2010

« Older Upgrading my name   |   Wait, what? Newer »
This thread is closed to new comments.