Koozali.org: home of the SME Server

e-mails von sme 9.2 auf sme 10 kopieren

Offline umbi

  • ***
  • 74
  • +0/-0
e-mails von sme 9.2 auf sme 10 kopieren
« on: June 08, 2022, 03:46:41 AM »
Hallo zusammen

Ich habe parallel 2 Server am laufen:

1x SME V9.2 (server1.domain1.com) an intern 192.168.x.x 
und
1x SME V10 (server2.domain1.com) an intern 192.168.x.y

Beide sind extern durch zwei verschiedene IP's zu erreichen.

Jetzt würde ich gerne die einzelnen E-Mail Accounts vom V9.2  auf den V10 Server kopieren.

Am liebsten hätte ich das mit einem Client gemacht, da aber v9.2 IMAP nicht mehr erreichbar ist, geht das nicht.
Mit Rsync komme leider ich nicht zu recht. Server-Manager Backup - Restore von Workstation mit gezielten Verzeichnisen geht auch nicht :-(

Hat jemand für mich eine einfache Lösung für mich ?

Vielen lieben Dank.
« Last Edit: June 08, 2022, 03:48:53 AM by umbi »

Offline bunkobugsy

  • *
  • 195
  • +0/-0
Re: e-mails von sme 9.2 auf sme 10 kopieren
« Reply #1 on: June 08, 2022, 08:27:39 PM »
Copy via samba hidden homes share or mount drive from v9 in v10 sme and do a local copy/rsync?
On v10 run something like   rsync -arv root@oldsme:/home/e-smith/files/users/ /home/e-smith/files/users
In any case users must exist on v10 then dirs and emails must be chowned to users for imap to work afterwards.


Offline umbi

  • ***
  • 74
  • +0/-0
Re: e-mails von sme 9.2 auf sme 10 kopieren
« Reply #3 on: June 09, 2022, 12:57:24 PM »
Thank you verry much my sme-mentor Jean-Philippe  :smile:

On v10 server is an old backup of users so the user chown will fall away right ?

Can you confirm the 1:1 steps i understood:

1.) I go by telnet as root in v10 server and generate a backup directoy in root called f.ex.  v9bkp

2.) I go over file-explorer samba in old v9 server filesystem and copy the /home/e-smith/files/users directory

3.) I go over file-explorer samba in new v10 server filesystem and paste the home/user directory
in the folder v9bkp

4.) i do following shell command in v10:

rsync -arv root@v9bkp:/home/e-smith/files/users/ /home/e-smith/files/users

thats right ?

verry gracefull best regards

umbi

« Last Edit: June 09, 2022, 01:03:20 PM by umbi »

Offline Jean-Philippe Pialasse

  • *
  • 2,298
  • +8/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: e-mails von sme 9.2 auf sme 10 kopieren
« Reply #4 on: June 09, 2022, 10:45:40 PM »
from sme10

rsync -arv root@sme9ip:/home/e-smith/files/users/ /home/e-smith/files/users


but this means you will do it for all users home.  i thought you only wanted Maildir?

Offline umbi

  • ***
  • 74
  • +0/-0
Re: e-mails von sme 9.2 auf sme 10 kopieren
« Reply #5 on: June 13, 2022, 09:25:22 PM »
Hi Jean Philippe

I have an old v9.2 Backup on the SME V10, that means, the users are all there and on both servers have the same users loadet.

So i need to copy the V9.2 Email folders from each user step by step for each Domain and then make the dns mx entries for swapping to the v10 and get again imap access.

greez

umbi
« Last Edit: June 13, 2022, 09:28:55 PM by umbi »

Offline Jean-Philippe Pialasse

  • *
  • 2,298
  • +8/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: e-mails von sme 9.2 auf sme 10 kopieren
« Reply #6 on: June 13, 2022, 09:50:39 PM »
domains are virtual domains for mail in SME. so do not bother about domain but rather about users.


timing should be
1- change dns (even plan this few days before by checking the ttl set and set it to less than one hour. value is in seconds)
2- stop sme qpsmtpd service.
3- rsync each user Maildir to sme10 with update option so you do mot delete new mail.
4- retire sme9

Offline umbi

  • ***
  • 74
  • +0/-0
Re: e-mails von sme 9.2 auf sme 10 kopieren
« Reply #7 on: June 14, 2022, 03:12:31 AM »
Hi Jean-Philippe

Yes concerning the domains i can handle it without any problems and the V10 has the same domain name with another subdomain.

Your timing-purpose is aprox the same as mine and i have the advantage, that i can route the mailports to the new server from oldservers router as they are in the same subnet.

"2- stop sme qpsmtpd service."
i guess you mean the productive v9.2 ?

"but this means you will do it for all users home.  i thought you only wanted Maildir?"

-> if possible yes

If i want sync one user mail after other this command will be the right way?:

rsync -arv root@sme9ip:/home/e-smith/files/users/umbi/maildir /home/e-smith/files/users/umbi/maildir

To sync by ip is rsync addon installation on v9.2 client mandatory ?

Thank for all your support here.
Merci beaucoup :-)

umbi
« Last Edit: June 14, 2022, 03:19:44 AM by umbi »

Offline Jean-Philippe Pialasse

  • *
  • 2,298
  • +8/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: e-mails von sme 9.2 auf sme 10 kopieren
« Reply #8 on: June 14, 2022, 07:08:20 AM »
rsync bin is needed on both side
you do not anything else

your commandis almost good

pay attention to trailing slash

Code: [Select]
rsync -arv root@sme9ip:/home/e-smith/files/users/umbi/Maildir/ /home/e-smith/files/users/umbi/Maildir

needed in the frist occurence or you will not sync the content of the folder, but the folder and its content  and willend up with /home/e-smith/files/users/umbi/Maildir/Maildir

also could do
Code: [Select]
for user in  `ls /home/e-smith/files/users/` ;
do  rsync -arv root@sme9ip:/home/e-smith/files/users/$user/Maildir/ /home/e-smith/files/users/$user/Maildir  -n ;
done

see the -n I added, this is dry run (test only) , you can then list what is done, and remove when you are happy to really run it.

Offline umbi

  • ***
  • 74
  • +0/-0
Re: e-mails von sme 9.2 auf sme 10 kopieren
« Reply #9 on: June 27, 2022, 01:47:14 AM »
Hello Jean-Philippe

I would like to tell you about my experience here.

with the command:

rsync -arv root@sme9ip:/home/e-smith/files/users/umbi/Maildir/ /home/e-smith/files/users/umbi/Maildir


It seems to have worked !

Thank you very much for your help :-)

Greez Umbi
« Last Edit: June 27, 2022, 02:38:32 AM by umbi »