Jump to:

23483 Posts in 18976 Topics by 2878 members

General Questions

SilverStripe Forums » General Questions » connect tp another database

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

Page: 1
Go to End
Author Topic: 1129 Views
  • Mgc
    Avatar
    Community Member
    23 Posts

    connect tp another database Link to this post

    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.

  • yurigoul
    Avatar
    Community Member
    202 Posts

    Re: connect tp another database Link to this post

    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?

  • Mgc
    Avatar
    Community Member
    23 Posts

    Re: connect tp another database Link to this post

    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.

    1129 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.