Alex Rivera | Logout

Collaborating on websites with relational databases and a CMS

Asked 2011-02-26T15:00:10.070
11

What processes do you put in place when collaborating in a small team on websites with databases?

We have no problems working on site files as they are under revision control, so any number of our developers can work from any location on this aspect of a website.

But, when database changes need to be made (either directly as part of the development or implicitly by making content changes in a CMS), obviously it is difficult for the different developers to then merge these database changes.

Our approaches thus far have been limited to the following:

  • Putting a content freeze on the production website and having all developers work on the same copy of the production database
  • Delegating tasks that will involve database changes to one developer and then asking other developers to import a copy of that database once changes have been made; in the meantime other developers work only on site files under revision control
  • Allowing developers to make changes to their own copy of the database for the sake of their own development, but then manually making these changes on all other copies of the database (e.g. providing other developers with an SQL import script pertaining to the database changes they have made)

I'd be interested to know if you have any better suggestions.

We work mainly with MySQL databases and at present do not keep track of revisions to these databases. The problems discussed above pertain mainly to Drupal and Wordpress sites where a good deal of the 'development' is carried out in conjunction with changes made to the database in the CMS.

Edit
Report

2 Answers

0

You can use the replication module of the database engine, if it has one.
One server will be the master, changes are to be made on it.
Developers copies will be slaves.
Any changes on the master will be duplicated on the slaves.
It's a one way replication.

Can be a bit tricky to put into place as any changes on the slaves will be erased.

Also it means that the developers should have two copy of the database.
One will be the slave and another the "development" database.

There are also tools for cross database replications. So any copies can be the master.

Both solutions can lead to disasters (replication errors).

The only solution is see fit is to have only one database for all developers and save it several times a day on a rotating history.
Won't save you from conflicts but you will be able to restore the previous version if it happens (and it always do...).

answered 2011-03-09T16:08:51.920
0

Where I work we are using Dotnetnuke and this poses the same problems. i.e. once released the production site has data going into the database as well as files being added to the file system by some modules and in the DNN file system.

We are versioning the site file system with svn which for the most part works ok. However, the database is a different matter. The best method we have come across so far is to use RedGate tools to synchronise the staging database with the production database. RedGate tools are very good and well worth the money.

Basically we all develop locally with a local copy of the database and site. If the changes are major we branch. Then we commit locally and do a RedGate merge to put our DB changes on the the shared dev server.

We use a shared dev server so others can do the testing. Once complete we then update the site on staging with svn and then merge the database changes from the development server to the staging server.

Then to go live we do the same from staging to prod.

This method works but is prone to error and is very time consuming when small changes need to be made. The prod DB is always backed up so we can roll back easily if a delivery goes wrong.

One major headache we have is that Dotnetnuke uses identity cols in many tables and if you have data going into tables on development and production such as tabs and permissions and module instances you have a nightmare syncing them. Ideally you want to find or build a cms that uses GUI's or something else in the database so you can easily sync tables that are in use concurrently.

We'd love to find a better method! As we have a lot of trouble with branching and merging when projects are concurrent.

Gus

answered 2013-03-05T16:46:04.780

Your Answer