Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GAE/J datastore backup

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

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?

like image 681
jb. Avatar asked Mar 02 '10 15:03

jb.


1 Answers

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> 

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

like image 161
jb. Avatar answered Oct 01 '22 05:10

jb.