简体   繁体   中英

How to export binary data fields from appengine datastore to other databases?

I was using appengine python appcfg.py to do a bulk download/upload of data from my datastore. Works great. I had all my data in csv file when I did a download_data. My entities have hashmap properties (serialized data on datastore) which are saved in a base64 encoding in the csvfile.

appcfg.py by default has these import_transform: transform.blobproperty_from_base64 export_transform: base64.b64encode When we import the data, python code has magic to convert it into blob object.

I would like to use the generated csv file and write some scripts to migrate data to MySQL at some point. Anyone has thoughts on how to read the binary data and recreate a hashmap object? Any apis that would help?

Try reading the binary data using ObjectInputStream . Don't forget to cast.

See the "2.2 Object output and input" section of this article for more info.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM