1

Everyone is recommending the use of git, automated tests, continuous integration, automated deployment and so on, to reduce human error during all stages of web development. I have yet to come across a clean, automated way of doing this for databases. Currently, I'm using the Symfony2 framework for PHP and doctrine to create/manage my users database in MySQL. How do I make sure that my users & orders databases will always remain safely backed up without manual intervention?

1
  • Questions about the management of a database should be asked on Database Administrators
    – Mike W
    Feb 3, 2014 at 0:27

1 Answer 1

3

You can dump databases with a cron job, but your database schema should be under version control just like all the other code.

For MySQL, see mysqldump.

Copy or move the backup files to a safe place. (Or to two different safe places.) The database server is not a safe place.

1
  • Not just the schema should be under version control, but migration scripts to modify your schema from one version to the next, handling data modification as necessary. There are many tools for this.
    – Chris
    Feb 3, 2014 at 1:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy