Six Stars

How to change TAC database from H2 to MySQL by using MetaServlet

Hi All,

 

I would like to change default database H2 to MySql. When migrating i need all the users , projects and jobs created in H2 database.

 

I googled it and found we can use MetaservletCaller. I am using following syntax but it throws an error.

 

MetaServletCaller.bat --tac-url http://localhost:8080/org.talend.administrator --json-params='{"actionName": "migrateDatabase", "dbConfigPassword": "admin", "mode": "synchronous", "sourceUrl": "jdbc:h2:C:/Talend/6.4.1/tac/apache-tomcat/webapps/org.talend.administrator/WEB-INF/database/talend_administrator", "sourceUser": "tisadmin", "sourcePasswd": "tisadmin", "targetPasswd": "root", "targetUrl": "jdbc:mysql://localhost:3306/talend_administrator", "targetUser": "root"}'

 

Error Message : {"error":"A JSONObject text must begin with '{' at character 1","returnCode":2}

Thanks & Regards
A Ravi Kumar
Mobile Number : +91 852-762-1083
Email-id : a.ravikumar104@gmail.com
Skype Id : ammanannaravikumar
1 ACCEPTED SOLUTION

Accepted Solutions
Six Stars

Re: How to change TAC database from H2 to MySQL by using MetaServlet

You can try base64 encode of json params and try a get request to metaservlet endpoint.

https://help.talend.com/reader/rJGzSCBb8MvnaZHhs978KQ/ulwkupQQphDnbxaUbGscNg

4 REPLIES
Six Stars

Re: How to change TAC database from H2 to MySQL by using MetaServlet

Can you switch the quotes?
Use double quotes at beginning/end of json.
Use single quote around key/value of json.
Six Stars

Re: How to change TAC database from H2 to MySQL by using MetaServlet

Hi Chirgal,

 

Thanks for quick reply.

I am getting below error.

 

{"error":"A JSONObject text must begin with '{' at character 1","returnCode":2}

Thanks & Regards
A Ravi Kumar
Mobile Number : +91 852-762-1083
Email-id : a.ravikumar104@gmail.com
Skype Id : ammanannaravikumar
Six Stars

Re: How to change TAC database from H2 to MySQL by using MetaServlet

You can try base64 encode of json params and try a get request to metaservlet endpoint.

https://help.talend.com/reader/rJGzSCBb8MvnaZHhs978KQ/ulwkupQQphDnbxaUbGscNg

Six Stars

Re: How to change TAC database from H2 to MySQL by using MetaServlet

Hi Chirgal,

 

Thanks it's worked for me.

Thanks & Regards
A Ravi Kumar
Mobile Number : +91 852-762-1083
Email-id : a.ravikumar104@gmail.com
Skype Id : ammanannaravikumar