MySQL Forums
Forum List  »  MySQL Administrator

insert content from vexim mysql database to existing database
Posted by: Andrew Kerich
Date: December 11, 2009 12:52AM

Hi Guys,
I need to insert the vexim database content [users and domains] from one database A to database B.
This is to facilitate migration from one server to another.
The challenge is avoiding duplicate values in database B when inserting values from database A.

An excerpt of the insert code;
INSERT INTO `users` VALUES (2,2,'postmaster','postmaster@mydomain.com','testing','*******',90,90,'/var/spool/mail/mydomain.com/postmaster/Maildir','/var/spool/mail/mydomain.com/postmaster','local',1,0,0,0,0,0,0,0,1,NULL,NULL,0,0,0,'Domain Admin',0,0,NULL,NULL);

I require an option that will increment the domain_id and user_id in the existing database. The domain id should be the same for user_ids for the same domain.

I was googling and the link below appears helpful but not assisted to solve the problem;

http://dev.mysql.com/doc/refman/5.0/en/insert-on-duplicate.html

pls assist.

Rgds,
Kerich

Options: ReplyQuote


Subject
Written By
Posted
insert content from vexim mysql database to existing database
December 11, 2009 12:52AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.