I’ve installed ERPNext a while ago with the “easy install” script, its in production mode.
For some testing purposes I would like to install a development version of ERPNext as well, next to the already existing production version.
If I’ve understood correctly I have to install another bench which in’t running in production, so I did: bench init frappe-bench-dev && cd frappe-bench-dev bench get-app erpnext https://github.com/frappe/erpnext bench new-site erp-dev.domain.com bench --site erp-dev.domain.com install-app erpnext
All fine so far.
I’ve also changed the hostname of the existing site from site1.local to erp.domain.com by: bench setup add-domain --site site1.local erp.domain.com
I do this, but I have two separate bench instances frappe-bench-prd and frappe-bench-dev. Each bench has only one site in it erp.domain.com in frappe-bench-prd and then erp-dev.domain.com in frappe-bench-dev. That way all code bases are completely isolated from each other and you can update the dev instance at any time and do testing before you update prod.
I assume you have more than one ip address bound to the network adapter and then dns setup to point to proper ip by name? I have dev running on port 8080. I manually edited the nginx.conf file to do that, but I think there is a bench command to do it.
No, the machine has only one IP, the dns server has the two hosts (erp.domain.com and erp-dev.domain.com) pointing to that IP address. So normally I would have to setup virtual hosts to make this work.
The manual (https://github.com/frappe/bench/wiki/Multitenant-Setup) also speaks about multitenant based on dns instead of port, put I think those samples are based on a single bench setup with multiple sites and is not mentioning multiple benches.
The main thing is you cannot update only a single site at a time in one bench. So when you want a dev instance you need that in a different bench than prod site so you can update the dev bench first, do testing and then update the prod bench. With multi-tenant this is really important as you don’t want to update a ton of prod sites that have not been tested.
Could you please give some guidance on this? I encountered the same issue but in my case, the second domain name just goes to the site in the first bench. How does a user point a domain to the correct bench when they have multiple benches setup on one machine?
By the way, the domain name resolved correctly once I setup production but I’m not quite sure if this answers the question ‘how to setup domains for a production and development site on the same machine’