You are here:  » Using the database of another site

Support Forum



Using the database of another site

Submitted by mally on Wed, 2009-01-07 18:34 in

Hello David.

I'm wondering if I could have your suggestions on the following.

I would like to run a number of sites but using the same data, well almost.

I have one main site. I have decided to try and run a second site with the data from one of the categories from the main site.

I have a problem with my hosting company as this will not allow me to share the data using the searchExternal.php mod on another thread.

Can you give me any advice or suggestions.

In a perfect world I think I would like the use the complete database in the main site and filters, but then adding some new filters at the end.

Hope this makes some sense

Cheers

Mally

Submitted by support on Wed, 2009-01-07 19:45

Hi Mally,

Quite a few users do something similar - they run one master Price Tapestry installation (sometimes on a non-public folder / sub-domain) and then run several niche sites all pointing at the same database. This means you only have to manage feeds in one place, and then you apply the filtering at run-time within the separate installations.

As long as you are on the same server, you should just be able to create an installation with the same database settings in config.php - and that's it. You won't need to upload any feeds or do anything in the /admin/ folder.

With the initial site working; most of the filtering is a case of adding "WHERE category=''" to the main SQL statements in search.php; but it's a little more involved than that. Once you have a sub installation working; let me know what run-time filtering you want to apply and i'll let you know where best to add the restrictive WHERE clauses...

Cheers,
David.

Submitted by Paul1107 on Thu, 2009-01-08 19:25

Hi David,

This is something that I have to do. but...

1. can I migrate my existing PT install which is located in a /Store/ directory of an existing wordpress site to another subdomain as you suggested, and what impact might that have re potential 404 errors etc...

2. How will that affect my current site and the use of the searchExternal.php file, which has been modified by you for use in my wordpress blog

3. What other things do I need flagged in order to do this

4. What would be the easiest way to achieve this?

Sorry for such a long winded question,

Regards

Paul

Submitted by support on Fri, 2009-01-09 09:25

Hi Paul,

You should be able to move the installation no problem at all - just make sure that $config_baseHREF is updated to reflect the new location; as well as RewriteBase within .htaccess if you use rewrite.

With regards to your current site and the code that calls searchExternal.php; this will also have to be updated to contain the new values of...

  $common_baseHREF = "http://www.example.com/pricetapestry/";
  $common_path = "/path/to/pricetapestry/";

(as before, you can use whereami.php to establish the correct $common_path if you're not sure)

Otherwise, that should be all there is to it...

Cheers,
David.

Submitted by Paul1107 on Fri, 2009-01-09 17:36

Thanks David,

I'll plan to do that once you're back from holiday, just incase...

However, If I set up another separate pt installation to be shared between a couple of sites would I just install it on any old domain? and if so should the config_baseHREF be the domain? location eg: http://www.mydomain/priceTapestry/?

regards

Paul

Submitted by support on Mon, 2009-01-19 08:30

Hi Paul,

When installing the script for use by other sites, $config_baseHREF should still be correct for where you are installing it - as if it was going to be a standalone installation.

Cheers,
David.