2

When I test an app engine project on my local development server, the local db is recreated every time the project is built, the reason being that the db is located in the build directory and treated as part of the build.

This behavior makes perfect sense for running tests, but not during development. Can it be changed? Is there a setting to move the db or create it somewhere else?

--

I'm on Java with the following run/debug configuration:

run/debug configuration

Oliver Hausler
  • 4,900
  • 4
  • 35
  • 70

2 Answers2

1

Well according to the docs for Python or Java, you just need to use a "datastore_path" flag (for python), or do nothing, for java.

AFAIK, this should work, I never saw my java devserver datastore deleted to be honest, unless I go and manually delete "local_db.bin" in my "WEB-INF/appengine-generated" folder.

Patrice
  • 4,641
  • 9
  • 33
  • 43
  • On my system the db is deleted every time that I build the project. When I start the server without a compile (no code changed), the db still exists and is used, otherwise I receive a log message that no datastore exists and it is created. – Oliver Hausler Sep 15 '14 at 17:02
  • are you in python or java? and what are you using to start your devserver? – Patrice Sep 15 '14 at 17:07
  • I have looked at the Python documentation and tried to set these options (like --datastore_path) in Java: unrecognized option. – Oliver Hausler Sep 15 '14 at 17:10
  • I'm in Java. To start the dev server, I have created a run/debug configuration and I have just uploaded the screenshot with the settings. – Oliver Hausler Sep 15 '14 at 17:19
  • 1
    For whatever reason I had the *** appengineExplodeApp Gradle script *** invoked during the build. As local_db.bin resides within the local exploded app in the WEB-INF folder, it has been deleted every time the build ran. Probably @Julldar is right with his answer that this behavior is default in Java, which is kind of sad as to my understanding it is necessary to explode the app to recreate the file structure locally. [I think appengineExplodeApp is in my build script because otherwise keyfiles were missing from the file structure, but I don't quite remember.] – Oliver Hausler Sep 16 '14 at 02:07
0

I did it in Java! Just user --generated_dir at command line!

Thank you @tomrozb ... Here is his answer: Custom datastore location on local machine with App Engine

Community
  • 1
  • 1
Renan Franca
  • 3,438
  • 1
  • 18
  • 17