Restoring gateway deletes git files

Restoring a gateway backup deleted the git repository at C:\Program Files\Inductive Automation\Ignition\data\projects. Ideally restoring a gateway backup would preserve any git files allowing the restore to trigger a new local commit.

Maybe I should implement git in another way? I am developing on a laptop with internet access and can connect my local machine's git to my employer's git, simultaneously handling version control and data backup. The development is for an OEM who is building the machine, and I'd prefer not to connect their machine to my employer's git repository. Most of the time I send gateway backups for the OEM to restore. Occasionally they make an edit that should be retained, which is why I'd like to restore a backup without breaking git.

Does the forum recommend I approach git integration differently? Or should I move this over to a feature request that restoring a gateway backup uses something like a .gitignore file to retain the git repository?

That seems awfully fragile. A totally unrelated backup could be restored. If you are using git, you should be pulling or fetching or checking out, not ever restoring a backup. No importing projects at the gateway over an existing project either, I would think.

I would go so far as to complain that the behavior you want, if implemented, is a bug.

@pturmel how do you recommend handling the offline edits from the OEM as they build the machine get reintroduced into a git managed version?

I would:

  • Restore into a separate machine.
  • rsync from that machine's project data to dev machine with options to ignore .git folders and report deletes. Possibly for selected projects only.
  • export, tidy, and diff global resources like tags. Apply selectively as appropriate.
  • make new commit on dev machine.

Possibly script the above for non-binary resources directly from the gateway backup file.

1 Like

@pturmel Thanks!