Click here to Skip to main content
16,018,797 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
Hi, i want to migrate all my data from mongodb to mysql. i am able to do everything expect images data. how to transform mongodb images data to mysql database.

What I have tried:

exported mongodb data as json and then converted the json data to mysql format. this worked for all data types expect the image data.
Posted
Updated 22-Mar-20 22:47pm
Comments
Mohibur Rashid 23-Mar-20 2:35am    
what is the format of your image data? raw binary?

Anyway, I do not see any issue.
shiva saikrishna 23-Mar-20 4:18am    
binary data

1 solution

Image data type is binary content. JSON, on the other hand, is text-based.
The simplest solution would be to encode the binary content as Base64 strings on the mongodb side, and then decode the Base64 strings back into byte arrays on the MySQL side.
Base64 - Wikipedia[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900