Add domain vs. domain name for site

What are the advantage/disanvantage of:

  • using non-domain name when creating new site and then add domain for it (e.g site1.myerp.com for site1.local)
  • using domain name for creating site (e.g directly name the site with site1.myerp.com)

especially in relation to:

  • multitenants
  • portability (changing server, bench, domain, backup/restore, etc),
  • seting up ssl and nginx,
  • other related things I have not known yet.

Thank you

In my case, I always use the domain name when creating site.

When I need to change the domain name (internet), I use the bash mv command to rename the site to the new domain name.

certbot --nginx lets you choose which domain you want to place a certificate.

Regarding multi-tenants:

For totally unrelated Companies with different application domains - meaning you expect to introduce custom apps, it is good to give each Company its own frappe-bench (bench init [domain-name]). You may install the apps (ERPNext and other custom apps) that the company would need.

This will allow you to customize individual companies without worrying how your customization may affect other companies.

Also, in case something goes wrong in one (renamed) frappe-bench directory, this issue will not affect other frappe-bench directories.

The disadvantage is, you have to do bench update on every frappe-bench directories.
But this could also be an advantage because you may have separate trial production frappe-bench directory where you test the bench update to check for issues, before you do the bench update command on production sites.

Thank you @Joseph_Marie_Alba1 for your input.
I usually do the same for simplicity. But I read in the discuss (if I’m not mistaken it was @bkm) he prefers to use add-domain because it will be easier to reroute if there is change in ip/domain.

Good to know this. I was thinking that changing the site name alone will raise problems for the site to reload. How about the sitename in the database (I don’t know if there is any)?

Honestly, I don’t know this.

I don’t like add-domain because I think you have to mess around with the /etc/hosts file.

I was a bit of a chicken and put a symbolic link in the sites folder. This appears to have been successful and allows IP or DNS name.