Koozali.org: home of the SME Server

Migrating from 8 to 9 - Copying User Data after Backup to Workstation Restore

Offline emissions

  • *
  • 6
  • +0/-0
Fair Warning: Noob levels = high

Long story, not quite as long... I've been slow to migrate fully to 9 and today it came back to bite me.

A few months ago performed ver 9 install on a clean machine and restored from a work station backup.
Everything went accordingly plan / directions. Great.

But...there's alway a but, for some reason, I couldn't get the new server to connect to the internet via our ISP.
(Turns out I selected the wrong nic cards during config setup.)

I never completed the migration and the new server sat.

Today, the old server (gateway & email) began dropping internet connection. A reboot would restore connection for 5-10 minutes before it would drop.

Tested the ISP connection with my laptop and the connection was good. Isolated that it was server issue and not an ISP issue.

Was unable to dedicate enough time to troubleshoot the old server as restoring the gateway and internet was priority.

Quickly swapped out old server for the new. The only issue (other than changing the nic settings) was that the new server didn't have a current backup restored. I had the original old backup from a few months ago.

Now the small number of email accounts on this machine are setup using POP on their desktop client so most had local versions of their email residing on their desktop machines. Not as bad as it could have been.

Except for one user who was using IMAP. Now as you'd have guessed she was missing all of her email between the old backup restore point to today.

The missing email though is on the OLD server inbox, sent, etc just sitting their waiting for me to do something with it.

So my noob question is how can I copy her mail files to a USB and restore to the new machine?

My linux command is limited but I've come up with this to begin the copy process.

cp -r /home/e-smith/files/users/username/Maildir  /media/USB20FD/

This didn't work but didn't actually return an error. It just hung there.

I then saw I needed to mount the USB

So then: mount /media/USB20FD/

This returned a not found error.

What am I doing wrong?
Once it's copied to the USB can I simply replace the user directories on the new server?

I also tried a Console Backup on the old server but that backup timed out after about an hour.

Thanks in advance.






Offline elmarconi

  • ****
  • 139
  • +0/-0
Start with mounting the USB.

After plugging in the USB check which device it is:

Code: [Select]
dmesg | grep sdc

sdc: assuming drive cache: write through
 sdc: sdc1
sd 22:0:0:0: Attached scsi disk sdc
EXT3 FS on sdc1, internal journal

Check mounted status:

Code: [Select]
mount
[root@smeserver ~]# mount
/dev/mapper/main-root on / type ext3 (rw,usrquota,grpquota,acl)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/md1 on /boot type ext3 (rw)
tmpfs on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)

No USB mounted:

Code: [Select]
mkdir -p /mnt/usb; mount /dev/sdc1 /mnt/usb
Check mount again:
Code: [Select]
[root@smeserver ~]# mount | grep sdc
/dev/sdc1 on /mnt/usb type ext3 (rw)

Now you can copy

Code: [Select]
cp -arv /home/e-smith/files/users/username/Maildir  /mnt/usb/
After the copy unmount the usb drive:

Code: [Select]
umount /mnt/usb
Repeat mount on other server.




...