HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   General (http://www.howtoforge.com/forums/forumdisplay.php?f=25)
-   -   Migrate mail users from one ispconfig3 server to another (http://www.howtoforge.com/forums/showthread.php?t=46538)

grungy 14th June 2010 12:21

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?

vogelor 14th June 2010 20:15

dont do it!!!!
 
Quote:

Originally Posted by grungy (Post 231119)

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

grungy 14th June 2010 20:18

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

I would change the user ids etc....

vogelor 15th June 2010 08:38

Quote:

Originally Posted by grungy (Post 231149)
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"

grungy 15th June 2010 09:08

vogelor,

Why is the multiserver kernel thing relevant to this discussion? My two servers are not linked - they are not in a multiserver environment.

vogelor 15th June 2010 09:18

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

till 15th June 2010 10:02

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.

grungy 15th June 2010 10:06

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

till 15th June 2010 10:13

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.

grungy 15th June 2010 10:16

Quote:

Originally Posted by till (Post 231176)
What is the benefit in importing the mysql dump after you created the users?

I guess this way I will migrate the passwords.


All times are GMT +2. The time now is 16:39.

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