Clarity on second site

Hi

I need to set up a second … site/company … not sure what term to use. I already have my Trinity Drones site on a droplet. All is well currently running 12.26 but I have already updated my 2 other servers to 12.28 so I shall shortly update this site to 12.28 as well.
And I am wanting to run an education-erpnext on the Trinity Drones server but stil keep
them separated as far as possible. So I am considering my options…

I had a look at the diagram on the frappeframework-website …

I also did a bit of reading up on many posts …

It seems my options are …

  1. Create another company on my production-server
  2. Create another site on my production server

If I may take a moment of your time to verify that my understanding is correct …

  1. same site. New company. This implies that it uses the same database with just a
    “company name” entry into database tables that identifies for which company the
    transaction is. Any Form-customization wil lbe visible in both companies.

  2. This is multi-tenant. It creates a new site which uses its own database. ( I read this
    in another post ). It also uses its own URL. What I am not clear on is form-customizations.
    From the diagram it would seem to me that any form-customization is visible in both
    sites ?

Thanks

Update …

I found another block-diagram …

And I also found this post …

From these, it seems that , appart from the same-site-new-company and the the
same-bench-new-site approach there is also a new-bench approach.

I would still like to confirm that my interpretation is correct that , same-bench-new-site ( which is (2) above ) will have form-customizations visible in all sites ?

Hi @johnlongland,

Here’s my own point of view on this. Others’ views will vary.

1. Frappe web server Device/Host

  • A device containing 1 (or more) Instances of Frappe/ERPNext.
  • This device could be a metal box, a VPS, a Docker container, etc.
  • (Optional) MariaDB server. By default, MariaDB is installed on the same Device/Host. But doesn’t have to be.
  • (Optional) Redis server. By default, Redis server is installed on the same Device/Host. But does not have to be.

2. Instance

An isolated installation of Frappe + ERPNext on a Device/Host.

  • Has a root directory containing subdirectories “apps” and “sites” (and more)
  • Has a background service running gunicorn that targets these directories.

NOTE: The “code” that defines an Instance is contained in the “apps” subdirectory.

  • There are standard Apps (Frappe, ERPNext).
  • There are 3rd party Apps (e.g. POSAwesome)
  • In either case, they “may” (or may not) be modified/forked/edited, in which case they will differ from the official code published by the original authors.

(Note that I am deliberately avoiding using the word “customize”, because that has very specific meaning to Frappe/ERPNext)

Q: Can you install more than 1 Instance per Device/Host?
A: Yes, by installing Frappe/ERPNext again, but using a different base/root directory. So that all the files are stored in completely separate directory path on the device.

3. Site

Within an Instance, a distinct subdirectory beneath the 'sites' subdirectory.

  • Has a distinct MariaDB database (and therefore, a distinct set of all SQL tables)
    • 1 Site = 1 Database.
    • 1 Database = 1 Site.
  • A distinct set of Users with password.
  • Each Site decides to use 1-or-more Apps.

Q: Do all Sites in an Instance share the same Apps?
A: No, not necessarily! Each Site can decide which of the available Apps to use.

  • Sites can Customize their installed Apps. These Customizations are stored inside the MariaDB database associated with the Site. Therefore, a Customization is --not-- shared between Sites.

Q: Does 1 Site = 1 legal entity? Company? Business? Organization?
A : That is up to you to decide. There are no rules about what a Site is/isn’t. Treat it however you want.

4. Company

The “Company” is an ERPNext-specific DocType. It is used for:

  1. Establishing default values (e.g. currency, default GL accounts, default Letter Head)
  2. A lightweight way of separating/categorizing -some- (but not all !) Documents. Example:
    • Purchase Order and Sales Orders have a 'Company'
    • Customers, Suppliers, and Items do not.
    • Users do not.
    • Roles and Permissions do not.

So what does Company “mean” … ?

…that’s really up to you. It’s a kind of a semi-global filter in ERPNext. Useful for reporting. Useful for having different default values, per Company. But not particularly strict. Companies are sharing data (customers, suppliers, items, and much more). And there’s no limits on what Users can “see/do”, based on Company.

Conclusion

Hopefully this provides enough information/context for you to make your decisions, @johnlongland.

8 Likes

Thank you once again for this info @brian_pond !!

I can see where I “missed the boat” with my interpretations.

This one had me sitting up straight…

I understand this as well now …

While reading through all this, I already have some more questions…
around nginx / letsencrypt … But let me first dig around on that and build my own picture
and then verify if I am correct / close.

But it seesm that there is only one way for me … lucky I have a test-server / play-server
that I can polish the procedure before implementing it on my production server.

I am not going to mark the thread with “solution” yet. I would like it to remain open
for now, just so that I can still add some input / comments.

Much appreciated @brian_pond

1 Like

if the requirement is above, you have 2 options:

  1. Create another site, using multi tenant options. I would prefer this options if you still want to use the same version with other sites in the same bench.
  2. Create another bench, so that you can have different versions of sites in the same server.
    Like @brian_pond said, it can have different set of apps applied to each site.

For nginx/letsencrypt settings, I would use certbot rather than other tool. Find it more from: [Tutorial] Install v13 Production on Debian 10 VPS - Using “Easy Install” script - Now includes setting up SSL certificate!

BTW I like and subscribed Trinity Drones channels, please them keep going.

1 Like

Thank you @AbdalAliy for taking the time to assist.

In my case the creation of another site would seem to be sufficient, but it is certainly
an interesting option that @brian_pond put on the table.

Thank you again for your time.

Update…

On one of my previous posts, I made a comment that I just want to consider
lets-encrypt on a multi-tenant system, but I was overthinking things.

a Lets-encrypt certificate is linked to a particular URL (site) so if I add anothe rsite,
lets-encrypt will ask me which site I want to encrypt. So …worries.

Just for reference I am adding a link to another post …