PHP Mysql Database Synchronising With Subversion

January 25th, 2009

So I’m back into the developing frame of mind, I tend to have periods of time where all I can think about is development and new ways of coding things and times where the last thing I want to do is Open a .php and edit.We’ve (Me and Hev) been using springloops as a platform for subversion because it solves most of the problems I outlined in the last post about this subject I wrote, Thank you Mr Disley for your suggestion.

For $9 a month its a fantastic service that allows us to work much quicker and use “the cloud” that all those web 2.0 kids are talking about these days. The problem comes with databases, we still lose data and do things wrong when it comes to .sql files and I’m still not 100% sure what the solution is.

We work on three platforms

  •  Our own laptops / computers
  • Our online testbed
  • Our live server

However there’s still a disconnect between editing the database, adding new columns, exporting new users to the db on my laptop so I have a full account of what exactly is on the live, its the one piece that’s missing from our set up and since I asked last time, I’m asking again. 

Just as an aside, its all procedural code in our set up (apart from a small bit of templating) so a fully fledged OOP all singing all dancing system would be wayyyy over my head :) .

Thanks for reading

Related posts:

  1. At What Point To Use A Framework? Okay I admit it, work on the updated version of...

2 Comments

  1. Caius says:

    Have a .sql file with your table setup in it, and another one with your test data in it. Then write a PHP script you run with --create to pull the structure sql into the database, and --populate to pull the data into the database.

    Thats basically all Rails does for its fancy migrations stuff (except it lets you write it in ruby, and handles changing/adding stuff rather than re-creating the whole database each time.)

    You could even add another script into the setup to dump the db schema from the database into the .sql file so you can easily update it (I know you enjoy using Navicat to do your sql stuff.) And then another to read the test data out into its .sql file so you can create a load of data and then easily reload the DB.

  2. Michael says:

    Database synchronicity between my development setup and the live server is my biggest problem too. Unfortunately, I’ve not found a decent solution.

    At the minute, I drop the local database and recreate it by dumping the live site database (Fortunately there’s not much data in there yet)

    Then to keep them upto date, I just run a terminal window with two tabs, one local mysql prompt and one on the server, and each time I run a command locally, I test it works then run it remotely. Not the safest way to do it, but it seems to keep things in sync.

Leave a Comment

If you are using programs like Authority Loophole to spam this blog please piss off and die, comments are moderated and your comment will not get through... so don't bother (you've a better chance of getting your comment accepted if you actually use your real name

  • * denotes a required field

© 2008 - Dominic "The Hodge" Hodgson. Powered by WordPress. Designed by Ryan Taylor (Havoc Inspired)