# Go back in time after restoring latest incremental backup

**URL:** <https://forums.percona.com/t/go-back-in-time-after-restoring-latest-incremental-backup/33074>\
**Category:** MySQL & MariaDB\
**Tags:** percona\
**Created:** [September 11, 2024, 12:55pm UTC](https://forums.percona.com/t/go-back-in-time-after-restoring-latest-incremental-backup/33074 "2024-09-11T12:55:23Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![andreaf](https://avatars.discourse-cdn.com/v4/letter/a/ccd318/32.png) [@andreaf](https://forums.percona.com/u/andreaf)\
**Post date:** [September 11, 2024, 12:55pm UTC](https://forums.percona.com/t/go-back-in-time-after-restoring-latest-incremental-backup/33074/1 "2024-09-11T12:55:23Z")

</div>

Hello,  
I’m currently in a situation where I need to backup a 250GB MySQL mixed InnoDB and MyISAM Database. I was wondering if it was the right choice to proceed like this:  
Sunday - Full Backup  
Monday till Saturday - Incremental Backups

After a while of testing we thought it was the optimal solution size-wise, but the reason we are not proceeding to put it in production is the following:  
Let’s take 1 full and 6 incrementals as an example  
In case we need to restore the DB as of day 4, but for some reasons wrongly restore day 5, would it be possible to go back in some ways?  
We tried creating a mirror of the incrementals and prepare the full with them - not working  
creating a mirror of the full and prepare it with the existing incremental - not working  
Copy all the incrementals and the full and use them as a backup of backups - working

The problem with the last choice is of course the size occupied with all these backups.

Any help will be highly appreciated.

Thanks in advance to all

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [September 11, 2024, 3:50pm UTC](https://forums.percona.com/t/go-back-in-time-after-restoring-latest-incremental-backup/33074/2 "2024-09-11T15:50:34Z")

</div>

> [@andreaf](#):
>
> In case we need to restore the DB as of day 4, but for some reasons wrongly restore day 5, would it be possible to go back in some ways?

No, you would have to start over the restore process.

> [@andreaf](#):
>
> We tried creating a mirror of the incrementals and prepare the full with them - not working

Please provide terminal output of commands used and result.

If you are concerned with space, ensure you are using `--compress` option as this will drastically reduce the storage required.

---

<div class="post-metadata">

**Author:** ![andreaf](https://avatars.discourse-cdn.com/v4/letter/a/ccd318/32.png) [@andreaf](https://forums.percona.com/u/andreaf)\
**Post date:** [September 24, 2024, 9:21am UTC](https://forums.percona.com/t/go-back-in-time-after-restoring-latest-incremental-backup/33074/3 "2024-09-24T09:21:09Z")

</div>

Hello Matthew,  
thank you for your answer

> [@matthewb](#):
>
> No, you would have to start over the restore process.

What do you exactly mean by that? If I prepare the full backup with incremental5 how can I start back the restore process? I cannot prepare it with incremental1 because of the error:

This target seems to be already prepared with --apply-log-only.  
This incremental backup seems not to be proper for the target.  
Check ‘to\_lsn’ of the target and ‘from\_lsn’ of the incremental.

> [@matthewb](#):
>
> If you are concerned with space, ensure you are using `--compress` option as this will drastically reduce the storage required.

Thanks a lot for the --compress I didn’t know this option!

Thanks,  
Andrea

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [September 24, 2024, 2:05pm UTC](https://forums.percona.com/t/go-back-in-time-after-restoring-latest-incremental-backup/33074/4 "2024-09-24T14:05:18Z")

</div>

> [@andreaf](#):
>
> What do you exactly mean by that? If I prepare the full backup with incremental5 how can I start back the restore process?

You must prepare the incrementals in order. Example:

- prepare full
- prepare 1st incr (merges into the full)
- prepare 2nd incr (merges into the full+1st)
- etc

Thus, you cannot simply “unmerge” a prepared incremental. You must start over if you realize that you’ve prepared too many incrementals.

**Make a copy of your full backup because the preapre’s of incrementals will modify it!**

---

<div class="post-metadata">

**Author:** ![andreaf](https://avatars.discourse-cdn.com/v4/letter/a/ccd318/32.png) [@andreaf](https://forums.percona.com/u/andreaf)\
**Post date:** [September 24, 2024, 2:10pm UTC](https://forums.percona.com/t/go-back-in-time-after-restoring-latest-incremental-backup/33074/5 "2024-09-24T14:10:47Z")

</div>

I’ve tried to create a copy of the full backup, the problem is that once an incremental have been merged into the full, it would not be possible to use it again on the copy.

So I think it is not possible to “go back” once I’ve restored the wrong full with the wrong incremental merged, right?

Could you explain better what you mean by “start over”?

Thanks and sorry if I’m not comprehending correctly.  
Andrea

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [September 24, 2024, 3:34pm UTC](https://forums.percona.com/t/go-back-in-time-after-restoring-latest-incremental-backup/33074/6 "2024-09-24T15:34:58Z")

</div>

> [@andreaf](#):
>
> I’ve tried to create a copy of the full backup, the problem is that once an incremental have been merged into the full, it would not be possible to use it again on the copy.

Correct. That’s why it’s important to make a copy of your full backup _before_ you do any incremental merging.

> [@andreaf](#):
>
> So I think it is not possible to “go back” once I’ve restored the wrong full with the wrong incremental merged, right?

Correct.

> [@andreaf](#):
>
> Could you explain better what you mean by “start over”?

The steps I mentioned above; you have to start the whole prepare/merge process over starting with the full, then the incrementals.
