[thelist] Database merging

Matt Warden mwarden at gmail.com
Tue May 31 19:29:14 CDT 2005

On 5/31/05, Evolt <evolt at ultraspace.com> wrote:
> Hello:
> I have a question about database development.
> How do I go about merging databases? The problem is that the databases
> on the production and staging servers are different, and now I need to
> move stage to production. Production has some tables that no longer
> exist in stage, and vice versa. In addition, some columns have been
> removed and others added.

Copy the tables from production that do not exist in staging. Work on
getting a sane staging environment and make sure nothing breaks. Then
you can migrate relevant data into the production database. Relevant
data would be data that isn't junk test data, like products,
categories, etc. Relevant data would not be test data in the user
table. It really depends on your database.

As for the specific mode of copying, I would just use SQL; either as a
SQL file, if you can do so, or within a PHP/ASP/whatever script, if
you need more interaction (e.g., finding the corresponding ID for this
record in the productino dataabse before inserting the
foreign-key-related records).


Matt Warden
Miami University
Oxford, OH, USA

This email proudly and graciously contributes to entropy.

More information about the thelist mailing list