Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

connect tp another database


Reply

3 Posts   1137 Views

Avatar
Mgc

18 December 2009 at 7:22am Community Member, 23 Posts

I have a bit of a problem. Here is the issue I have multiple instances of ss running in a MySQL database all sites have pages that have the same content.

Currently we have to input the same content over and over again. I think there as to be a better way.

Here is what i am thinking: Is it possible to create a database in the same server where these sites could get the data from but still have their ss instance to put the content that is not shared? Id so, how would i do this?

Any help would be greatly appreciated.

Avatar
yurigoul

18 December 2009 at 10:44am Community Member, 202 Posts

I believe I just did that by accident while testing on my computer because copied my config to that site. The database + login + connection you are using is in your $databaseConfig in mysite/_config.php.

But in order to access the data on all sites and display the data on all your sites you need to have the same fields in your page.php->getcmsfields and you need to have to use the same variables in your page.ss for all your sites.

Your images in the upload folder ... symbolic link?

Avatar
Mgc

19 December 2009 at 4:32am Community Member, 23 Posts

Yes, essentially i have created page types that hold the shared data and all have the same fields.

Currently the only solution i have found is to export the tables from the global database and import them into the new sites. However as you can see this is not the ideal way of doing.

I would like that the new sites we build get the shared information from the global database, this way when we make updates to the global database the changes reflect on all sites.

My knowledge of php and mysql is limited so i am looking to see if it is even possible to do this in silverstripe.