Search code examples
google-cloud-platformlocalhostemulationrestoregoogle-cloud-spanner

How to import google cloud spanner data into local emulator environment?


I exported a spanner database on google cloud spanner UI page. Saved it to cloud storage. Also downloaded it to local environment.

I found a backup/restore guide here, it's for real cloud environment.

If import the data to spanner emulator, how to do?


Solution

  • That is currently not possible:

    • The Spanner emulator will always start without any instances and databases.
    • Any database that you create will always start out empty
    • The emulator does not support backup and restore operations
    • Any data that you create while the emulator is running will be lost when it is shut down