Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Storing Drupal SQL in Git

I have a drupal site, and I am storing the codebase in a git repository. This seems to be working out well, but I'm also making changes to the database. I'm considering doing periodic dumps of the database and committing to git. I had a few questions about this.

  1. If I overwrite the file, will git think it is a brand new file or will it recognize that it is an altered version of the same file.

  2. Will this potentialy make my repo huge (the database is 16mb)

  3. Can I zip this file? or will this mess Git up ... the zipped version is only 3mb

  4. Any other suggestions?

like image 386
user379468 Avatar asked May 19 '11 17:05

user379468


2 Answers

If you have enough space, a non-compressed dump in source control is pretty handy because you can compare using a diff program what rows were added/modified/deleted.

like image 111
wildpeaks Avatar answered Sep 18 '22 10:09

wildpeaks


Another solution is to use the features module which is supposed to capture drupal config in code. It stores this captured data as a feature module which you can put into version control.

like image 23
Donnyboy Avatar answered Sep 19 '22 10:09

Donnyboy