Overview
Datastore Admin backup is being phased out, so using the new managed exports functionality, although the same principles apply.
Create a new project, let's call it staging
. Import the full backup into staging
. Create a new export from staging
for just the namespace or kind you want. Import this new export into your original project.
Commands
A full export in the new system is achieved as such:
gcloud datastore export gs://${BUCKET}
When exported like this, there isn't a direct method to import select parts, so you need to switch project, then import it a staging project. The importing command is straightforward:
gcloud datastore import gs://${BUCKET}/[PATH]/[FILE].overall_export_metadata
[PATH] can be found from the results from the export command, or browsing your Cloud Stage bucket in the console. [FILE] is the same as [PATH], but you can confirm in the UI.
Now, export the just the namespace you want from the staging project
:
gcloud datastore export --namespaces="Namespace_3" gs://${BUCKET}
You now have an export with just the namespace you want, and can import it back into the original project.