SOLVED Multiple Bench on same server/username

Hi,.

I have successfully deployed ERPNext using the install script:
wget https://raw.githubusercontent.com/frappe/bench/master/playbooks/install.py
sudo python install.py --production --site erpnext.domain.com --user erpnext

Can I use the script again to deploy another bench copy? I would like to have another erpnext-test.domain.com running as well as erpnext.domain.com. Is there a better way of doing this? I don’t particular want to deploy a complete test server considering my instance will be very small…

The idea being that the dev/text site will always be available without having to SSH into the server. It will also provide scope in the future to have nightly DB copied over from the production site to the erpnext-test site allowing for transaction testing and erpnext update testing.

Thank you for your help.

With the install script you now have a bench command line.
To create a new bench instance you can run
bench init other_bench_name

Multiple bench can work on the same server.

Regards.

Thank you for the reply. Will this create a complete bench environment and own directory so all I have to do is maintain bench update every once in a while?

Will this be automatically enabled on boot like the production environment?

Thanks.

This new bench is another instance, it can be a development bench or another production bench.
By default it’s not setup as production but it could be done with the bench setup production command

Separate bench could be useful when you have multiple set of apps.
When you run a bench update you can only have one version for an app for all your sites.
For example, it’s not possible in the same bench instance to have a frappe dev and frappe master version.

For each bench instance you must go in the bench directory and run bench update

Hi.

Thank you for your help.

So for production I first run:

wget https://raw.githubusercontent.com/frappe/bench/master/playbooks/install.py

sudo python install.py --production --site erpnext.domain.com --user erpnext --mysql-root-password sqlPassword --admin-password adminPassword --bench-name erpnextlive

This setup my production site which starts-up on reboot.

For the test system:

bench init erpnexttest
cd erpnexttest
bench get-app erpnext https://github.com/frappe/erpnext
bench new-site erpnexttest.domain.com

Enter root password and admin password when prompted.

bench --site erpnexttest.domain.com install-app erpnext

bench start

At this point I would expect the erpnexttest.domain.com to be working but it doesn’t.

What else am I missing?

Thank you.,

EDIT:: Forgot to add the bench start which I ran

Finally solved it.

Step 1 - Setup production site

wget https://raw.githubusercontent.com/frappe/bench/master/playbooks/install.py

sudo python install.py --production --site erpnext.domain.com --user UserErpnext --mysql-root-password sqlPassword --admin-password adminPassword --bench-name erpnextlive

Replace erpnext.domain.com with your site address
Replace UserErpnext with username you want to install bench into. Do not use root!
Replace sqlPassword with a root SQL password for SQL server
Replace adminPassword with Administrator password for ERPNext (Web Portal)
Replace erpnextlive with the directory you want bench to install into

After a few minutes erpnext should be live. You can check by going to erpnext.domain.com and logging in using username administrator and password set in adminPassword in the above command.

You need to enable multitenant option by entering

cd into erpnextlive directory specified above and then enter

bench config dns_multitenant on

Step 2 - Setup another bench site

Ensure your in your /home directory

bench init erpnexttest
cd erpnexttest
bench get-app erpnext https://github.com/frappe/erpnext
bench new-site erpnexttest.domain.com

Enter root password and admin password when prompted.

bench --site erpnexttest.domain.com install-app erpnext

Your second site should now be installed.

To enable startup on boot:

sudo bench setup production UserErpnext

Replace UserErpnext with username you want to install bench into. Do not use root! This should be the same as the username chosen in Step 1.

Hope you find it useful.

Abbas.

EDIT: Need to enable multitenant.

3 Likes