GAE: Restore ah-builtin-python-bundle and ah-builtin-datastoreservice - google-app-engine

I have accidentally deleted the two versions ah-builtin-datastoreservice and ah-builtin-python-bundle in one of my GAE projects (written in Go). The implication is that my auto-backups (implemented as described in Scheduled Backups and Google BigQuery Analytics by Jordan Tigani, Siddartha Naidu) are not working anymore and the datastore admin is not available (response code 404).
It seems that the ah-builtin-python-bundle is created when "Enabling the datastore admin" in the Datastore Admin interface: https://stackoverflow.com/a/31038901/4763102.
Unfortunately, this button is not available anymore - only "Open Datastore Admin" and "Disable writes" buttons are available.
My question is pretty simple: How do I re-enable the deleted versions ah-builtin-datastoreservice and ah-builtin-python-bundle again?

Old question, but to handle getting your data into BigQuery and having a copy outside of Cloud Datastore, you are best to use the Managed Import/Export service.

Related

Can a deleted application be restored from Google cloud application?

I have accidentally deleted my application hosted in Google cloud app engine. IS there any way to restore it?
Welcome to Stack Overflow. Thanks for asking your question on the Google App Engine topic.
To answer your question, no, it can't be restored if the Google App Engine service or the version you expect is deleted already.
The hierarchy is as follows - Account > Project > GAE Service > Versions
Whenever you deploy the app to a specific service, an additional new version is created for the service and the traffic is routed to that version. The old version is not deleted by default. In case you have not deleted it, you can select it under https://console.cloud.google.com/appengine/versions page and re-route traffic to it. In case you have deleted the old version manually, then poof - it's permanantly gone.
Note - If you're referring that you have deleted the GCP project itself, then you should be able to restore it within 30 days. Find the support documentation here - https://cloud.google.com/resource-manager/docs/creating-managing-projects#restoring_a_project

How do I completely delete Cloud Datastore from a project?

I want to create a Firestore in Native mode in an existing project.
I don't have any data in Cloud Datastore, but it blocks me, saying
This project uses another database service
Your current project is set up to use Cloud Datastore or Cloud Firestore in Datastore mode. You can access data for this project from the Cloud Datastore console.
when going through https://console.cloud.google.com/firestore/
and
Cannot enable Firestore for this project
Currently Firestore cannot be enabled in projects already using Cloud Datastore or App Engine
when going through https://console.firebase.google.com/
I've tried it with writes to datastore enabled and disabled
I just want to completely purge the Cloud Datastore product from my project.
Unfortunately, there is no way to purge the previous existence of a Cloud Datastore database to try either Cloud Firestore in native or Datastore mode. You'll have to use a new project to try Cloud Firestore in either native or Datastore mode.
You can switch using the below command
$ gcloud alpha firestore databases update --type=firestore-native
This is the response I got from Google Cloud Support today (February 16th, 2021):
Generally, we do recommend to create a new project and enable Firestore therein. Nonetheless I may submit a request to delete your existing database which may allow you to change the database to the desired mode. However, please keep in mind that I’m unable to guarantee it’s approval.
I just tried it on my end. I deleted all my entities (test project) and disabled my Datastore API, same issue as you when I visit the console.firebase.google.com page.
This is likely an issue that needs to be reported either through support (if you have a support package for Google Cloud Platform), or through our issue tracker.
Still the same as of 10 June 2020.
If you have an empty Datastore database and you never executed a write to the database, you can upgrade to Firestore in Datastore mode or Native mode.
If you do not receive this option, then your database instance will be automatically upgraded at a future date.
If you upgrade from Datastore to Firestore in Datastore mode or from Datastore mode to Native mode, you cannot undo the operation.
See this page for additional details:
https://cloud.google.com/datastore/docs/upgrade-to-firestore
If you just want to lock down use the following security rule it will not delete but lock down your firestore so no one can write to it. Its not the answer you are looking for but in the same spirit.
// Deny read/write access to all users under any conditions
service cloud.firestore {
match /databases/{database}/documents {
match /{document=**} {
allow read, write: if false;
}
}
}
Just visit https://console.cloud.google.com/....... by clicking on the button, if you have not added any data it will show option to switch to native

How can we take a backup of the application data from the Google App Engine DataStore?

I read about the DataStore admin, but can't find it in the console. Also, the doc says the feature is experimental?
More clarification:
We have an enterprise application, and we need to be able to take backups of our data at a certain frequency. Since we are using Google App Engine, we need to be able to take a backup off the App Engine DataStore. When I go into the Admin console, I can see the option to view the entities, I see "Dashboard","Query" and "Index" but nothing to take a backup of the DataStore data, say to something like CloudStorage. Also, when I go to localhost:8000/datastore, I see the same.
Datastore Admin is only available to Python applications - or rather, applications with a Python version. If your app is Java, you can deploy an empty/trivial app to a non-default version.
There's a note on this in the docs, here.
At the time of your request it was only available in the old GAE console.
Since few weeks it has been integrated in the new console as well.
Go to Storage/Cloud Datastore/Settings, then the first time you'll have to "Enable Datastore Admin", then you'll have a new button "Open Datastore Admin"

How can I export data from Google App Engine High Replication datastore?

I am looking into using Google App Engine for a project and would like make sure I have a way to export all my data if I ever decide to leave GAE (or GAE shuts down).
Everything I search about exporting data from GAE points to https://developers.google.com/appengine/docs/python/tools/uploadingdata. However, that page contains this note:
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.
The problem is that recently the master/slave datastore was recently deprecated in favor of the High Replication datastore. I understand that the master/slave datastore is still supported for a little while, but I don't feel comfortable using something that has officially been deprecated and is on its way out. So that leaves me with the High Replication datastore and the only way it seems to export the data is the method above that is not officially supported (and thus does not provide me with a guarantee that I can get my data out).
Is there any other (officially supported) way of exporting data from the High Replication datastore? I don't feel comfortable using Google App Engine if it means my data could be locked in there forever.
It took me quite a long time to setup the download of data from GAE as the documentation is not as clear as it should be.
If you extracting data from a Unix server, you maybe could reuse the script below.
Also, if you do not provide the "config_file" parameter, it will extract all your data for this kind but in a proprietary format which can only be used for restoring data afterwards.
#!/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
Currently app engine datastore supports another option also. Data backup provision can be used to copy selected data into blob store or google cloud storage. This function is available under datastore admin area in app engine console. If required, the backed up data can then be downloaded from the blob viewer or cloud storage. For doing the backup for high replication datastore, it is recommended that datastore writes are disabled before taking the backup.
You need to configure a builtin called remote_api. This article has all the information and guide you need to be able to download all your data today and in the future.

Deleting a Google App Engine application

Is it possible to delete an GAE application after it has been created?
I made a mistake while typing the name and now have a dummy application that I haven't been able to remove.
With the new Google Cloud console, you can still disable GAE applications as before (App Engine --> Settings --> Disable). They cannot currently be deleted. However you can delete the entire project by going to IAM --> Settings --> Shut Down. This button is in the header and a bit tricky to spot. It looks like this:
As of AppEngine SDK 1.2.6 it's possible to delete apps completely. But beware, the app-id won't be usable again.
As most of the answers are outdated or contradictive and this is an important question I decided to clarify current possible solutions when intending to delete an application in Google App Engine or having related issues.
Currently, there is no way to delete an existing app in GAE. Once created it cannot be removed, nor its initial settings can be changed (like the region where it was deployed). The only possible workaround is starting a new project and deploying a new application. There were feature requests in Google Issue Tracker regarding these issues: deleting an app and changing zone/region. You can still delete the whole project as described in Steve Armstrong's answer, but bear in mind that this will remove everything you created there (like GCE, GKE etc.), not only GAE.
However, it all depends on why you would like to delete your app. If you would simply like to stop it from serving requests or you don't want it to incur further costs, you can disable the app as described in the GCP docs here.
This feature is already logged, please star it:
http://code.google.com/p/googleappengine/issues/detail?id=335
To disable /delete your application:
In the Administration Console, click your application to make it the active application.
Click Application Settings on the left side under Administration.
Click Disable Application.
Click Disable Application Now.
If you want to delete your app:
If billing is enabled for your app, disable billing. You aren't allowed to delete before you do this.
Click Request Permanent Deletion. The application will be deleted in approximately 72 hours.
To re-enable your disabled application, click Re-Enable Application.
source
There currently isn't a way to delete a GAE application.
Beyond disabling the App Engine application you can:
Disable it's API permission under APIs & Services
Remove the App Engine related files from Storage
Delete App Engine permissions under IAM & Admin
Delete the App Engine Service account
This will freeze all App Engine related billing charges for the undeletable disabled App engine application. At least it worked for me :)
I was evaluating if we could use AppEngine and ran the standard tutorial which created a test app for me under my the default project. When I tried to delete the App I was shocked that it can't be done ! The only way is to delete the project which would delete all other GKE and any other services under that account.
After a bunch of research and calling product support of Google this what they suggested: To upgrade to Silver Support for 150$/month and send them an email to delete the app.
Here is the chat session with Google Support. If you were considering using Google AppEngine I would think again.
This issue has been fixed; see the docs here:
https://cloud.google.com/appengine/docs/standard/python/console/?csw=1#delete_app
Carlos, you're right that the issue has been fixed, and I up-voted you for that. However, your link is a little outdated and an updated link is listed below.
https://developers.google.com/appengine/docs/adminconsole/applicationsettings#Disable_or_Delete_Your_Application
open https://console.cloud.google.com/cloud-resource-manager?organizationId=0 ,select the project(or application) to be deleted,then click delete
I wanted to delete some legacy Google App Engine applications I made years ago, but when I tried to delete them from the new Google Cloud Platform (like this: https://support.google.com/cloud/answer/6251787#shut-down-a-project) I kept getting "You do not have permission" errors. The solution I found was to sign up for a free trial of Google Cloud Platform, then I was able to delete them.
I couldn't find to delete the default app-engine, however if you navigate to App Engine > Settings , there is a button to Disable it and it stop serving. when you click on the button type the project name in the prompt.

Resources