News:

Wondering if this will always be free?  See why free is better.

Main Menu

Running multiple forums on one install?

Started by ghulst, May 27, 2024, 12:12:26 PM

Previous topic - Next topic

ghulst

I am currently running four forums. They are evenly spread with two on SMF and two on phpBB. However, updating always is a hassle. I would like to have one core system that then runs all four forums with the same extensions etc.
This is the situation:
- I have four completely separate forums
- The forums have separate URL's
- I can host them on a fifth URL
- I would need some sort of redirects to make sure everything stays findable

Those are my first thoughts.

Would this be possible? And how would you go about it?

Kindred

there was a multi-site mod/plugin for SMF 2.0.x that allows you to run one installation across multiple domains.

I don't believe that it was updated for 2.1.x
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

shawnb61

My sense is that whatever scheme you come up with will, itself, need maintenance.  And you will have a very custom set of installs, possibly harder to diagnose issues.  It's just a question of whether or not it ends up saving some labor in the long run. 

My thoughts would be to just live with it.

But if I absolutely HAD to...

You can share a DB by having the different SMF installs use different prefixes.

Regarding the filesystems, note that there are lots of relative paths used throughout, so, SMF looks for lots of files relative to where Settings.php is found.  This is the problem - because you need a unique Settings.php per forum. 

This is completely unproven, but it may be feasible to take all common folders you want shared (e.g., Sources, Themes, Smileys, Avatars - but NOT attachments & custom_avatars...) and make one set a set of symbolic links to the other.  In theory, updating one would automatically update both.  I worked in a unix(-snob, yes...) environment, and we absolutely forbade folks from installing the same biz app multiple times.  EVERYTHING was supported off of a single install & symbolic links, so we KNEW everyone was running the same build & patches, etc.  So yes, it's feasible. 

There would be limitations, e.g., wherever paths/settings are stored in the DB, you'd have to consider how those settings are propagated - I'm thinking in particular here for new mods & themes.  You'd have to develop a regimen to deal with that (the simplest being no new mods/themes).  And test a lot.

But high risk for small reward, imho.  You'd spend at least as much time building & maintaining this as just applying the patches.
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

ghulst

Yes, I would not want to get a bespoke build, as that would cause even more headaches. "Living with it" does include a lot of work that would be unnecessary if a multisite platform would exist. A couple of years ago we created a multisite environment for websites from 120 countries running on Drupal and when you wanted to update that, you would only have to update the core, as all features would be available across all of the sites. Now, I need to update from 2.0.19 to 2.1.4 and that means tracking all my packages and reinstalling them as well. That is a lot of hassle.

Antechinus

To add to my thoughts elsewhere: really, even if you were determined to do this, it would make sense to not try to mix two different forum apps. It would be better to convert all forums to one or the other, for the sake of sanity. Which one? Up to you. Both have their pros and cons. Nobody ever maintains their converters anyway, so it's a bunfight however you do it. But trying to run both-as-one would be bonkers, IMO.

Changing major versions of SMF is a nuisance, yes. Update patches within major versions (which are stable for years) are a no-brainer.

ghulst

For me, the start would be to move all the forums to one system. That is also why I am asking the question before I start that process. If I have to convert them anyway, I might want to convert them to a system that allows multisite in some way.

And yes, major version updates are more work. Not insurmountable, but I now have two different systems that all have their own extensions/mods/plugins/themes etc. So, standardization is going to make that much easier. That is something that I would like to do, but if a multisite option would be available, it would be great to move that way while on it.

shawnb61

Are you going to use common mods/themes across the forums?  Or will they continue to have their own?
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

shawnb61

#7
One more question: What is taking time?  Mod installs take only a couple minutes.  Theme installs take only a couple minutes.  Patches are very brief.  Major upgrades can be a pain, but mainly if you have a lot of customizations.  Do you make a lot of source code & theme edits by hand? 



I'm not feeling well, so stayed home today, with some time to kill.  I tried the symbolic link approach above, and was fairly surprised how well it worked out.

My setup:
- One install; made all settings changes I wanted to make
- Installed any mods I wanted to be global
- Made four copies of the SMF tables in the same DB, each set with a unique prefix
- Copied the forum install 4x, in parallel folders
- Ran repair_settings.php on each of the 4 so they operated independently, each using its local folders/links  (and unique cookies)
- Deleted the avatars, Smileys, Sources & Themes folders from the 3 copies
- Created hard symbolic links for those folders all pointing to the original forum

Results:
- Installing new hooks-only mods works perfectly on the forum(s) they were installed on, and are not visible on the others.  So each forum can be pretty unique & have its own set of mods - even while sharing a common Sources folder.
- Installing languages on any one forum resulted in them being available to all.
- Installing themes was easy also.  First install from the package, subsequent installs on other forums use the "From a directory on the server" method.

Lessons:
- Patches.  SMF patches installed fine, however, SMF 2.1.x  requires a match between the source code & the DB settings value for smfVersion, so I had to update it by hand on the other 3 forums.  Not a big deal, just wrote a 3 line script...
- Root folder files (cron.php, proxy.php, index.php, agreements.txt, etc.) also need an approach.  Either more symbolic links, or just copy them over after applying patches. 

So it's doable.

If I had 10+ forums, I would definitely do this.  The real challenges would be the pacman operations, e.g., non-hooks-only mods.  De-installs of mods/themes would require forethought, & careful attention to sequence of deinstall.  Still, those are solveable concerns. 

Biggest surprise?  Win10+ has hard & soft symbolic links.  I did all this config & testing on my Win10 PC. 
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

Sir Osis of Liver

IIRC, at least one of the free SMF hosts runs multiple forums on one database, with all forums sharing settings and several other tables.  A forum I worked on some years back was moving off free host to paid host and was charged $50 for database dump.  It was missing a dozen tables, apparently because they were shared by all forums and had different prefix.  He was only given tables that were unique to his forum.  Was a pia to fix it.


Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

vbgamer45

Yup, I run those free hosts. And some database tables are shared so they are not included or sensitive data.
Basically, I do the same what Shawn has done, in way one set of files, A unique settings.php file, unique folders for attachments, avatars.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Antechinus

Quote from: Sir Osis of Liver on May 28, 2024, 05:12:49 PMIIRC, at least one of the free SMF hosts runs multiple forums on one database, with all forums sharing settings and several other tables.  A forum I worked on some years back was moving off free host to paid host and was charged $50 for database dump.  It was missing a dozen tables, apparently because they were shared by all forums and had different prefix.  He was only given tables that were unique to his forum.  Was a pia to fix it.

Yup, I did the same thing for someone years ago. TBH I should have documented the fixing process (which IIRC was not all that bad) but at the time it didn't occur to me that anyone else would be bonkers enough to do it.

And charging for a custom db dump from a free host is fair enough, IMO. It's not part of their terms of service, and they have been hosting you for free, so shouting them a few cases of beer is reasonable.

ghulst

Quote from: shawnb61 on May 28, 2024, 03:48:41 PMI'm not feeling well, so stayed home today, with some time to kill.  I tried the symbolic link approach above, and was fairly surprised how well it worked out.

Sorry to hear that. Hope you're feeling better. This is a very interesting result. Which would mean that it would not be all that hard to pull off. Right? Not that I am able to write those three lines of code, so that would make that difficult for me. But at least it does not look as undoable as it seemed. I mean, if Win10 can do it...  :P  :-X (Just kidding) But that does look like an interesting test.

What takes time? Well, mainly the processes. In the end, it is always easier to update 4 forums in one go than do them separately. I would move them all to run the same software and use the same mods. Standardization is easy in this case as you only add the things that are needed. Easier to keep track of as well.

shawnb61

Quote from: ghulst on May 29, 2024, 11:05:05 AMWhich would mean that it would not be all that hard to pull off. Right? Not that I am able to write those three lines of code, so that would make that difficult for me.

The problem here is that doing the type of stuff I did, even just to get the 4 forums into the same DB, took some knowledge of SQL & databases, a code editor, etc., etc.  Any solution here would require these skills.

I see two options:

1)  Merge the 4 into one SMF install.  Keep the users/boards/categories separate by membergroups.  The mergeSMF utility has been upgraded to run in 2.1:
https://www.simplemachines.org/community/index.php?topic=575102.0
https://www.simplemachines.org/community/index.php?msg=4164429

They can each have their own look & feel because boards can have their own themes specified. 

The benefits of this solution include the easiest maintenance and the least putzing with code & mods over time - after the initial setup.  The downside is that they are all the same forum, same url, etc. 

2) My solution noted above, using symbolic links.  But this requires pretty decent unix & DB skills.  I'm not even sure if any shared hosts allow creation of symbolic links...  So further research & experimentation are necessary.  If links are allowed, I would test the heck out of it & come up with a regimen for mods. 

[If it were me, I'd actually use two packages for each selected mod...  One, as downloaded, that does all file changes/db changes/hooks (for the "main" forum).  The second would be a copy that has all file changes (file ops, requires...) removed from package-info.xml (for the "siblings").]

The benefits of this approach include the broadest configurability for the 4 distinct forums.  Each has their own URLs, etc.  Each has their own settings.  Each can have their own themes.  The downside is there is work to do.  And a lot of testing.

Either way, I'd plan on building a test environment & spending weeks/months testing it all out. 
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

Advertisement: