Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-08-22 02:31:17

progre55
Member
Registered: 2006-05-02
Posts: 668

Can two different TXP Sites share same database content?

I have looked at the FAQ on the topic Can Textpattern share a database? but I do not think in this addresses sharing the same content.

I am trying to set up two seperate domains (same client), each having their own TXP installs, but they would both be using the same database to store their information. All information (ie articles/images) would be available for each site.

The reason for the above is that I want the client only to have to input information once, even if that same information is going to be used on several different domains.

Any guidance,feedback, suggestions would be appreciated.

progre55

Offline

#2 2007-08-22 06:42:59

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,090
Website GitHub Mastodon Twitter

Re: Can two different TXP Sites share same database content?

Textdrive offers multiple domain pointing which means that you can have many addresses pointing to the ame db etc

These belong to a friend of mine

is this what you are trying to achieve?


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#3 2007-08-22 11:49:26

progre55
Member
Registered: 2006-05-02
Posts: 668

Re: Can two different TXP Sites share same database content?

Colak:

Not exactly. In your case you have two domains pointing at one location.

What I want to achieve is two, totally different sites (look/feel) but they happen to share commen information (articles and images)

Any guidance would be appreciated.

Thanks.

progre55

Offline

#4 2007-08-22 11:56:14

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Can two different TXP Sites share same database content?

If both domains can share a single database and if you can sym/hardlink to the other domain’s images directory, that is possible, otherwise you’ll have to manually synchronize the databases and images on each website update.
But, while you may want to share articles and images (and sections, categories, users, etc), the preferences for both websites are probably different (at the very least the domain name stored in the preferences). This means that while you may want to share some TXP tables, you want to keep other tables separate for each domain. The only way to do that is hardlinking the shared MySQL table files (very dirty and may not survive backup/restore) or hack the TXP code (lib/txplib_db.php) to use a different prefix for the shared tables (less dirty).

Offline

#5 2007-08-22 12:07:53

progre55
Member
Registered: 2006-05-02
Posts: 668

Re: Can two different TXP Sites share same database content?

Rudd:

Thanks for the reply.

If both domains can share a single database and if you can sym/hardlink to the other domain’s images directory, that is possible

So far so good – they will be on the same server so I should be able to swing this …. I think ….

But, while you may want to share articles and images (and sections, categories, users, etc), the preferences for both websites are probably different (at the very least the domain name stored in the preferences).

The only difference I would need inthis case is the domain name

or hack the TXP code (lib/txplib_db.php) to use a different prefix for the shared tables (less dirty)

How tough a hack for a simpleton like myself?

Thanks for the guidance.

progre55

Offline

#6 2007-08-22 12:17:57

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,330
Website Mastodon

Re: Can two different TXP Sites share same database content?

Chris Casciano has a good writeup on that subject here, and he even runs a mod.

Offline

#7 2007-08-22 12:20:30

progre55
Member
Registered: 2006-05-02
Posts: 668

Re: Can two different TXP Sites share same database content?

Wet:

Thanks. I saw that briefly last night. I also noticed it was somewhat dated. Does it work with the same for the new version?

Thanks.

progre55

Offline

#8 2007-08-22 12:25:34

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,330
Website Mastodon

Re: Can two different TXP Sites share same database content?

we haven’t added any new tables in the 4.0 branch since, so Chris’ basic assumptions are very probably still true.

Offline

#9 2007-08-22 12:40:18

progre55
Member
Registered: 2006-05-02
Posts: 668

Re: Can two different TXP Sites share same database content?

Wet.

Thanks.

I will most likely be taking a crack at this in the not so distant future, so I may need to add to the post. :)

Thanks again to all.

progre55

Offline

#10 2007-08-22 13:06:54

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,726
Website

Re: Can two different TXP Sites share same database content?

Would ied_if_domain possibly be of help here? I’ve not tried it but I imagine you could use it to change the appearance or even structure of two different domains but sourcing the same documents.


TXP Builders – finely-crafted code, design and txp

Offline

Board footer

Powered by FluxBB