Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ideas for how to do an optional backup? #6

Open
justinclift opened this issue Jul 27, 2023 · 2 comments
Open

Ideas for how to do an optional backup? #6

justinclift opened this issue Jul 27, 2023 · 2 comments

Comments

@justinclift
Copy link
Member

At present, the docker container does an in-place upgrade, with no capability for backing things up (just in case).

We should probably support some kind of useful, optional, backup capability.

So far, my initial thinking is to have some environment variable to define a new mount point (PGAUTO_BACKUPDIR or similar), and if that's set to a valid value pointing at an empty directory then we use it.

For the backup type, I reckon we should just go with a "full data copy" approach rather than a pgdump. At least for now.

It should (in theory) be reasonably simple. We'd use that "backupdir" as part of the pg_upgrade file moving process, running the pg_upgrade without the --link option so things aren't upgraded in place.

That way, the backup gets done, and the new database ends up in the correct directory. The downsides are the (potentially significant) extra space that gets used, and the extra time the whole upgrade process will take.

Optimally, we'd probably recommend people use a 2nd bind mounted directory for that "backupdir", so it's not a backup that disappears when the container stops.

Thoughts? 😄

@justinclift justinclift changed the title Ideas on how to do an optional backup? Ideas for how to do an optional backup? Jul 27, 2023
@brbrown25
Copy link

I think it makes sense to have a backupdir option and maybe an auto recover option, so if the upgrade fails it restores the backup into the original location.

@justinclift
Copy link
Member Author

Interesting idea. Yeah, it probably wouldn't be too hard automatically recover the original data back to the starting location.

It'll take some more detailed thinking about when coming to implement it. 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants