Difference between revisions of "Restore from desktop to vmware"

From SME Server
Jump to navigationJump to search
 
(7 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 +
{{Level|Developer}}
 +
==Restore smeX in vmware using a desktop backup and winscp==
 +
This method is usefull for a restore or upgrading a version (I used it to upgrade from 7.51 to 8.0 in vmware esxi 4.1).
 +
In this mini-howto I will show howto restore a backup made to the desktop into a new SME server. In stead of using an USB-stick we will transport the backup using SSH (scp or secure copy). Since many sme-servers run in vmware, and using usb or iso-files can be complicated or impossible on ESX servers using SSH is a good alternative to transport the backup to the server.
  
You can restore an SME server simply by restoring from a desktop backup. This is usefull for instance when upgrading a version (I used it to upgrade from 7.51 to 8.0). Restoring from a backup file is a quick and useful method for instance in VMware environments, since using USB disks or CD-rom or DVD adds complications you might not need.
 
  
In this mini-howto I will show howto restore a desktop backup to a new server. In stead of using an USB-stick we will transport the backup using SSH (scp or secure copy).  
+
==Forum discussion==
 +
This how-to can be discussed on the forums [http://forums.contribs.org/index.php/topic,49417.0.html here]
  
I upgraded from 7.51 -> 8.0 in vmware esxi 4.1 with the following steps. Perhaps it can help someone.
 
  
 +
==Make backup from original server to desktop in the server-manager==
 +
go the http://ip/server-manager and backup to desktop
  
  
restore smeX in vmware
+
==Install new SME server (sme8.x) from iso in vmware==
 +
Give it a temporary IP-adddress. When restoring it will get the ip-adresses from the server that was backed-up===
 +
- do not use vmx network cards, but use e1000 nic's instead, see http://bugs.contribs.org/show_bug.cgi?id=7197
 +
- log in via web-management console http://ip/server-manager and change remote acces so you can log in via ssh as root from internal network
  
1. Make backup from original server to desktop
+
 
2. install sme8.x from iso in vmware
+
==Install vmware tools in the newly installed sme-server==
    - do not use vmx network cards, but use e1000 nic's instead, see http://bugs.contribs.org/show_bug.cgi?id=7197
+
See http://wiki.contribs.org/VMware_Tools#SME_Server_8.0_Guest_on_ESXi_4.0_Update_1
    - log in via web-management console http://ip/server-manager and change remote acces so you can log in via ssh as root from internal network
+
in my case: SME Server 8.0 Guest on ESXi 4.0 Update 1
3. install vmware tools, see http://wiki.contribs.org/VMware_Tools#SME_Server_8.0_Guest_on_ESXi_4.0_Update_1
 
################################ in my case
 
SME Server 8.0 Guest on ESXi 4.0 Update 1
 
  
 
Download the required packages
 
Download the required packages
log in via ssh
+
log into the new  via ssh
cd /root
+
cd /root
mkdir vmtools
+
mkdir vmtools
cd vmtools
+
cd vmtools
 
+
wget http://packages.vmware.com/tools/esx/4.0u1/rhel5/i686/vmware-open-vm-tools-kmod-8.0.2-208167.el5.i686.rpm
wget http://packages.vmware.com/tools/esx/4.0u1/rhel5/i686/vmware-open-vm-tools-kmod-8.0.2-208167.el5.i686.rpm
+
wget http://packages.vmware.com/tools/esx/4.0u1/rhel5/i686/vmware-open-vm-tools-common-8.0.2-208167.el5.i686.rpm
wget http://packages.vmware.com/tools/esx/4.0u1/rhel5/i686/vmware-open-vm-tools-common-8.0.2-208167.el5.i686.rpm
+
wget http://packages.vmware.com/tools/esx/4.0u1/rhel5/i686/vmware-open-vm-tools-nox-8.0.2-208167.el5.i686.rpm
wget http://packages.vmware.com/tools/esx/4.0u1/rhel5/i686/vmware-open-vm-tools-nox-8.0.2-208167.el5.i686.rpm
 
  
Install the packages and dependencies (some dependencies might be downloaded, click Y)
+
Install the downloaded packages and dependencies (some dependencies might be downloaded, click Y)
  
/usr/bin/yum localinstall \
+
/usr/bin/yum localinstall \
 
  vmware-open-vm-tools-kmod-8.0.2-208167.el5.i686.rpm \
 
  vmware-open-vm-tools-kmod-8.0.2-208167.el5.i686.rpm \
 
  vmware-open-vm-tools-common-8.0.2-208167.el5.i686.rpm \
 
  vmware-open-vm-tools-common-8.0.2-208167.el5.i686.rpm \
Line 37: Line 41:
 
Link the start script to run level 7
 
Link the start script to run level 7
  
ln -fs /etc/rc.d/init.d/vmware-tools /etc/rc7.d/S90vmware-tools
+
ln -fs /etc/rc.d/init.d/vmware-tools /etc/rc7.d/S90vmware-tools
  
 
Start the service
 
Start the service
  
service vmware-tools start
+
service vmware-tools start
  
  
Line 54: Line 58:
 
#  VM communication interface socket family:              [FAILED]
 
#  VM communication interface socket family:              [FAILED]
 
#  Guest operating system daemon:                          [  OK  ]
 
#  Guest operating system daemon:                          [  OK  ]
 
 
((((((((((((((((((((
 
((((((((((((((((((((
  
##########################################
 
  
4. update packages
+
==Update the new SME server to latest packages before restoring from backup==
- before update set yum straight
+
Before update set yum straight
check if this is still needed here:
+
check if this is still needed here: http://forums.contribs.org/index.php/topic,49362.0.html
########## see http://forums.contribs.org/index.php/topic,49362.0.html
 
  
yum clean all
+
yum clean all
rpm -Uhv \
+
rpm -Uhv \
http://mirror.canada.pialasse.com/releases/\
+
http://mirror.canada.pialasse.com/releases/\
/8.0/smeupdates/i386/RPMS/smeserver-yum-2.2.0-20.el5.sme.noarch.rpm
+
/8.0/smeupdates/i386/RPMS/smeserver-yum-2.2.0-20.el5.sme.noarch.rpm
signal-event yum-update
+
 +
signal-event yum-update
  
- update
+
- update  
yum update
+
yum update
 
+
it will make a list, say Y
it will make a list, say Y
 
 
wait while downloading lots of stuff & installing
 
wait while downloading lots of stuff & installing
signal-event post-upgrade; signal-event reboot
+
signal-event post-upgrade; signal-event reboot
  
  
4. restore with backup
+
==Restore with the backup file==
- make a snapshot
+
- first make a snapshot in vmware, so you have a snapshot with updated packages (in case something goes wrong)
- copy sme.tzg to / directory new sme server (for instance form windows desktop with winscp (= cp via ssh) )
+
- copy sme.tzg to / directory new sme server (for instance form windows desktop with [winscp]http://winscp.net/eng/index.php (= cp via ssh) )
  - run comnmands below
+
  log into new SME-server with winscp
 +
copy sme.tgz to / directory
 +
- log into the new SME server via SSH and run commands below
 +
log into the new SME-server with ssh
 +
cd /
 +
signal-event pre-restore
 +
tar -C / -xzvf smeserver.tgz
 +
If you are replacing an original SME-server that is still running,
 +
shut it down NOW before rebooting the new restored server! The ip-addresses will be the same and that will cause troubles on the network
  
cd /
+
After unpacking the backup with tar now signal the new SME-server to devour the backup
signal-event pre-restore
+
/sbin/e-smith/signal-event post-upgrade
tar -C / -xzvf smeserver.tgz
+
/sbin/e-smith/signal-event reboot
If you are replacing an original server that is still running,
 
shut it down before rebooting the new server
 
 
 
/sbin/e-smith/signal-event post-upgrade
 
/sbin/e-smith/signal-event reboot
 
  
 
After reboot login to admin-console to change IPs to suit network
 
After reboot login to admin-console to change IPs to suit network
If you are replacing an original server that is still running, shut it down before rebooting the new server
+
login to the restored server as admin and choose configure this server
 
+
Save & Reboot
Save & Reboot
 
  
 
Delete backup file
 
Delete backup file
 
+
cd /
cd /
+
rm smeserver.tgz
rm smeserver.tgz
 
  
 
System should now be online & operational,
 
System should now be online & operational,
 
Run tests if all works:
 
Run tests if all works:
- check email (send & retrieve)
+
- check email (send & retrieve)
- check connections & websites
+
- check connections & websites
 +
- in Vmware make sure the new server boots after a shutdown of the vmware host
  
</nowiki>
+
----
 +
<noinclude>[[Category:Howto]]</noinclude>

Latest revision as of 21:16, 8 January 2013

PythonIcon.png Skill level: Developer
Risk of inconsistencies with Koozali SME Server methodology, upgrades & functionality is high. One must be knowledgeable about how changes impact their Koozali SME Server. Significant risk of irreversible harm.


Restore smeX in vmware using a desktop backup and winscp

This method is usefull for a restore or upgrading a version (I used it to upgrade from 7.51 to 8.0 in vmware esxi 4.1). In this mini-howto I will show howto restore a backup made to the desktop into a new SME server. In stead of using an USB-stick we will transport the backup using SSH (scp or secure copy). Since many sme-servers run in vmware, and using usb or iso-files can be complicated or impossible on ESX servers using SSH is a good alternative to transport the backup to the server.


Forum discussion

This how-to can be discussed on the forums here


Make backup from original server to desktop in the server-manager

go the http://ip/server-manager and backup to desktop


Install new SME server (sme8.x) from iso in vmware

Give it a temporary IP-adddress. When restoring it will get the ip-adresses from the server that was backed-up=== - do not use vmx network cards, but use e1000 nic's instead, see http://bugs.contribs.org/show_bug.cgi?id=7197 - log in via web-management console http://ip/server-manager and change remote acces so you can log in via ssh as root from internal network


Install vmware tools in the newly installed sme-server

See http://wiki.contribs.org/VMware_Tools#SME_Server_8.0_Guest_on_ESXi_4.0_Update_1 in my case: SME Server 8.0 Guest on ESXi 4.0 Update 1

Download the required packages

log into the new  via ssh
cd /root
mkdir vmtools
cd vmtools
wget http://packages.vmware.com/tools/esx/4.0u1/rhel5/i686/vmware-open-vm-tools-kmod-8.0.2-208167.el5.i686.rpm
wget http://packages.vmware.com/tools/esx/4.0u1/rhel5/i686/vmware-open-vm-tools-common-8.0.2-208167.el5.i686.rpm
wget http://packages.vmware.com/tools/esx/4.0u1/rhel5/i686/vmware-open-vm-tools-nox-8.0.2-208167.el5.i686.rpm

Install the downloaded packages and dependencies (some dependencies might be downloaded, click Y)

/usr/bin/yum localinstall \
vmware-open-vm-tools-kmod-8.0.2-208167.el5.i686.rpm \
vmware-open-vm-tools-common-8.0.2-208167.el5.i686.rpm \
vmware-open-vm-tools-nox-8.0.2-208167.el5.i686.rpm

Link the start script to run level 7

ln -fs /etc/rc.d/init.d/vmware-tools /etc/rc7.d/S90vmware-tools

Start the service

service vmware-tools start


(((((((((((((((((((( oeps, there is something wrong, must see into this later. Errors are:

  1. service vmware-tools start
  2. Checking acpi hot plug [ OK ]
  3. Starting VMware Tools services in the virtual machine:
  4. Switching to guest configuration: [ OK ]
  5. Paravirtual SCSI module: [FAILED]
  6. Guest memory manager: [FAILED]
  7. VM communication interface: [FAILED]
  8. VM communication interface socket family: [FAILED]
  9. Guest operating system daemon: [ OK ]

((((((((((((((((((((


Update the new SME server to latest packages before restoring from backup

Before update set yum straight check if this is still needed here: http://forums.contribs.org/index.php/topic,49362.0.html

yum clean all
rpm -Uhv \
http://mirror.canada.pialasse.com/releases/\
/8.0/smeupdates/i386/RPMS/smeserver-yum-2.2.0-20.el5.sme.noarch.rpm

signal-event yum-update

- update

yum update
it will make a list, say Y

wait while downloading lots of stuff & installing

signal-event post-upgrade; signal-event reboot


Restore with the backup file

- first make a snapshot in vmware, so you have a snapshot with updated packages (in case something goes wrong) - copy sme.tzg to / directory new sme server (for instance form windows desktop with [winscp]http://winscp.net/eng/index.php (= cp via ssh) )

log into new SME-server with winscp
copy sme.tgz to / directory

- log into the new SME server via SSH and run commands below

log into the new SME-server with ssh
cd /
signal-event pre-restore
tar -C / -xzvf smeserver.tgz

If you are replacing an original SME-server that is still running, shut it down NOW before rebooting the new restored server! The ip-addresses will be the same and that will cause troubles on the network

After unpacking the backup with tar now signal the new SME-server to devour the backup

/sbin/e-smith/signal-event post-upgrade
/sbin/e-smith/signal-event reboot

After reboot login to admin-console to change IPs to suit network

login to the restored server as admin and choose configure this server
Save & Reboot

Delete backup file

cd /
rm smeserver.tgz

System should now be online & operational, Run tests if all works:

- check email (send & retrieve)
- check connections & websites
- in Vmware make sure the new server boots after a shutdown of the vmware host