14

I need to download the application files that are deployed using command prompt into google appengine server. if anybody know about this plz tell me!

thanks in advance!

Shiva Srikanth Thummidi
  • 2,898
  • 4
  • 27
  • 36
  • 2
    possible duplicate of [Can I restore my source code that has been uploaded into Google AppEngine?](http://stackoverflow.com/questions/2479087/can-i-restore-my-source-code-that-has-been-uploaded-into-google-appengine) – Nick Johnson Jun 23 '10 at 09:05

6 Answers6

19

SDK 1.4.0 has this sort of feature (Python only):

  • The developer who uploaded an app version can download that version's code using the appcfg.py download_app command. This feature can be disabled on a per application basis in the admin console, under the 'Permissions' tab. Once disabled, code download for the application CANNOT be re-enabled.

Note that although the 'download_app' command is only available in the Python SDK, it can be used to download Java applications from App Engine. If you have a Java app that you want to download, just do:

  1. Install Python (version 2.x only), if necessary.
  2. Install App Engine 1.4.0 (or higher), Python version.
  3. Run the python download_app command as described in the documentation, like appcfg.py download_app -A <your app name> -V <version to download> <path to download to>.
  4. Your Java app will download. Hooray!
alecxe
  • 462,703
  • 120
  • 1,088
  • 1,195
systempuntoout
  • 71,966
  • 47
  • 171
  • 241
  • Link to SDK release notes: http://code.google.com/p/googleappengine/wiki/SdkReleaseNotes – dfrankow Jan 18 '11 at 16:58
  • 1
    This is also available for Java apps now. http://code.google.com/appengine/docs/java/tools/uploadinganapp.html#Downloading_an_Application – Utensil Sep 01 '11 at 19:27
3

You can use appcfg.sh / appcfg.cmd in your GAE SDK, as pointed out in this official guide.

But notice that as of 2012-05-07, at least for the Windows version appcfg.cmd, the command's syntax is

appcfg -A yourappid -V yourversionnumber download_app c:\path\to\download\directory

Also notice that when you run this command and you get asked for your password and you happen to have activated Google's 2-step verification, you must not provide your Google password, but instead must provide an application-specific password (which you can generate on this side)

Abdull
  • 26,371
  • 26
  • 130
  • 172
  • I did this to download my app, and then used the following code (after adjusting "WEB-INF\appengine-web.xml" to change the version#) `appcfg.cmd update c:\path\to\download\directory` but Im now getting an error when trying to run the app `Uncaught exception from servlet java.lang.NoClassDefFoundError: com/google/appengine/repackaged/com/google/protobuf/InvalidProtocolBufferException` – johnvdenley Nov 24 '12 at 18:26
  • I get the same problem... did you ever find out what went wrong @johnvdenley ? – krico Sep 18 '15 at 22:23
  • Above command only downloads the deployed application; I can not see any source file in WEB-INF\**. Do i need to configure something in order to download the source code? – Ashish Awasthi Apr 08 '18 at 16:15
3

It's not possible to download your code from App Engine, unless you included code to support it when you uploaded your app. You can download static files by simply fetching them, of course.

To achieve this, you need to use a source control system, such as SVN or Git, and store/retrieve your code from there - App Engine isn't intended to act as source control.

Nick Johnson
  • 100,655
  • 16
  • 128
  • 198
  • 1
    FWIW, the makefile I use to update to appengine first makes a zip of the source, which can be downloaded from the app (static file). The name of the archive includes the svn revision number, and the makefile refuses to upload if the current revision is mixed (on grounds that it would not necessarily be reproducible from the repository). This avoids needing any Python code to support the download. – Steve Jessop Jul 28 '09 at 11:51
1

You can use appcfg.py with download_data option, see docs.

alecxe
  • 462,703
  • 120
  • 1,088
  • 1,195
ZelluX
  • 69,107
  • 19
  • 71
  • 104
1

As explained in this post: http://www.labnol.org/software/download-appengine-files/19348/ App Engine 1.5.0 introduced the feature to download your source code.

The command is:

appcfg.py download_app –A MyAppName -V 1 c:\AppEngine\SourceCode
sth
  • 222,467
  • 53
  • 283
  • 367
Olivier.Roger
  • 4,241
  • 5
  • 40
  • 68
0

You can download an application's source code by running appcfg.py with the download_app action in the Python SDK command-line tool:

    appcfg.py download_app -A <your_app_id> -V <your_app_version> <output-dir>
Anoop
  • 1,415
  • 11
  • 20
  • The same command also for *[Php](https://cloud.google.com/appengine/docs/php/tools/uploadinganapp)*, *[Go](https://cloud.google.com/appengine/docs/go/tools/uploadinganapp#Go_Downloading_source_code)* SDK. – eQ19 Mar 18 '16 at 19:06