Title: Multi-site setup: ERP and Website on same server sharing inventory/orders

We need to set up two ERPNext sites on the same production server:

  • erp.modia.com - Internal ERP interface (existing production system)
  • modia.com - Public website with e-commerce functionality

Requirements:

  • Both sites need to share the same inventory, stock levels, and order data
  • Stock changes in ERP should immediately reflect on website
  • Price updates in ERP should sync instantly to website
  • Independent user interfaces (admin vs customer-facing)
  • Both sites must run independently without cross-contamination

Current Challenge: During development testing, we experienced cross-contamination where one site would display data from the other site despite having separate databases and Redis configurations. We tried:

  • Separate databases
  • Different Redis database numbers
  • Separate site configurations
  • Cache clearing

Questions:

  1. What’s the proper way to configure two sites to share the same database?
  2. How do we prevent interface cross-contamination?
  3. Should we use same database or API integration between sites?
  4. Any specific nginx/site configuration needed?
  5. What are the best practices for this architecture?

Environment: ERPNext v15, Ubuntu server, nginx

Any guidance or examples would be greatly appreciated.

I think you might need to elaborate further on your setup.

From what I see modia.com is built on Magento.

How did you shared the database between ERPNext and Magento?
What did you mean by “cross-contamination”?

I think the best practice can goes 3 way.

  1. Using existing e-commerce connector to another systems (Shopify / Woo-commerce).
  2. Using ERPNext e-commerce modules.
  3. Create custom site then create an api connect to ERPNext instant.

Each has its pros and cons.

let me clarify. I am trying to eliminate magento and run modia.com on modern ERP platform. in order to do that, I need to set up staging.modia.com on current EN Dev server. current server is running deverp.modia.com for all ERP functions like buying, selling, stock, etc. when I setup staging.modia.com as another site, some how, it uses the DEV database even though staging has its own database. this has nothing to do with magento.

There must be something misconfigured in your site_config.json for staging.modia.com if it’s connection to another site’s database.

EDIT: or deverp site_config.json has the domain staging listed in it.