views:

141

answers:

2

When reading about and playing with Rails last year, one of the tools that made the biggest impression on me was Rake. A database versioning system that keeps all dev db's identical integrated right into the build...something like that would make life so much easier (and safer)!

However, one of the things that I haven't been able to figure out: How do you move these changes to your production servers when you don't actually have access to the production servers? We have multiple servers across the country that where the application is installed/upgraded by a setup package.

Note: This question is more about strategy than Rails/Rake specific technologies. We don't use rails, we use .Net. But if I can figure out this publish scenario, there seem to be several tools Migratordotnet being one that might enable us to do something similar.

+1  A: 

You might be able to use something like Red Gate's SQL Compare to produce schema diff scripts that would allow you to automate the process of updating the database. I've used the tool manually to do such changes and could easily see creating a program that would run these updates as part of upgrade process. If I were going to automate it, though, I'd design in something that would enable me to check what version of the schema was in place and run the necessary scripts in the proper order to bring it up the the desired version.

tvanfosson
Thanks. I've got a compare tool and we use it to manually integrate the changes. But Rake really took the pain out of moving up or down versions, which is what got my interest.
Aaron
+1  A: 

As you probably know, the standard Rails way of running migrations in production is Capistrano. It has a deploy:migrations task that runs the migrations on remote servers using ssh.

You might be able to adapt Capistrano to do what you want. It's essentially a flexible way to run commands on groups of remote servers. You need to have Ruby installed on the machine you are deploying from in order to use it, but not on the machines you are deploying to.

Your best option may be to write a custom Capistrano task to upload the setup.exe, run it, then run the migrations (perhaps using Migrator.NET).

Sarah Mei
That's what I was missing....I will check Capistrano out. Thanks!
Aaron