How to properly configure moqui on the server?

Hi everybody!
I have successfully deployed Moqui on my personal computer (I have added data to perform testing). The next step I want to deploy to the server (Ubuntu 22.04) I have installed tomcat9, and run the command ‘./gradlew load addRuntime’. and copy it to …/webapp and run it successfully. But I ran into some trouble.

  1. I cannot load previously added data from the local computer.
  2. When I enter information, the list does not appear (for example: customers or suppliers)
    I hope everyone can help me configure the server.
    Thank you everyone! Have a good day
1 Like

Hi,
My Approach is:

  1. First copy moqui.war to tomcat webapp inside ROOT folder and change extension from war to zip and unzip it in ROOT Folder, do not forget to clean all files in ROOT folder first
  2. After extract, search in ROOT folder for MoquiInit.properties file and open this file and change
    line 21. this property must change to runtime path. example moqui.runtime=/opt/test/runtime
  3. Copy moqui runtime folder to location ==> ‘/opt/test/runtime’
  4. Config database connection
  5. Start Tomcat

Tomcat first create entities and then load data from your component
If your data is in your local computer you can export them first and then import them in server
Note: For exporting data you can try this address ==> http://localhost:8080/apps/tools/Entity/DataExport
Do not forget to change port and ip if needed.
if you need more help or maybe i misunderstood your question, explain your question with more detail.


Thanks

Thank you for your answer. I’m new so in the database configuration step I don’t really understand how to do it. Looking forward to your guidance on the steps to connect and configure the database. Have a nice day

SqlServer Database Config:

<datasource group-name="transactional" database-conf-name="mssql" schema-name="dbo">
<inline-jdbc
        jdbc-uri="jdbc:sqlserver://localhost:1433;databaseName=mydb;SelectMethod=Cursor;useLOBs=false;queryTimeout=90;cancelQueryTimeout=30;Connect Timeout=90"
        jdbc-username="username" jdbc-password="password"/>
</datasource>

Postgres Database Config:

<datasource group-name="transactional" database-conf-name="postgres" schema-name="public"
            startup-add-missing="true" runtime-add-missing="false">
<inline-jdbc jdbc-uri="jdbc:postgresql://localhost:5432/mydb"
             jdbc-username="username" jdbc-password="password"/>
</datasource>
  1. Replace mydb with your database name
  2. Replace username with your database username
  3. Replace password with your username password

Note: You can find Database config in this file MoquiProductionConf.xml, tag entity-facade
path ==> runtime/conf folder

By the way if you need more help , i can send you complete configured moqui with tomcat.
if your Database is mysql or oracle let me know!
Thanks

It’s good to receive your great support, wishing you good health. Thank you so much!

That’s awesome, looking forward to receiving the fully configured moqui from you

All my production deployments these days use docker because they’re easy to use, more reproducible, scale better with the right environment, and seems to be the way modern deployments are headed.

For a small, not mission critical system, you can use the production deployment guide here: Moqui Documentation.

I want to configure Oracle database. I hope you can share the steps

The only difference from configuring an Oracle database from postgres is you need to load the oracle jdbc driver. That’s the trickiest part. Here’s the page I found after a quick search: JDBC and UCP Downloads page. I usually just throw it into the /lib directory of my component.

Thank you very much, but can I ask more about the steps I need to take to be able to do this (step by step)

I think you have all the sources you need, but here’s the steps.

Prerequisite:
A database with a username and password that your production Moqui instance can access

  1. Add your jdbc file to your custom components /lib directory (i.e. JDBC and UCP Downloads page)
  2. Compile and run with your new jdbc driver on the classpath.
  3. Deploy to server
  4. On your production deployment set these environment variables to the values specified. (What these values are set to is dependent on your database setup.)
export entity_ds_db_conf=oracle
export entity_ds_user=moqui
export entity_ds_password=changemetobeaverysecurepassword
export entity_ds_crypt_pass=changemetobeaverysecurecryptpassword
export entity_ds_port=1630
export entity_ds_host=exampledatabaseurlorip.us-west-2.rds.amazonaws.com

Thank you very much for your support!!!

1 Like