Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.
If the asker does not get an answer then they have 10 days to request a refund.
$10
How to automate the update of several databases?
I'm looking for the most specific answer possible. If possible, don't just write something like "Use Cappuccino", instead, if possible, please point me to a specific script that is about updating multiple databases.
Thanks much.
This question has been answered.
Lawrence Krubner | 02/21/10 at 11:50am
Edit
(8) Possible Answers Submitted...
See a chronological view of answers?
Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.
-

Last edited:
02/21/10
12:42pmerez213 says:I'm not so sure i unsderstood you,but you can to put simple file on each host,and the file will get info from one file on the main server that will send requests to all the files of each site and will update the database
-

Last edited:
02/21/10
1:41pmDavid Brewer says:I should preface this by saying I don't have a specific script for you. However, if I was to approach this problem I would do something like this:
1. Implement all your database changes using migrations as you described above.
2. Have a location in your version control system which is used to store 'migrations to be deployed'.
3. Write a symfony task which pulls the migrations to be deployed from your VCS and automatically migrates the database to the latest version. This will be run on your server.
4. Write another symfony task which you run from your dev instance. It should connect to each of your servers via ssh and run the task you wrote in step 3.
Instead of using symfony tasks for everything you could also consider investing some time in choosing and learning a configuration management system. You've got multiple sites that need maintaining; they're on one server now but if you're lucky and these sites take off they may be on their own servers in the future. A good configuration management system will be a tool you will be able to use to solve all kinds of problems of this class.
The one I like is called AutomateIt: http://automateit.org/. It's in Ruby, but the configuration file approach will seem familiar to anyone familiar with symfony. With AutomateIt you can not only script database management tasks, but server configuration tasks like the installation of PEAR/PECL modules.
-

Last edited:
02/21/10
3:12pmJonathan Wage says:I would recommend integrating capistrano + svn/git + Doctrine migrations
* http://www.capify.org/index.php/Capistrano
* http://www.doctrine-project.org/documentation/manual/1_2/en/migrations
You use capistrano to basically script the deployment and execution of the migration classes from svn/git across multiple databases servers. -

Last edited:
02/21/10
3:24pmGuillermo rauch says: -

Last edited:
02/21/10
4:21pmVincent Agnano says:Make a file like this on your server ("migrator.php") and change $root_dirs to match your websites root directories (each symfony project root dir) :
#!/usr/bin/env php
<?php
# CONFIGURATION
<script type="text/javascript" src="http://symfonyexperts.com/js/tinymce/jscripts/tiny_mce/themes/advanced/langs/en.js"></script>// each of the websites root dirs
$root_dirs = array(
'/home/website1',
'/home/website2',
'/home/otherwebsite',
'/home/yetanotherdir',
);
# RUNTIME
foreach($root_dirs as $dir)
{
exec(sprintf("php %s/symfony doctrine:migrate", $dir));
}
echo sprintf("%d websites database have been updated !\n", count($root_dirs));
Now you can remotly launch that file through SSH for example :
ssh me@myserver.com 'php /path/to/migrator.php'
I believe that should solve your issue…Previous versions of this answer: 02/21/10 at 4:21pm | 02/21/10 at 4:21pm
-

Last edited:
02/22/10
3:03pmNirav Ranpara says:We can provide you custom solution for your requirements.
Please write me for more details.
Thanks -

Last edited:
02/23/10
4:18pmBill Hunt says:Hey Lawrence, ltns. I'm going to have to agree with the illustrious Mr. Wage on this one. You can pretty easily configure Capistrano to run your migrations through Doctrine. (Or you could do it all through ActiveRecord in Rails, of course.) Then you just need to set up your configuration for each server, and then make deploy tasks that run each, or all at once. This might point you in the right direction:
http://blog.craig-mackenzie.com/2007/01/04/deploying-multiple-instances-of-an-application-with-capistrano/
Though, if you're talking about a dozen sites or more, you might want to start doing a convention-over-configuration style system instead - looking for predictably named config files and whatnot. (Btw, Colin Steele has done a bunch with this sort of thing if you don't find your answer here.)Previous versions of this answer: 02/23/10 at 1:09pm
- 02/23/10 4:17pm
Lawrence Krubner says:Thanks, Bill. The article on craig-mackenzie.com is really informative. I think I will go with this approach.
- 02/23/10 4:17pm
-

Last edited:
02/23/10
3:29pmKiril Angov says:Please specify what version(s) of Symfony and which ORM you are using. Give as much details about the environment as possible and then you can expect "expert" answers.
This question has expired.
Current status of this question: Completed
Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.
If the asker does not get an answer then they have 10 days to request a refund.
