TheGerbil
TheGerbil

Reputation: 31

Point-in-time recovery Google Cloud SQL can't find a successful backup

We're running a Google Cloud SQL instance and I accidentally re-migrated a database over the top of the live database 14 days after it was initially migrated using the same mysqldump file - essentially rolling it back 14 days!

So I'm piecing data in the tables back together as new entries are using increment IDs previously used [thats not a problem] but I need to spin up a clone of the database from the moment just before I dropped and loaded the database.

I've got the point-in-time I need to use using:

mysqlbinlog --read-from-remote-server -v -uusername -ppassword mysql-bin.000001 -h 000.000.000.000 -P 3306 --start-datetime="2016-09-20 14:45:55" --stop-datetime="2016-09-20 14:47:00"

But when I put in the Binary log file name mysql-bin.000001 and the Recovery position 70869547 (found from scanning through the mysqlbinlog result) it responses with:

"A successful backup for carrying out the operation was not found."

It prompts to wait for the next daily backup, but the last backup was just 3 hours ago and I tried the same yesterday...

Any thoughts on why this would happen?

Upvotes: 1

Views: 985

Answers (1)

TheGerbil
TheGerbil

Reputation: 31

Ok, I think its simply that I'm trying to recover the data back to the 20th and the oldest backup is the 21st! Google only keeps 7 days worth of backups. But I hope that the method above helps someone find their backup point quicker in future.

Upvotes: 1

Related Questions