Restoring emptied /etc/postfix/virtual using rebuild-map

I believe that the etckeeper is a git repo if that is any help.

Yes it is so you just from previous commits. If you don’t know how to use git it would be worth reading up on how it works https://etckeeper.branchable.com/ may give you some clues on how to use it. But you can just use standard git commands to restore the the file e.g git restore postfix/virtual.db things to bare in mind are run git in the etc directory and be aware the file you want to restore is not the latest commit so you may want to review the git history to pin point the exact revision you wish to restore

1 Like

No. config-system does initial configuration of services, it does not spawn missing data out of thin air.

If your etckeeper git repo is valid, you can restore the lost files.

If not
you probably need to disable mail for each user and then re-enable it. I think? It would be much better to restore the file from a backup of some sort. If you don’t have backups, but you have a valid git repo managed by etckeeper, that’s the best option.

Please keep backups! I’m begging!

@Ilia implemented a virtualmin command for interacting with the etckeeper git repo, but I don’t remember what it’s called and can’t find it in a quick search (and I find it more confusing than using git directly, as I’m familiar with git).

With it being so useful, do you think a wiki page explaining how to practically use etckeeper could be made?

root@debian13-pro:~# virtualmin | grep Git
list-config-backups       Lists configuration file backups from Git
restore-config-backups    Restores configuration file backups from Git

Perhaps the command descriptions could be clearer though. I used Git rather than etckeeper in the description because this feature can work with just any .git/ directly, without requiring etckeeper.

You’re right. I’ll work on improving the documentation. It’s actually quite straightforward—much simpler than using Git directly for this specific scenario.

1 Like

etckeeper is just a set of tools to commit /etc (or anything) automatically to git.

You don’t really interact with etckeeper. You interact with git. If you know git, you know how to interact with the etckeeper-managed /etc git repo.

And, everybody should learn how to use git. It’s the most valuable software in the world. (Revision control, in general, is the most important tool for anyone who uses computers seriously, and git is by far the dominant revision control system. Though there are other options, and etckeeper works with some other options, I think. Mercurial is a respectable competitor. But, just learn git, you’ll be fine.)

But, we certainly should have good documentation for every virtualmin command.

Ilia, it’s weird to call a git repo config-backups. They’re not backups. They’re revisions.

1 Like