GAE/J 数据存储备份 [英] GAE/J datastore backup

查看:30
本文介绍了GAE/J 数据存储备份的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

进行 GAE/J 数据存储备份的最简单方法是什么?

What is the easiest way to do a GAE/J datastore backup?

看起来有python bulkloader.py 工具可以备份Python 应用程序,但是我该怎么做才能备份Java 应用程序?有没有办法使用python工具?

It looks like there is python bulkloader.py tool to do backup for Python apps, but what should I do to backup Java app? Is there any way to use python tool?

推荐答案

可以使用 python 工具 bulkloader.py 来创建 GAE Java 应用程序的数据存储备份.您只需要通过在 web.xml 中添加以下几行来设置 remote_api:

It is possible to use python tool bulkloader.py to create datastore backup of GAE Java app. You just have to set up remote_api by adding following lines to web.xml:

<?xml version="1.0" encoding="utf-8"?>
<web-app>
  <!-- Add this to your web.xml to enable remote API on Java. -->
  <servlet>
    <servlet-name>remoteapi</servlet-name>
    <servlet-class>com.google.apphosting.utils.remoteapi.RemoteApiServlet</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>remoteapi</servlet-name>
    <url-pattern>/remote_api</url-pattern>
  </servlet-mapping>
  <security-constraint>
    <web-resource-collection>
      <web-resource-name>remoteapi</web-resource-name>
      <url-pattern>/remote_api</url-pattern>
    </web-resource-collection>
    <auth-constraint>
      <role-name>admin</role-name>
    </auth-constraint>
  </security-constraint>
</web-app> 

之后,您可以使用带有 --dump 的 bulkloader.py 下载备份,并使用 --restore 将备份上传到数据存储.

After that you can use bulkloader.py with --dump to download backup and with --restore to upload backup to datastore.

这篇关于GAE/J 数据存储备份的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆