Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Recover application code in an e2 instance (Ubuntu 20)

Hi,
We have our NodeJs application server running inside an e2-small instance. We had a major chunk of code running in this instance that was not traced by any VCS like git.

By mistake, our new deployment through GitHub Actions caused the cleanup of this code resulting to deletion of this code. This code was very important for us and contain our business logic and we need to recover it from this instance.
Can we recover a snapshot of this instance from GCP, or how can we recover deleted javascript code files from this Linux machine?

Solved Solved
2 1 250
1 ACCEPTED SOLUTION

Hi @deepak123,

Welcome to the Google Cloud Community!

In Google Compute Engine, snapshots of virtual machine instances are not created automatically. Instead, they must be configured and managed either manually or through a scheduled process. You can double check if you have a snapshot in this documentation - View key version.

You can also consider using third-party data recovery tools like TestDisk, Scalpel, Extundelete, and Foremost.

You may find the following guides below helpful:

Moving forward, you may schedule regular snapshots of your VM to prevent cases like this. I hope this helps. Thank you. 

View solution in original post

1 REPLY 1

Hi @deepak123,

Welcome to the Google Cloud Community!

In Google Compute Engine, snapshots of virtual machine instances are not created automatically. Instead, they must be configured and managed either manually or through a scheduled process. You can double check if you have a snapshot in this documentation - View key version.

You can also consider using third-party data recovery tools like TestDisk, Scalpel, Extundelete, and Foremost.

You may find the following guides below helpful:

Moving forward, you may schedule regular snapshots of your VM to prevent cases like this. I hope this helps. Thank you.