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. Version control Access 2007 database and application
  3. How do you store static data in your SQL Server Database Project in VS 2012
  4. Is there a version control system for database structure changes?
  5. Verify database changes (version-control)
  6. How can I upload a DB to Heroku
  7. Mechanisms for tracking DB schema changes
  8. Will this potentialy make my repo huge (the database is 16mb)

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

  10. Any other suggestions?

  • Git: How to update/checkout a single file from remote origin master?
  • How do I use Github to access the same project files from different computers?
  • Microservices: How to store source code of many microservices?
  • Is there a shorthand for the previous version of a file in Git?
  • GIT equivalence of SVN Changelist?
  • Pushing large commit to GitHub results in a fatal write error: Bad file descriptor
  • 4 Solutions collect form web for “Storing Drupal SQL in Git”

    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.

    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.

    For my database applications, I store scripts of DDL statements (like CREATE TABLE) in some sort of version control system. These scripts sometimes include static “seed” data as well. All the version control systems I use are good at recognizing differences in these files, and they are much smaller than the full database with data.

    For the dynamically-generated data, I store backups (e.g. from mysqldump) in an appropriate location (depending on the importance of the data, that may include offsite backups).

    1) It’s all text, so GIT will just see it as it would any other file.

    2) No, due to the above it should add 16mb to the repo (or less, due to GITs own compression), it won’t add a new file every time, just the changes, so the repo will change by the size of the additions to the repository

    3) No, or GIT won’t be able to see the differences – GIT does it’s own compression anyway

    Git Baby is a git and github fan, let's start git clone.