MySQL to HANA


Recently as I’ve dug more and more into HANA (how could I not with Tom and Rich publishing so many cool things?) I found that I could take many of my existing demos from PHP and MySQL and port them to HANA. The pain though has always been migrating DB content so I decided to make a simple little tool to make life easier.

It was during the SAP InnoJam event in Madrid that I sat down and coded something that I was able to test with Rich’s help, HOWEVER this is not something SAP supports or even validates or approves this is just me and my own HANA Cloud instance having some fun and deciding to share!

GitHub - Move to HANA

GitHub – Move to HANA

I call it Move to HANA and you can find the code on GitHub. It’s fairly simple and I used JQuery Mobile (don’t hate me SAP UI5 lovers) to put it together, just upload it to your PHP server and run it.

The idea behind it, is to give a simple migration tool that will help generate the HANA specific SQL to get your same tables and fields generated and your data uploaded via the HANA Studio. Right now it’s setup for MySQL but is easily expanded for any DB you are working on; oh and of course it’s not 100% yet it’s only got a handful of the different field types but hey – it’s GitHub go ahead and make some changes!

As for execution – again very simple.

Database selection

Database selection

 

Once your select your database then you will need to log into the database to select which “database” you want to migrate.

Login into your database

Login into your database

 

Then select your “database” at which point the script will generate the 3 step process for data migration.

Simple 3 Steps

Simple 3 Steps

 

Step 1, will provide your the “copy and paste” script you need to enter into your HANA Studio.

HANA SQL to generate SCHEMA

HANA SQL to generate SCHEMA

Step 2, will provide the command line code for MySQL to generate the CSV files you can then upload via the HANA Studio

Command Line for MySQL Dumps

Command Line for MySQL Dumps

Step 3, will provide the SQL command to ensure the proper permissions for the newly generated SCHEMA

 

SCHEMA permissions

SCHEMA permissions

I’ve used the script a dozen times already to get sample data and other MySQL data moved into HANA to allow myself more and more opportunities to try my hand at HANA coding and it’s worked quite well. If you give a try feedback would be great and if you find new data types or if you want to try a different database than MySQL by all means have at it!!

 

** SAP does not support nor endorse this tool and there is no support other than the very little free time that I personally have to answer comments. **

Tags: , , ,

About ccmehil

A developer, writer, photographer, talker - words that describe Craig, but who is Craig? Craig is a person driven to interact and communicate, always looking to innovate over the years he's been through all spectrums of the development process for all platforms. He's built communities and helped define strategies to communicate and engage. Now though his focus has become more precise... With a major emphasis on interaction and collaboration Craig spends a lot of time both speaking and writing about effects of social in the work place and ways to improve efficiency through the use of "social media" in the day to day work you do.

5 responses to “MySQL to HANA”

  1. Objective Perspective says :

    What does that accomplish besides increasing the database licensing costs to the client/customer by about 1000x?

  2. ccmehil says :

    I guess I could answer that in several ways but I’ll stick to two, the first is that it provides a more powerful platform for the application to run on and the second is that yes there is a license cost involved but not 1000x; SAP HANA One provides a more affordable option… but frankly I did this because I wanted to see how it could be done considering I use the free developer license and it felt comfortable using data sets I had been using already.

  3. Sandeep Kumar says :

    Thanks a lot for your information. I am planning to port my on eof livechat hosted applications to HANA. I am not sure though what is exactly HANA and how I can handle this on Centos server like MYSQL

  4. Sunil says :

    This really helped. Saved alot of time. :).

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 4,752 other followers

%d bloggers like this: