既然Google已宣布推出Cloud SQL storage应用引擎,那么将现有数据从BigTable / GAE数据存储迁移到MySQL的最佳方法是什么?
回应彼得提出的优秀问题:
似乎批量上传器应该能够用于将数据下载到文本格式中,然后可以使用mysqlimport加载,但我对这两种技术都没有任何经验。此外,似乎Cloud SQL仅支持导入mysqldump,因此我必须在本地安装MqSQL,mysqlimport数据,然后转储它,然后导入转储?
我当前的型号代码示例,如果需要:
class OilPatternCategory(db.Model):
version = db.IntegerProperty(default=1)
user = db.UserProperty()
name = db.StringProperty(required=True)
default = db.BooleanProperty(default=False)
class OilPattern(db.Model):
version = db.IntegerProperty(default=2)
user = db.UserProperty()
name = db.StringProperty(required=True)
length = db.IntegerProperty()
description = db.TextProperty()
sport = db.BooleanProperty(default=False)
default = db.BooleanProperty(default=False)
retired = db.BooleanProperty(default=False)
category = db.CategoryProperty()
class League(db.Model):
version = db.IntegerProperty(default=1)
user = db.UserProperty(required=True)
name = db.StringProperty(required=True)
center = db.ReferenceProperty(Center)
pattern = db.ReferenceProperty(OilPattern)
public = db.BooleanProperty(default=True)
notes = db.TextProperty()
class Tournament(db.Model):
version = db.IntegerProperty(default=1)
user = db.UserProperty(required=True)
name = db.StringProperty(required=True)
center = db.ReferenceProperty(Center)
pattern = db.ReferenceProperty(OilPattern)
public = db.BooleanProperty(default=True)
notes = db.TextProperty()
class Series(db.Model):
version = db.IntegerProperty(default=3)
created = db.DateTimeProperty(auto_now_add=True)
user = db.UserProperty(required=True)
date = db.DateProperty()
name = db.StringProperty()
center = db.ReferenceProperty(Center)
pattern = db.ReferenceProperty(OilPattern)
league = db.ReferenceProperty(League)
tournament = db.ReferenceProperty(Tournament)
public = db.BooleanProperty(default=True)
notes = db.TextProperty()
allow_comments = db.BooleanProperty(default=True)
complete = db.BooleanProperty(default=False)
score = db.IntegerProperty(default=0)
class Game(db.Model):
version = db.IntegerProperty(default=5)
user = db.UserProperty(required=True)
series = db.ReferenceProperty(Series)
score = db.IntegerProperty()
game_number = db.IntegerProperty()
pair = db.StringProperty()
notes = db.TextProperty()
entry_mode = db.StringProperty(choices=entry_modes, default=default_entry_mode)
答案 0 :(得分:1)
您是否考虑过使用Map Reduce框架? 您可以编写将数据存储区实体存储在CloudSQL中的映射器。 不要忘记为数据存储区键添加一列,这可能会 帮助您避免重复行或识别丢失的行。
您可以查看https://github.com/hudora/gaetk_replication 获得映射器功能的灵感。