gpt4 book ai didi

google-app-engine - 如何从 Google App Engine High Replication 数据存储中导出数据?

转载 作者:太空宇宙 更新时间:2023-11-03 15:25:19 25 4
gpt4 key购买 nike

我正在考虑将 Google App Engine 用于一个项目,如果我决定离开 GAE(或 GAE 关闭),我想确保我有办法导出我的所有数据。

我搜索的关于从 GAE 导出数据的所有内容都指向 https://developers.google.com/appengine/docs/python/tools/uploadingdata .但是,该页面包含此注释:

Note: This document applies to apps that use the master/slave datastore. If your app uses the High Replication datastore, it is possible to copy data from the app, but Google does not currently support this use case. If you attempt to copy from a High Replication datastore, you'll see a high_replication_warning error in the Admin Console, and the downloaded data might not include recently saved entities.

问题是最近主/从数据存储最近被弃用,取而代之的是 High Replication 数据存储。我知道主/从数据存储在一段时间内仍受支持,但我对使用已正式弃用并即将淘汰的东西感到不舒服。因此,我只剩下 High Replication 数据存储,它似乎导出数据的唯一方法是上述不受官方支持的方法(因此不能保证我可以取出数据)。

是否有任何其他(官方支持的)方式从 High Replication 数据存储导出数据?如果使用 Google App Engine 意味着我的数据可能会永远锁定在那里,我会感到不舒服。

最佳答案

我花了很长时间来设置从 GAE 下载数据,因为文档不够清晰。

如果您从 Unix 服务器提取数据,您也许可以重用下面的脚本。

此外,如果您不提供“config_file”参数,它会提取您的所有此类数据,但采用专有格式,只能用于之后恢复数据。

#!/bin/sh
#------------------------------------------------------------------
#-- Param 1 : Namespace
#-- Param 2 : Kind (table id)
#-- Param 3 : Directory in which the csv file should be stored
#-- Param 4 : output file name
#------------------------------------------------------------------
appcfg.py download_data --secure --email=$BACKUP_USERID -- config_file=configClientExtract.yml --filename=$3/$4.csv --kind=$2 --url=$BACKUP_WEBSITE/remote_api --namespace=$1 --passin <<-EOF $BACKUP_PASSWORD EOF

关于google-app-engine - 如何从 Google App Engine High Replication 数据存储中导出数据?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11209091/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com