backup-utils icon indicating copy to clipboard operation
backup-utils copied to clipboard

Feature: Allow overriding config values on restore

Open rtomayko opened this issue 10 years ago • 2 comments

Originally requested in https://github.com/github/backup-utils/pull/96#issuecomment-100132031:

I'd like to make a feature request for overriding a single parameter when restoring: the hostname. The hostname is used to identify the instance within collectd - restoring a the configuration with github.example.com will mess with the monitoring setup.

It'd be a huge win to be able to override certain crucial config values on restore before a config run and without having to visit the management UI. The hostname is an obvious one but I've also wanted to toggle things like email, log collection, and snmp being enabled for staging environments.

In GHE 2.2 we moved to a new config file format that's based on git-config(1). If backup-utils were to add git as a dependency, we could modify the config fairly easily before restoring. The new config file format is also designed to be much more human friendly so human editing and passing a copy of the config file directly via something like ghe-restore -f modified.conf ... should be possible as well.

rtomayko avatar May 11 '15 13:05 rtomayko

Bump.

We just had an outage due to not being able to do this. When restoring a production snapshot the test instances have the production hostname on the command line until the config is changed and applied.

In the process of doing that work in dev an engineer took down a production instance. They were expecting the prompt to look like a prod instance, even though it's in dev. This is extremely dangerous for obvious reasons.

Changing that hostname value during the restore, rather than after, would mitigate that risk.

fenixnet-net avatar Sep 09 '22 00:09 fenixnet-net

For an interim solution, it us possible to carefully edit the settings.json file as desired within the a snapshot directory prior to restoring to a test or staging appliance.

djdefi avatar Sep 19 '22 20:09 djdefi

After careful review of this request, we've determined that it would be difficult to implement this feature given how the hostname field is implemented. The restore logic doesn't account for all locations of where this field exists.

We'll continue to research ways to get similar functionality implemented into Backup-Utils - the benefit of using this against test instances and reducing risk associated with operators confusing test/dev instances vs. production is important to us.

michaelsainz avatar Oct 06 '22 21:10 michaelsainz