-1

I have a question regarding staging environments for databases. I started as a web developer and have been maintain my websites with GIT, which allows me to have a staging environment and thus I have rollback possibilities if there are major mistakes.

My database has been growing, and just last week I had a major issue that took me hours to fix, which makes me want to look for options to create a staging environment for my MySQL database, but so far I have not found a possible choice like GIT. I want to prevent errors like the ones last week and knowing that my DB is going to increase I clearly need to find an option before is too late.

Are there any good staging options for DB as what we can do with GIT? Are there any other options, such as third party options that can allow me to create a staging environment for my DB?

Tavo
  • 173
  • 1
  • 15

1 Answers1

0

Use mysqldump to periodically backup your database as often as you want. I generally do this nightly, then if I discover something wrong, I can at least rollback to a stable condition.

Keep in mind that this is most useful when combined with a networked file system to prevent data loss in the event of a hardware failure.

Depending on the nature of your issue and how you go about fixing it, you should be using a separate database for development and testing.

Jeff Puckett
  • 37,464
  • 17
  • 118
  • 167
  • Thank you for the suggestion @jeff-pucket-ii, however do you have a suggestion when it comes to work with more than one developer? If it was just myself that will be great but when I have 3 people working on the DB having a staging alternative seems like the better approach. – Tavo Jul 06 '16 at 13:43
  • You all need to have your own development & testing database, for sure. Backup the production db regularly. – Jeff Puckett Jul 06 '16 at 14:47