473,394 Members | 1,944 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

CVS for Databases?

Hello! I have developing a PHP/MySql web application with a team. We
are all located in different locations, so we cannot have anything
running on one local server.

We have a CVS setup on a virtual host for the php files, and that has
been working out great. Everyone has a local copy of the site, that
they can work on without being connected to the net and when they are
done working on something, they commit it to the cvs and then everyone
can get it from there.

The problem we have been having is keeping all of our local mysql
databases in sync. We each have a local php/mysql setup running (with
something like wamp). And once in a while while coding, we update the
local database...and after a week or two, we all end up with different
databases.

Is there some way that we can keep our database in sync (other than
hosting the database on the virtual host, because we want to be able to
work on this site when not on the internet (like in an airplane))? Is
there some way to "CVS" a database?

BTW, We have tried using phpmyadmin to dump the entire database to a
sql file and sending that to everyone, but it is a real pain updating
databases in that way because when you try to import that sql file back
on another database, phpmyadmin will timeout, so we have to break down
the file into smaller files etc.

If someone could point me to a good free/open source solution to this
problem, I would be grateful. If you need me to clarify the problem
further, please do not hesitate to ask. Thank you!

- Nimit

Aug 9 '05 #1
4 2634
Nimit (ni********@gmail.com) wrote:
: Hello! I have developing a PHP/MySql web application with a team. We
: are all located in different locations, so we cannot have anything
: running on one local server.

: We have a CVS setup on a virtual host for the php files, and that has
: been working out great. Everyone has a local copy of the site, that
: they can work on without being connected to the net and when they are
: done working on something, they commit it to the cvs and then everyone
: can get it from there.

: The problem we have been having is keeping all of our local mysql
: databases in sync. We each have a local php/mysql setup running (with
: something like wamp). And once in a while while coding, we update the
: local database...and after a week or two, we all end up with different
: databases.

: Is there some way that we can keep our database in sync (other than
: hosting the database on the virtual host, because we want to be able to
: work on this site when not on the internet (like in an airplane))? Is
: there some way to "CVS" a database?

: BTW, We have tried using phpmyadmin to dump the entire database to a
: sql file and sending that to everyone, but it is a real pain updating
: databases in that way because when you try to import that sql file back
: on another database, phpmyadmin will timeout, so we have to break down
: the file into smaller files etc.

: If someone could point me to a good free/open source solution to this
: problem, I would be grateful. If you need me to clarify the problem
: further, please do not hesitate to ask. Thank you!

: - Nimit

Are you referring to the data within the database, or the database
structures (table definitions etc)?
--

This space not for rent.
Aug 9 '05 #2

After dumping out the database, why rely on phpMyAdmin to re-import it?
Why not just do:

mysqladmin -u root create somedatabase
mysql -u root somedatabase < somedatabase.dump
--
macbri
------------------------------------------------------------------------
macbri's Profile: http://www.macosx.com/forums/member.php?userid=34415
View this thread: http://www.macosx.com/forums/showthread.php?t=237146
macosx.com - The Answer to Mac Support - http://www.macosx.com

Aug 9 '05 #3
Here's how we handle this:

First of all, we have our production database. Presumably, any changes
you make to the development database will ultimately need to be made in
production.

For each release, we have a "fix" directory that contains all the
scripts necessary to "upgrade" the production database to the next
release. In our case, we have individual scripts for each
table/view/stored procedure/etc. that needs to change. There is also a
release script, which basically just calls all the individual scripts
in the right order. This whole directory is stored in CVS. As people
need to change stuff in the DB, they either create a new script or
update an existing script -- then make sure it's called in the release
script.

So, at any point, you can restore a backup of production, then run your
release script. This brings the whole database up to the next release.
It also allows you to catch errors in the script(s), which is good
since they will ultimately run against a production database.

Some of us also run instances of the database server on our local
machine. If you do this in conjunction with a webserver, everyone can
have their own, local mirror of production on which to do development.

To synchronize your databases, simply load up a recent production
backup onto your local box, update your CVS directory containing all
the fixes, then run the fix script. Voila!

Aug 10 '05 #4
I use these bash scripts to commit DB changes to CVS:
//----Dump DB--------------------------------------
#!/bin/sh

clear

db[0]="db_bplot"
db[1]="db_jobs"
db[2]="db_print_supplies"
db[3]="db_tracker"
db[4]="db_intranet"

for x in "${db[@]}"
do
echo -n "Dumping $x..."
mysqldump -u XXX -pXXX --add-drop-table -B $x > $x.sql;
echo " Done."
done

echo -n "Creating dbs.tar.bz2..."
tar cjpf dbs.tar.bz2 db_*;
echo " Done."

for x in "${db[@]}"
do
rm $x.sql;
done
//-------------Import DB--------------------------------------------
#!/bin/sh

clear

db[0]="db_bplot"
db[1]="db_jobs"
db[2]="db_print_supplies"
db[3]="db_tracker"
db[4]="db_intranet"

echo -n "Extracting dbs.tar.bz2..."
tar jxf dbs.tar.bz2
echo " Done."

for x in "${db[@]}"
do
echo -n "Updating $x..."

mysql -u XXX -pXXX --execute="drop database $x"
mysql -u XXX -pXXX --execute="create database $x"
mysql -u XXX -pXXX < $x.sql
rm $x.sql

echo " Done."
done
Hope this helps!

Aug 10 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Gary L. Burnore | last post by:
REQUEST FOR DISCUSSION (RFD) unmoderated group comp.databases.mysql This is an invitation to discuss the following proposal to create newsgroup comp.databases.mysql. Please note that YOU CANNOT...
8
by: William Drew | last post by:
REQUEST FOR DISCUSSION (RFD) unmoderated group comp.databases.mysql This is an invitation to discuss the following proposal to create newsgroup comp.databases.mysql. Please note that YOU...
0
by: Cara | last post by:
LAST CALL FOR VOTES (of 2) unmoderated group comp.databases.etl Newsgroups line: comp.databases.etl Extraction, transformation, loading issues. Votes must be received by 23:59:59 UTC, 12 Dec...
1
by: Hai-Chu Hsu | last post by:
Hi, I want to restore my databases from the old SQL Server installation into a new installation of SQL Server. My new installation of SQL Server has different data path from the old...
0
by: Cara Altman | last post by:
REQUEST FOR DISCUSSION (RFD) unmoderated group comp.databases.etl This is a formal Request For Discussion (RFD) for the creation of a world-wide unmoderated Usenet newsgroup...
3
by: Amit | last post by:
Hi when I try to run LIST ACTIVE DATABASES AT DBPARTITIONNUM <partnum> or LIST ACTIVE DATABASES GLOBAL, I always get an error message. Does anyone know why? I'm on v8 fp 5 output : db2 => list...
1
by: com | last post by:
Extreme Web Reports 2005 - Soft30.com The wizard scans the specified MS Access database and records information such as report names, parameters and subqueries. ......
6
by: Andy | last post by:
Someone posted this official proposal to create comp.databases.postgresql.general again. He wrote his own charter. As far as I know, he did not consult any of the postgresql groups first. There...
6
by: Tjerk Wolterink | last post by:
Don't know wether this is the right newsgroup, anyways: Has anyone some experience with Native XML Databases. Im planning to use this: http://exist.sourceforge.net/ It has many advantages...
3
by: AK | last post by:
Hi Our product uses MS-SQL Server 2000. One of our customer has 10 installations with each installation stroring data in its own database. Now the customer wants to consolidate these databases...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.