Re: [Dhis2-devs] detail walkthrough to use postgresql with DHIS2 Live
Hi Eduardo, You seem to be on the right track, I attach some slides I made a long time ago. Here is what it says in the manual regarding dhis.conf: https://docs.dhis2.org/2.25/en/implementer/html/install_server_setup.html#install_database_configuration I would suggest starting with an empty Postgres database. and let DHIS2 generate the tables. Knut On Sat, Feb 24, 2018 at 1:49 AM, Eduardo Gonzalez wrote: > Dear all, > > I am trying to test DHIS2 for monitoring projects in a Humanitarian > organization. > > I cannot find the way to use postgresql with DHIS2 LIVE, so far i have > located the dhis.conf file and also download dhis2-db-sierra-leone.sql. > > Is it possible that you can help with a step by step instruction to make > the set up? since i have limit knowledge for programing this database. > > > I have tried to make my test with the H2 version but when i try to use > analytic to export i get this error: > > 2018-02-21 08:06:37 Process failed: StatementCallback; bad SQL grammar [create > table _orgunitstructure_temp (organisationunitid integer not null primary > key, organisationunituid character(11), level integer, "idlevel1" integer, > "uidlevel1" character(11), "idlevel2" integer, "uidlevel2" character(11));]; > nested exception is org.h2.jdbc.JdbcSQLException: Tabla > "_ORGUNITSTRUCTURE_TEMP" ya existe Table "_ORGUNITSTRUCTURE_TEMP" already > exists; SQL statement: create table _orgunitstructure_temp > (organisationunitid integer not null primary key, organisationunituid > character(11), level integer, "idlevel1" integer, "uidlevel1" > character(11), "idlevel2" integer, "uidlevel2" character(11)); [42101-194] > > 2018-02-21 08:06:37 Updating resource tables > 2018-02-21 08:06:37 Analytics table update process started > > Then I tried to change the dhis2.conf with the following text: > > # Hibernate SQL dialect > connection.dialect = org.hibernate.dialect.PostgreSQLDialect > # JDBC driver class > connection.driver_class = org.postgresql.Driver > # JDBC driver connection URL > connection.url = jdbc:postgresql:dbname > # Database username > connection.username = username > # Database password > connection.password = password > # Database schema behavior, can be validate, update, create, create-drop > connection.schema = update > #Encryption password (sensitive) > #encryption.password = password > > > didnt work, i got 503 error. > > I have also downloaded POSTGRADESQL 10 (I am not sure if this is > necessary). > > many thanks in advance for your support! > > best, > > Eduardo. > > ___ > Mailing list: https://launchpad.net/~dhis2-devs > Post to : dhis2-devs@lists.launchpad.net > Unsubscribe : https://launchpad.net/~dhis2-devs > More help : https://help.launchpad.net/ListHelp > > -- Knut Staring Department of Information, Evidence and Research World Health Organization, Geneva, Switzerland Office: +41 22 791 3683 Mob1: +33 6 4434 2931 Mob2: +47 9188 0522 Skype: knutstar Installation on a Windows laptop (1).pptx Description: MS-Powerpoint 2007 presentation ___ Mailing list: https://launchpad.net/~dhis2-devs Post to : dhis2-devs@lists.launchpad.net Unsubscribe : https://launchpad.net/~dhis2-devs More help : https://help.launchpad.net/ListHelp
[Dhis2-devs] import error
Hi,all, I import metadata from dhis28 to dhis29. got this, how? * WARN 2018-02-24 17:49:35,077 HHH000437: Attempting to save one or more entities that have a non-nullable association with an unsaved transient entity. The unsaved transient entity must be saved in an operation prior to saving these dependent entities. Unsaved transient entity: ([org.hisp.dhis.attribute.Attribute#0]) Dependent entities: ([[org.hisp.dhis.attribute.AttributeValue#85]]) Non-nullable association(s): ([org.hisp.dhis.attribute.AttributeValue.attribute]) (UnresolvedEntityInsertActions.java [taskScheduler-11]) * ERROR 2018-02-24 17:49:35,080 Unexpected error occurred in scheduled task. (TaskUtils.java [taskScheduler-11]) org.hibernate.TransientPropertyValueException: Not-null property references a transient value - transient instance must be saved before current operation : org.hisp.dhis.attribute.AttributeValue.attribute -> org.hisp.dhis.attribute.Attribute at org.hibernate.action.internal.UnresolvedEntityInsertActions.checkNoUnresolvedActionsAfterOperation(UnresolvedEntityInsertActions.java:122) at org.hibernate.engine.spi.ActionQueue.checkNoUnresolvedActionsAfterOperation(ActionQueue.java:421) at org.hibernate.internal.SessionImpl.checkNoUnresolvedActionsAfterOperation(SessionImpl.java:630) at org.hibernate.internal.SessionImpl.fireSave(SessionImpl.java:693) at org.hibernate.internal.SessionImpl.save(SessionImpl.java:683) at org.hibernate.internal.SessionImpl.save(SessionImpl.java:678) at org.hisp.dhis.dxf2.metadata.objectbundle.hooks.IdentifiableObjectBundleHook.handleAttributeValues(IdentifiableObjectBundleHook.java:97) at org.hisp.dhis.dxf2.metadata.objectbundle.hooks.IdentifiableObjectBundleHook.preCreate(IdentifiableObjectBundleHook.java:55) at org.hisp.dhis.dxf2.metadata.objectbundle.DefaultObjectBundleService.lambda$null$179(DefaultObjectBundleService.java:239) at java.util.ArrayList.forEach(ArrayList.java:1249) at org.hisp.dhis.dxf2.metadata.objectbundle.DefaultObjectBundleService.lambda$handleCreates$180(DefaultObjectBundleService.java:238) at java.util.ArrayList.forEach(ArrayList.java:1249) at org.hisp.dhis.dxf2.metadata.objectbundle.DefaultObjectBundleService.handleCreates(DefaultObjectBundleService.java:238) at org.hisp.dhis.dxf2.metadata.objectbundle.DefaultObjectBundleService.commit(DefaultObjectBundleService.java:180) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:333) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99) at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:282) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213) at com.sun.proxy.$Proxy198.commit(Unknown Source) at org.hisp.dhis.dxf2.metadata.DefaultMetadataImportService.importMetadata(DefaultMetadataImportService.java:137) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:333) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99) at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:282) -- 此致 林晓东 莫愁前路无知己,天下谁人不识君。___ Ma
Re: [Dhis2-devs] detail walkthrough to use postgresql with DHIS2 Live
Dear Knut, many thanks for this, it worked! I had to install Postgresql v9.5 to make it work. I the start couldn't get in, then I did some tests and i discover that you have to add control all privileges to the dhis user in the privileges tab. Many thank again for this detail instructions, I suggest to add the privileges step and add this Tutorial to the main page of the download DHIS2 LIVE section, I have seem many people asking the same thing, setup postgresql with DHIS2 Live. Again, many thanks for your help! best, E. 2018-02-24 2:29 GMT-06:00 Knut Staring : > Hi Eduardo, > > You seem to be on the right track, I attach some slides I made a long time > ago. > > Here is what it says in the manual regarding dhis.conf: > https://docs.dhis2.org/2.25/en/implementer/html/install_ > server_setup.html#install_database_configuration > > I would suggest starting with an empty Postgres database. and let DHIS2 > generate the tables. > > Knut > > On Sat, Feb 24, 2018 at 1:49 AM, Eduardo Gonzalez > wrote: > >> Dear all, >> >> I am trying to test DHIS2 for monitoring projects in a Humanitarian >> organization. >> >> I cannot find the way to use postgresql with DHIS2 LIVE, so far i have >> located the dhis.conf file and also download dhis2-db-sierra-leone.sql. >> >> Is it possible that you can help with a step by step instruction to make >> the set up? since i have limit knowledge for programing this database. >> >> >> I have tried to make my test with the H2 version but when i try to use >> analytic to export i get this error: >> >> 2018-02-21 08:06:37 Process failed: StatementCallback; bad SQL grammar >> [create >> table _orgunitstructure_temp (organisationunitid integer not null primary >> key, organisationunituid character(11), level integer, "idlevel1" integer, >> "uidlevel1" character(11), "idlevel2" integer, "uidlevel2" character(11));]; >> nested exception is org.h2.jdbc.JdbcSQLException: Tabla >> "_ORGUNITSTRUCTURE_TEMP" ya existe Table "_ORGUNITSTRUCTURE_TEMP" already >> exists; SQL statement: create table _orgunitstructure_temp >> (organisationunitid integer not null primary key, organisationunituid >> character(11), level integer, "idlevel1" integer, "uidlevel1" >> character(11), "idlevel2" integer, "uidlevel2" character(11)); >> [42101-194] >> 2018-02-21 08:06:37 Updating resource tables >> 2018-02-21 08:06:37 Analytics table update process started >> >> Then I tried to change the dhis2.conf with the following text: >> >> # Hibernate SQL dialect >> connection.dialect = org.hibernate.dialect.PostgreSQLDialect >> # JDBC driver class >> connection.driver_class = org.postgresql.Driver >> # JDBC driver connection URL >> connection.url = jdbc:postgresql:dbname >> # Database username >> connection.username = username >> # Database password >> connection.password = password >> # Database schema behavior, can be validate, update, create, create-drop >> connection.schema = update >> #Encryption password (sensitive) >> #encryption.password = password >> >> >> didnt work, i got 503 error. >> >> I have also downloaded POSTGRADESQL 10 (I am not sure if this is >> necessary). >> >> many thanks in advance for your support! >> >> best, >> >> Eduardo. >> >> ___ >> Mailing list: https://launchpad.net/~dhis2-devs >> Post to : dhis2-devs@lists.launchpad.net >> Unsubscribe : https://launchpad.net/~dhis2-devs >> More help : https://help.launchpad.net/ListHelp >> >> > > > -- > Knut Staring > > Department of Information, Evidence and Research > World Health Organization, Geneva, Switzerland > Office: +41 22 791 3683 <+41%2022%20791%2036%2083> Mob1: +33 6 4434 2931 > <+33%206%2044%2034%2029%2031> Mob2: +47 9188 0522 > Skype: knutstar > ___ Mailing list: https://launchpad.net/~dhis2-devs Post to : dhis2-devs@lists.launchpad.net Unsubscribe : https://launchpad.net/~dhis2-devs More help : https://help.launchpad.net/ListHelp
Re: [Dhis2-devs] detail walkthrough to use postgresql with DHIS2 Live
Hi Eduardo, Great that you got it working and thanks for the feedback - I will update it and ask the website maintainers to place it on the website. Cheers, Knut On Sat, Feb 24, 2018 at 7:16 PM, Eduardo Gonzalez wrote: > Dear Knut, > > many thanks for this, it worked! > > I had to install Postgresql v9.5 to make it work. I the start couldn't get > in, then I did some tests and i discover that you have to add control all > privileges to the dhis user in the privileges tab. > > Many thank again for this detail instructions, I suggest to add the > privileges step and add this Tutorial to the main page of the download > DHIS2 LIVE section, I have seem many people asking the same thing, setup > postgresql with DHIS2 Live. > > Again, many thanks for your help! > > best, > > E. > > 2018-02-24 2:29 GMT-06:00 Knut Staring : > >> Hi Eduardo, >> >> You seem to be on the right track, I attach some slides I made a long >> time ago. >> >> Here is what it says in the manual regarding dhis.conf: >> https://docs.dhis2.org/2.25/en/implementer/html/install_serv >> er_setup.html#install_database_configuration >> >> I would suggest starting with an empty Postgres database. and let DHIS2 >> generate the tables. >> >> Knut >> >> On Sat, Feb 24, 2018 at 1:49 AM, Eduardo Gonzalez >> wrote: >> >>> Dear all, >>> >>> I am trying to test DHIS2 for monitoring projects in a Humanitarian >>> organization. >>> >>> I cannot find the way to use postgresql with DHIS2 LIVE, so far i have >>> located the dhis.conf file and also download dhis2-db-sierra-leone.sql. >>> >>> Is it possible that you can help with a step by step instruction to make >>> the set up? since i have limit knowledge for programing this database. >>> >>> >>> I have tried to make my test with the H2 version but when i try to use >>> analytic to export i get this error: >>> >>> 2018-02-21 08:06:37 Process failed: StatementCallback; bad SQL grammar >>> [create >>> table _orgunitstructure_temp (organisationunitid integer not null primary >>> key, organisationunituid character(11), level integer, "idlevel1" integer, >>> "uidlevel1" character(11), "idlevel2" integer, "uidlevel2" character(11));]; >>> nested exception is org.h2.jdbc.JdbcSQLException: Tabla >>> "_ORGUNITSTRUCTURE_TEMP" ya existe Table "_ORGUNITSTRUCTURE_TEMP" already >>> exists; SQL statement: create table _orgunitstructure_temp >>> (organisationunitid integer not null primary key, organisationunituid >>> character(11), level integer, "idlevel1" integer, "uidlevel1" >>> character(11), "idlevel2" integer, "uidlevel2" character(11)); >>> [42101-194] >>> 2018-02-21 08:06:37 Updating resource tables >>> 2018-02-21 08:06:37 Analytics table update process started >>> >>> Then I tried to change the dhis2.conf with the following text: >>> >>> # Hibernate SQL dialect >>> connection.dialect = org.hibernate.dialect.PostgreSQLDialect >>> # JDBC driver class >>> connection.driver_class = org.postgresql.Driver >>> # JDBC driver connection URL >>> connection.url = jdbc:postgresql:dbname >>> # Database username >>> connection.username = username >>> # Database password >>> connection.password = password >>> # Database schema behavior, can be validate, update, create, create-drop >>> connection.schema = update >>> #Encryption password (sensitive) >>> #encryption.password = password >>> >>> >>> didnt work, i got 503 error. >>> >>> I have also downloaded POSTGRADESQL 10 (I am not sure if this is >>> necessary). >>> >>> many thanks in advance for your support! >>> >>> best, >>> >>> Eduardo. >>> >>> ___ >>> Mailing list: https://launchpad.net/~dhis2-devs >>> Post to : dhis2-devs@lists.launchpad.net >>> Unsubscribe : https://launchpad.net/~dhis2-devs >>> More help : https://help.launchpad.net/ListHelp >>> >>> >> >> >> -- >> Knut Staring >> >> Department of Information, Evidence and Research >> World Health Organization, Geneva, Switzerland >> Office: +41 22 791 3683 <+41%2022%20791%2036%2083> Mob1: +33 6 4434 2931 >> <+33%206%2044%2034%2029%2031> Mob2: +47 9188 0522 >> Skype: knutstar >> > > -- Knut Staring Department of Information, Evidence and Research World Health Organization, Geneva, Switzerland Office: +41 22 791 3683 Mob1: +33 6 4434 2931 Mob2: +47 9188 0522 Skype: knutstar ___ Mailing list: https://launchpad.net/~dhis2-devs Post to : dhis2-devs@lists.launchpad.net Unsubscribe : https://launchpad.net/~dhis2-devs More help : https://help.launchpad.net/ListHelp