Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Migrate postgres database Ranger to mysql

Migrate postgres database Ranger to mysql

Explorer

i have already de Ranger database with postgres, and i want to migrate to mysql, so please how can do that?

7 REPLIES 7
Highlighted

Re: Migrate postgres database Ranger to mysql

Mentor

@ay mu

There are couple of tools out there bt some come at a price. There is an interesting on found at the Git repository

MySQL Workbench

Introduced the new Migration Wizard module. This module allows you to easily and quickly migrate databases from various RDBMS products to MySQL. It also provides for generic migrations, i.e. migrations from other RDBMSes that are not explicitly supported, provided that they have a well behaved ODBC driver.

pg2mysql converter

This converter (PostgreSQL to MySQL Converter) The pg2mysql converter is an online tool to convert/migrate existing PostgreSQL databases into MySQL. http://www.lightbox.ca/pg2mysql.php

Hope that helps !!!

Highlighted

Re: Migrate postgres database Ranger to mysql

Explorer

After the data conversion was successful, there were many error messages that could not be added to the primary foreign key when importing Mysql. I don't know if this has any effect.Thanks.

Highlighted

Re: Migrate postgres database Ranger to mysql

Hi @ay mu,

If you are on the newer releases of ranger you could just create a new ranger database in mysql and import the policies over using the import/export policy feature. https://cwiki.apache.org/confluence/display/RANGER/User+Guide+For+Import-Export

Highlighted

Re: Migrate postgres database Ranger to mysql

Explorer

Thank you very much.I am now using the 0.5 version of Ranger, ready to upgrade 0.7, while the database is changed from PostgreSQL to MySQL.

Ranger0.5-->Ranger0.7

PostgreSQL8.x-->Mysql

I checked the document, Ranger0.5 does not support export import,I will further study.

Highlighted

Re: Migrate postgres database Ranger to mysql

Mentor

@ay mu

Can you share the error stack messages that could not be added to the primary foreign key.

Highlighted

Re: Migrate postgres database Ranger to mysql

Explorer

Thanks for your reply, it is impossible to reproduce the problem now.
I saw 41 tables in the database ranger0.5 postgresql, but there are 53 tables in the Ranger0.7 mysql database. Is it feasible to migrate from postgres to mysql?

Highlighted

Re: Migrate postgres database Ranger to mysql

Mentor

@ay mu

If you read the release note for Ranger 0.7 you will realize a lot of enhancements that could explain the difference in the numbers of tables between the 2 versions.

Concerning the migration are you planning to run a complete stack (HDP.2.5 to HDP 2.6) or component (like Ranger 0.5 to Ranger 0.7) migration?

In case it's a complete stack migration then you could try migrating the Ranger 07 database from Postgres to Mysql later. Remember to always run a back before so you can use the dump I am sure the Mysql workbench could do that and in parallel have 2 databases Postgres and MySQL and just change the config files to point to the new Mysql and do some validation tests and once you are satisfied you do the cutover else try to resolve the errors.
All in all I think its doable !

Don't have an account?
Coming from Hortonworks? Activate your account here