Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 3 > General

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 14th June 2010, 12:21
grungy grungy is offline
Senior Member
 
Join Date: Dec 2008
Posts: 164
Thanks: 14
Thanked 15 Times in 10 Posts
Default Migrate mail users from one ispconfig3 server to another

I want to migrate mail users for a SINGLE domain from one ispconfig3 server to another. I do not want to do it manually by entering all mail users one by one. What is the best way of doing this?

If I use mysqldump and import mail_users to the new server will ispconfig create the accounts in /var/vmail/ ?

I used mysqldump like this:

Code:
mysqldump -u root -p dbispconfig mail_user
--where="sys_groupid='30'";
and I will only use the line that begins with

Code:
-- -- Dumping data for table `mail_user` -- -- WHERE:  sys_groupid='30'
Do I have to manually change the IDs? maybe use some replace option since mysqldump supports it?
Reply With Quote
Sponsored Links
  #2  
Old 14th June 2010, 20:15
vogelor vogelor is offline
ISPConfig Developer
 
Join Date: Jan 2007
Location: Wernau, Germany
Posts: 219
Thanks: 42
Thanked 34 Times in 24 Posts
Exclamation dont do it!!!!

Quote:
Originally Posted by grungy View Post

If I use mysqldump and import mail_users to the new server will ispconfig create the accounts in /var/vmail/ ?
NO! this is because of the way, the servers share their data. if you dump the new data to this table, all the other servers didn't know anything about this change and so they WILL NOT do anything.

You can only add them manually or with the remote-api but NEVER direct. You will destroy your Installation
__________________
Der neue Luxus heißt Zeit, nicht Geld!

Firma : http://www.muv.com, http://www.computerandservice.de
Privat : http://www.vogelor.de
Reply With Quote
  #3  
Old 14th June 2010, 20:18
grungy grungy is offline
Senior Member
 
Join Date: Dec 2008
Posts: 164
Thanks: 14
Thanked 15 Times in 10 Posts
Default

What if I create the users manually and then import the data?

I would change the user ids etc....
Reply With Quote
  #4  
Old 15th June 2010, 08:38
vogelor vogelor is offline
ISPConfig Developer
 
Join Date: Jan 2007
Location: Wernau, Germany
Posts: 219
Thanks: 42
Thanked 34 Times in 24 Posts
Default

Quote:
Originally Posted by grungy View Post
What if I create the users manually and then import the data?

I would change the user ids etc....
Sorry, i would like to help you, but there is NO WAY.
This is because of the "ISPConfig 3 multiserver - kernel"
__________________
Der neue Luxus heißt Zeit, nicht Geld!

Firma : http://www.muv.com, http://www.computerandservice.de
Privat : http://www.vogelor.de
Reply With Quote
  #5  
Old 15th June 2010, 09:08
grungy grungy is offline
Senior Member
 
Join Date: Dec 2008
Posts: 164
Thanks: 14
Thanked 15 Times in 10 Posts
Default

vogelor,

Why is the multiserver kernel thing relevant to this discussion? My two servers are not linked - they are not in a multiserver environment.
Reply With Quote
  #6  
Old 15th June 2010, 09:18
vogelor vogelor is offline
ISPConfig Developer
 
Join Date: Jan 2007
Location: Wernau, Germany
Posts: 219
Thanks: 42
Thanked 34 Times in 24 Posts
Default

not 100% true, but to understand:

INTERALL we have:
1) the master -> the interface where you do your setup
2) n clients -> doing everything, the interface told them

this means, you have only ONE hardware, but INTERN you have 1 master (interface) and 1 client doing the email setup.

if you change the tables by your own, you only change the data, the interface displays BUT you do not tell the client to do the setup, this can only be done by the interface! if you edit the interface, the new data is stored in the tables AND the client gets a "command" to do what you change.

again, this is not 100% the truth, but "real enough" to understand the problem in short...

Olli
__________________
Der neue Luxus heißt Zeit, nicht Geld!

Firma : http://www.muv.com, http://www.computerandservice.de
Privat : http://www.vogelor.de
Reply With Quote
  #7  
Old 15th June 2010, 10:02
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,715
Thanks: 819
Thanked 5,321 Times in 4,174 Posts
Default

Additionally to that what Olli (vogelor) said, migrating a complete install is possible when you copy the config files, maildirs, websites, ispconfig users in /etc/passwd, shadow, group and gshadow as well as the ispconfig database to the new server. But copying only the database will not work for the reasons that Olli explained.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #8  
Old 15th June 2010, 10:06
grungy grungy is offline
Senior Member
 
Join Date: Dec 2008
Posts: 164
Thanks: 14
Thanked 15 Times in 10 Posts
Default

Thanks for the info. My plan was to:

1. Manually add a domain to the second server
2. Manually open email accounts on the second server
3. Export only mail_users for that domain from the first server
4. Change the IDs so that they match the IDs on the second server
5. Import the mysql dump for the mail_users for that domain on the second server
Reply With Quote
  #9  
Old 15th June 2010, 10:13
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,715
Thanks: 819
Thanked 5,321 Times in 4,174 Posts
Default

This will not work as vogelor pointed out, ispconfig needs a record in sys_datalog for every chnage that shall be written to disk. To create these records (they can not be copied from another server), you have to use the internal ispconfig database functions or the remoting API.

What is the benefit in importing the mysql dump after you created the users?

What you might do is this:

1) Copy the complete ispconfig database to the new server.
2) Copy the complete /var/vmail directory to the new server (with preserverd permissions).
3) Delete all email domains that you dont need from within ispconfig.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #10  
Old 15th June 2010, 10:16
grungy grungy is offline
Senior Member
 
Join Date: Dec 2008
Posts: 164
Thanks: 14
Thanked 15 Times in 10 Posts
 
Default

Quote:
Originally Posted by till View Post
What is the benefit in importing the mysql dump after you created the users?
I guess this way I will migrate the passwords.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sending mail ISPConfig 3 but not receivind catza Installation/Configuration 20 19th May 2010 12:47
Need help get mail to work (can't recieve and apperently can't send) omega13a Installation/Configuration 19 20th August 2009 21:06
CentoS doesn't send the emails vaio1 Installation/Configuration 18 5th November 2008 17:51
Filtering emails using Spamassassin and Clamav for Exchange 2000 Server Rocky Server Operation 19 11th March 2008 08:27
Core 4: Error Messages on Fresh Install re CTX/SSL jjw Installation/Configuration 30 6th September 2006 12:16


All times are GMT +2. The time now is 14:08.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.