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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

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

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

connect tp another database


Go to End


3 Posts   1981 Views

Avatar
Mgc

Community Member, 23 Posts

18 December 2009 at 7:22am

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

Community Member, 203 Posts

18 December 2009 at 10:44am

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

Community Member, 23 Posts

19 December 2009 at 4:32am

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.