5

I've been using etckeeper on my Digital Ocean droplet for sometime and have made numerous changes to the /etc since that time.

I now realize that i've been using bzr all this time and would like to switch to git; but fear that i shall loose all the incremental changes i've made to my /etc directory.

Is there ANY way to not only switch from bzr to git, but convert bzr's incremental changes to git as well?

Thanks!

Quasaur
  • 165
  • 6
  • [This](http://daniel.hahler.de/convert-etckeeper-repository-from-bazaar-to-git) was the top google result I got for 'migrate etckeeper bzr to git' - have you tried the steps there? It sounds like it should be possible. You can always make a backup of /etc somewhere first and test to see if the conversion works as you expect. – mvermaes Nov 03 '14 at 11:57
  • @mvermaes: Your comment reads like a "let me google that for you", which is frowned upon. Please convert the gist of the answer on that page into an answer here, – Martin Schröder Nov 04 '14 at 13:54
  • Yes, I can see how my comment could be interpreted in that way, and I apologize if it was. I haven't performed that type of migration with etckeeper myself before, so I felt it was better to leave the suggestion as a comment rather than a definitive answer. I'll put up an answer with that caveat. – mvermaes Nov 04 '14 at 18:04
  • I tested out the process from that link, but wasn't quite able to make it work, so I've deleted my answer for now. – mvermaes Nov 05 '14 at 04:21
  • The git book contains the answer how to convert lots of SCMs to git: "[9.2 Git and Other Systems - Migrating to Git](https://git-scm.com/book/en/v2/Git-and-Other-Systems-Migrating-to-Git)". It is as close to the official solution as someting can be. – grin Jan 18 '18 at 08:05

1 Answers1

2

You can export the bzr history into git by

cd /etc
git init
bzr fast-export --plain . | git fast-import

Then just reconfigure etckeeper to use git (set VCS="git" in /etc/etckeeper/etckeeper.conf).

The above commands require the fastimport plugins to be installed in bzr and git.

Andrew Schulman
  • 8,561
  • 21
  • 31
  • 47