Duplicating Database For Local Development I've recently started putting some Drupal installations in to source control. Editing modules and the like is pretty easy since they're obviously just text files. I run in to issues with the database though.

My current idea is to run a cron job to pull in database from the live server every night to keep things up to date.

The current method is to just drop the local db and then mysqldump the live one on to my local machine.

I'm pretty sure doing it the way I currently am could cause me to lose things like content types and fields if I make new ones on the local machine and then the 'outdated' live db gets pulled in.

What is the best way to approach this situation?
It's important to understand the differences between the data of your site and the structure. You probably don't need all the data (new nodes, user information...) updated every day in your development site, What you need is to upload the new structural changes to your live site once you reach a stable point in your development.

I've been using a combination of git + features to develop my sites and keep them in sync between develop and live enviroments. With Features you can upload the structural changes to your live site without overwriting the database. When you reach a stable point in your development site you prepare a feature with the changes (content type, image style, views... whatever), save it to code and upload to your live site with the source control program. 

Then only sometimes, when the content difference really is important I download the database to my local site, usually with drush.