Your software
My Mautic version is: 4
My PHP version is: 8
My Database type and version is:
Your problem
My problem is: How can we configure the Mautic application asset directory to support multi-tenant support? For example: Tenant1 & Tenant2 are hosted on the same codebase but with different database architecture, in this case, how do we differentiate the asset sharing among those two tenants? When Tenant1 uploads any files they should be uploaded to the Tenant1 directory and the same for Tenant2. How can we achieve this?
Sharing the same folders while using different databases - it a supported setup that I’ve heard of, but let’s see: Surely you must be some sort of symlinking or other magic (for config, cache,…), right?
Did you not try using the same for assets?
Can you tell us about your setup in general? (Also: what’s the point in using a shared code approach, in your case?)
Our Infra setup is like this: We have a single codebase and multiple databases for each client.
Depending on the domain request from each client we will be switching/redirecting them to the respective database. This we have achieved with the reference from here: Implement Multi-tenancy In Mautic | Marketing Automation Solution
As we can see in the above code they are checking the domain request and based on that setting $local_config to map to that.
But I’m wondering how we configure the assets folder for every tenant differently in this way. What should be the path/config we have to alter it programmatically so that it will switch accordingly. It would be helpful if you can share some information on the same.
Thanks in Advance!
It is not mentioned in that “tutorial” but clearly you will want to define distinct folders e.g. for logs and caching via Configuration → System Settings
and just the same for Assets via Configuration → Asset Settings
Again, I never saw or tried this, I’m just giving my best guess.
But please keep us updated!