-1

I have a MySQL DB which should be versioned with SVN. I dont want the full DB, only the structure and selected tables. I searched the net and found some information, but nothing seems to really work in a reliable way. Any experience or hints?

Thanks :)

EOB
  • 2,975
  • 17
  • 43
  • 70
  • Have a read of this question / answer - suggests possible solutions http://stackoverflow.com/questions/1783834/mysql-version-control-subversion – Manse Jan 04 '12 at 10:40

3 Answers3

2

Check out this script which automates the process, allowing for specific selection of databases and exclusion of tables [disclaimer I am the author] - http://mysql-svn-backup.redant.com.au/

Sam Bauers
  • 403
  • 3
  • 5
1

Use mysqldump to export the data you want into a file and put this into SVN. Using cron, you can automize this to run in specific timeslots

Community
  • 1
  • 1
Nico Haase
  • 11,420
  • 35
  • 43
  • 69
0

The question is: what exactly do you want to version, and why?

I propose you version an SQL file that you can import to create your database. Any tool can be used to create this SQL file (basic tool: mysqldump), which you can then save into your SVN repository. You will be able to track new tables being created by comparing revisions of SQL files.

You can automate this process by adding a CRON job to automatically dump and commit the file every 2 hours.

parasietje
  • 1,529
  • 8
  • 36