[Midpoint-dev] Need help in config MYSQL DB

Martin Devecka martin.devecka at evolveum.com
Wed Aug 13 13:30:01 CEST 2014


Hi,

The simplest way to transfer your data from H2 repository configuration 
into MySQL is:

1. Run tomcat with H2 repository configuration and start midpoint.
2. In Configuration panel select Repository objects.
3. Click on scroll button and select export all objects - .xml file such 
as ExportedData_ObjectType_1407926759250.xml is automatically downloaded.
4. Shut down tomcat, change repository to MySQL and start tomcat.
5. Start midpoint and in Configuration panel select Import object.
6. Choose .xml file and import.
7. Data are stored in database.

You can also check repo-ninja tool in case of further interest on 
https://wiki.evolveum.com/display/midPoint/Repo+Ninja

Best regards Martin

Dňa 13.8.2014 10:20 Sai Chandra wrote / napísal(a):
>
> Hi Martin,Paul​
>
>
> Thanks for the Quicker reponse.
>
>
> The below mentioned steps worked for me.Thanks for your help.
>
>
> I want help in the following things.
>
>
> 1-Initially i have created the H2 DB and created few users ,roles and 
> connectors.Now if iam migrating to MYSQL how can i migrated the 
> complete H2DB to mysql DB so that all my data will be restored.
>
>
> Thanks in advance for the suggestion
>
>
> Thanks
>
> Saichandra
>
> ------------------------------------------------------------------------
> *From:* Martin Devecka <martin.devecka at evolveum.com>
> *Sent:* 13 August 2014 13:18
> *To:* Sai Chandra; midpoint-dev at lists.evolveum.com
> *Subject:* Re: [Midpoint-dev] Need help in config MYSQL DB
> Hi,
>
> it seems we have lack in the documentation, thank you for reporting 
> it. We are going to improve the documentation, however in the meantime 
> following simple how to would probably help.
> We assume you have followed 
> https://wiki.evolveum.com/display/midPoint/Repository+Configuration 
> and https://wiki.evolveum.com/display/midPoint/MySQL
>
> First of all you should shutdown your tomcat (if it is in running state).
>
> This guide is for Windows environment, but it is very similar for Linux.
>
> 1. Check ${midpoint-home}/config.xml, where MySQL (H2 has to be 
> commented out) repository configuration is following:
>     <repository>
> <repositoryServiceFactoryClass>com.evolveum.midpoint.repo.sql.SqlRepositoryFactory</repositoryServiceFactoryClass>
>         <embedded>false</embedded>
> <driverClassName>com.mysql.jdbc.Driver</driverClassName>
>         <jdbcUsername>midpoint</jdbcUsername>
>         <jdbcPassword>password</jdbcPassword>
> <jdbcUrl>jdbc:mysql://localhost:3306/midpoint</jdbcUrl>
> <hibernateDialect>com.evolveum.midpoint.repo.sql.util.MidPointMySQLDialect</hibernateDialect>
> <hibernateHbm2ddl>validate</hibernateHbm2ddl>
>     </repository>
>
>     Please update the property values according to your environment.
>
> 2. On classpath either in deployed midpoint 
> webapps/midPoint/WEB-INF/lib or in apache-tomcat/lib proper MySQL 
> driver shall be placed. In my case: mysql-connector-java-5.1.30-bin.jar
>    If you are missing it, please, follow the instruction in our wiki 
> to download and copy it.
>
> 3. Check catalina.bat in apache-tomcat/bin to point to correct 
> midpoint home location (Please set your own path):
>     set JAVA_OPTS=%JAVA_OPTS% -Dmidpoint.home=c:/midpoint_3_Node2 
> -XX:MaxPermSize=1024m
>
> 4. In MySQL (I am using workbench) create midpoint database:
>
>     CREATE DATABASE IF NOT EXISTS midpoint CHARACTER SET utf8 DEFAULT 
> CHARACTER SET utf8 COLLATE utf8_bin DEFAULT COLLATE utf8_bin;
>     CREATE USER 'midpoint'@'localhost' IDENTIFIED BY 'password';
>     GRANT ALL on midpoint.* TO 'midpoint'@'localhost';
>     use midpoint;
>
>     and all the DB objects (tables) that are in the midpoint mysql script.
>
>     ...
>     CREATE TABLE ...
>     ...
>
>     Use proper sql script based on the distribution your are using 
> either stable or snapshot:
>     For stable release check:
>     - the latest midpoint http://www.evolveum.com/downloads/midpoint/3.0/
>     - and download midpoint-3.0-dist.zip
>     - Execute MySQL database script located in: 
> *\midpoint-3.0-dist.zip\config\sql\midpoint\3.0\mysql\mysql-3.0
>     For snapshot check:
>     - the latest commit number on 
> https://bamboo.evolveum.com/browse/MID-TRUNK/latestSuccessful
>     - and download it via http://athena.evolveum.com/builds/master/ 
> where .zip file should be selected (midpoint-3.1-SNAPSHOT-dist.zip).
>     - Execute MySQL database script located in: 
> *\midpoint-3.1-SNAPSHOT-dist.zip\config\sql\midpoint\3.0\mysql\mysql-3.0
>
> 5. Start tomcat (Windows) apache-tomcat\bin\startup.bat (for Linux 
> apache-tomcat\bin\startup.sh).
> 6. Open browser http://localhost:8080/midpoint/admin/ 
> Login:administrator Pass:5ecr3t
> 7. Create new user in midpoint.
> 8. Check in MySQL table m_user where new user should be created: 
> select * from m_user;
>
> I hope this will help you.
>
> regards,
> Martin Devecka
>
> Dňa 12.8.2014 18:00 Sai Chandra wrote / napísal(a):
>>
>> Hi Team,
>>
>>
>> Can someone give me a breif idea how can i change the h2 database to 
>> my sql database.I have followed the steps mentioned in the Wiki 
>> evoleum,but it didnt help me.I have created a user and role in the 
>> midpoint but the data is not getting updated in the MYSQL DB,and also 
>> i have not found any errors in the logs.​A quick response is highly 
>> appreciable.
>>
>>
>>
>> Thanks
>>
>> Saichandra
>>
>> This message contains information that may be privileged or 
>> confidential and is the property of ILANTUS Technologies. It is 
>> intended only for the person to whom it is addressed. If you are not 
>> the intended recipient, you are not authorized to read, print, 
>> retain, copy, disseminate, distribute, or use this message or any 
>> part thereof. If you receive this message in error, please notify the 
>> sender immediately and delete all copies of this message.
>>
>>
>> _______________________________________________
>> midPoint-dev mailing list
>> midPoint-dev at lists.evolveum.com
>> http://lists.evolveum.com/mailman/listinfo/midpoint-dev
>
> This message contains information that may be privileged or 
> confidential and is the property of ILANTUS Technologies. It is 
> intended only for the person to whom it is addressed. If you are not 
> the intended recipient, you are not authorized to read, print, retain, 
> copy, disseminate, distribute, or use this message or any part 
> thereof. If you receive this message in error, please notify the 
> sender immediately and delete all copies of this message.
> This message contains information that may be privileged or 
> confidential and is the property of ILANTUS Technologies. It is 
> intended only for the person to whom it is addressed. If you are not 
> the intended recipient, you are not authorized to read, print, retain, 
> copy, disseminate, distribute, or use this message or any part 
> thereof. If you receive this message in error, please notify the 
> sender immediately and delete all copies of this message. 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.evolveum.com/pipermail/midpoint-dev/attachments/20140813/785894ec/attachment.html>


More information about the midPoint-dev mailing list