在Google App Engine上备份数据的最佳方法是什么? [英] What's the best way to back up data on Google App Engine?
问题描述
Google本身提供了两种解决方案。
http://code.google.com/appengine/docs/python/tools/uploadingdata.html
其中之一是新的和实验性的,并且需要您为每种要备份的数据运行单独的命令(并单独输入用户名和密码)。
另一个要求你要两次写出关于你所有数据结构的信息,这些信息已经隐含在你的模型文件中。 (我们有25种不同的数据,所以我对这种东西很敏感,而且这意味着将来必须在3个地方做出改变。)
<然后有Aral Balkan的解决方案(谷歌为gaebar),但他在Github上的代码在大约一年内没有更新,他还告诉人们对App Engine内部进行一些修改(这似乎有风险,因为它们每一个版本都会有变化)。
我认为我倾向于Google的非实验性解决方案,但它们看起来都很糟糕。
以下是 bulkloader.py 无配置备份和恢复解决方案。我不知道何时此问题(堆栈溢出)出现。
将数据从fooapp转储到名为dump1.bin的文件中:
python2.5 /usr/local/google_appengine/bulkloader.py \\ \\
--dump --url http://fooapp.appspot.com/remote-api-url \
--filename dump1.bin
您必须拥有启用远程API 。根据您的配置, remote-api-url
可能 _ah / remote_api
。
将dump1.bin中的数据加载到本地dev实例:
$ b $
python2.5 / usr / local / google_appengine / bulkloader.py \
--restore --url http:// localhost:8080 / remote-api-url \
- 文件名dump1.bin --application fooapp
这假设类UNIX系统,并且appengine安装在/usr/local/google_appengine.
我不知道它是否适用于Java,但它可能。
Google itself provides two solutions.
http://code.google.com/appengine/docs/python/tools/uploadingdata.html
One of these is new and experimental and requires you to run a separate command (and separately enter your username and password) for each kind of data you want to back up.
The other requires you to twice write out information on the structure of all the kinds of your data, information that is already implicit in your models file. (We've got 25 different kinds of data so I'm sensitive to this kind of stuff. Plus it will mean future changes will have to be made in 3 places.)
Then there's Aral Balkan's solution (google for "gaebar"), but his code on Github hasn't been updated in about a year, and he's additionally telling people to do some modification to App Engine internals (which seems risky, since they change in every version).
I think I'm leaning towards Google's non-experimental solution, but they all seem pretty bad.
Here is a more explicit description of bulkloader.py no-config backup and restore solution. I do not know when this issue (stack overflow) arises.
Dumping data from fooapp into a file called dump1.bin:
python2.5 /usr/local/google_appengine/bulkloader.py \
--dump --url http://fooapp.appspot.com/remote-api-url \
--filename dump1.bin
You must have the remote API enabled. The remote-api-url
might be _ah/remote_api
depending on your configuration.
Loading up data from dump1.bin to a local dev instance:
python2.5 /usr/local/google_appengine/bulkloader.py \
--restore --url http://localhost:8080/remote-api-url \
--filename dump1.bin --application fooapp
This assumes a UNIX-like system and that appengine is installed in /usr/local/google_appengine.
I don't know if it works with Java, but it might.
这篇关于在Google App Engine上备份数据的最佳方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!