AWS EC2 - snapshot restore not restoring data

0

Hi guys, so I have instance and AWS Backup for daily snapshot. Today during development of website I faced some issues and I wanted to restore data form night before. So I created volume from snapshot, detached current one and attached new one. I started instance, open website but issue this issue was still there. Looks like snapshot have data not from night before but from few seconds before restoring. Also my volume is encrypted Any idea what is going on?

profile picture
asked 3 months ago684 views
6 Answers
1
Accepted Answer

That means that the data on the restored volume is as it was on the original volume at 1:30 a.m. It is physically impossible for EC2 to have known at 1:30 a.m. how you'd change the data hours later, which was in the future when the snapshot was created at 1:30 a.m.

Are you logged on to the server with SSH or RDP and looking at the files on the disk? Or are you only loading the website with your web browser? If you're accessing the website, make sure all relevant caches are refreshed. For example, clear the cache of your web browser, and if you're using CloudFront as a caching layer in front of your website, start an invalidation process in the CloudFront distribution for the URL or URLs that you need to refresh content for.

If you have a self-managed caching layer, such as a varnish cache in front of your site, or a backend caching layer used by your website, such as a memcached cache, also refresh it.

EXPERT
Leo K
answered 3 months ago
profile picture
EXPERT
reviewed 3 months ago
profile picture
EXPERT
reviewed 3 months ago
0

The data is from exactly the time that the snapshot shows as its creation time. If you want earlier data, you'll need to choose an earlier snapshot.

EBS volumes should nearly always be encrypted. Your admin has probably set your AWS account to use default EBS encryption in the region where you're operating, and that would cause all new volumes (including those created from unencrypted snapshots) to use encryption. This is completely correct, and you shouldn't look for a way to have your EBS volumes unencrypted.

EXPERT
Leo K
answered 3 months ago
0

Actually I am a main admin and snapshot is created form encrypted volume. But I make some change today around 5pm of my time and then I decided to restore from last night so 6.07 1:30am my time. So I created a new volume from this snapshot, detached previous one and attached new one so expectation is that those changes that I made today at 5pm will be gone. But not in this case. After mounting new volume from snapshot from last night, this chagne was still there

profile picture
answered 3 months ago
0

Encrypted snapshots always produce encrypted EBS volumes, so again, that's expected and correct, and unrelated to your issue.

Open the details of the volume that is currently attached to your instance. Refresh the console to be sure you're looking at the current data. In the EBS volume's properties, you can find the snapshot ID from which it was created. Open the Snapshots view in the console and search for that snapshot ID. In the properties of the snapshot, you can see the exact time at 1-second precision when the snapshot started to be created (regardless of when it completed), and that's the data that is on the restored volume.

If the contents of the volume don't match your assumptions, it's necessarily your assumptions that must be in error.

EXPERT
Leo K
answered 3 months ago
0

I double checked that. IDs are correct. I selected snapshot from 1:30am last night. All looks totally correct in console. Snapshot volume ID matched current mounted volume, time is right. All is correct. So thats why my confusion, how data are still the same?

profile picture
answered 3 months ago
0

Actually I log in to website and yeah, could be caches. I forget about it. But now I have confirmation that backup is restoring correctly and maybe this changes are in database which is in separate instance so maybe thats why but I am waiting for confirmation from CMS developer. Ok, thank you for that :)

profile picture
answered 3 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions