Difference between revisions of "IPBrick Disk migration"

From wiki.IPBRICK.COM
Jump to: navigation, search
m (IPBrick Disk migration)
Line 1: Line 1:
=<big>'''IPBrick Disk migration'''</big>=
+
=IPBrick Disk migration=
  
Apply configuration and save the configurations file to your Desktop.
+
This guide is to assist the IT IPBRICK administrator in the process of migrating a running IPBRICK installation from:
 +
* scenario 1 : one disk to another disk on the same server machine
 +
* scenario 2 : one disk to another disk on a different server machine
 +
 
 +
 
 +
=On the original server machine=
 +
On the original installation, apply configuration and save the configurations file to your Desktop.
  
 
Just stop the the services you use.
 
Just stop the the services you use.
Line 16: Line 22:
 
<pre>php5 /opt/system/backupSYS/backup_DBs.php </pre>
 
<pre>php5 /opt/system/backupSYS/backup_DBs.php </pre>
  
Install the IPBrick on the new machine or on the new disk.
+
=Scenario 1 - only one server machine=
 
+
Procedure:
Make the rsync command to copy all the data to the new disk,
+
* shutdown the server machine
Some examples of rsync
+
* remove/detach the original (old) disk from the server
 
+
* install/attach the replacement (new) disk
 
+
* install the IPBRICK.IC operating system (please refer to IPBRICK.IC installation manual)
==='''rsync using local machine only, (device attached by usb)'''===
+
** perform the first boot, proceed with initial setup (FQDN, IP)
----
+
** after finishing installation and initial configuration proceed to the next step
 
+
* with the server power on, connect the old (original) disk using a USB connector
See the disks on machine
+
** now at the command line you can check for the disks
 
<pre>
 
<pre>
 
fdisk -l
 
fdisk -l
 
</pre>
 
</pre>
 
+
* confirm that you have 2 (two) disks: sda (new internal disk) and sdb (old disk connected via usb)
You must have 2 disk sda and sdb
+
** you shoudl  be able to identify the partition tables
 
+
* create two temporary folders to map/mount the work areas from the old disk
And see the partition table off the two devices.
+
 
+
Then create 2 folders
+
 
<pre>
 
<pre>
 
mkdir /old_home1
 
mkdir /old_home1
 
mkdir /old_home2
 
mkdir /old_home2
 +
ls /old_home* -al
 
</pre>
 
</pre>
 
+
* Then we need to mount the partitions we need to copy.
Then we need to mount the partitions we need to copy.
+
 
<pre>
 
<pre>
 
mount /dev/sdb7 /old_home1
 
mount /dev/sdb7 /old_home1
 
mount /dev/sdb8 /old_home2
 
mount /dev/sdb8 /old_home2
 
</pre>
 
</pre>
 
+
* Now lets start the rsync
Now lets start the rsync
+
 
+
 
<pre>
 
<pre>
rsync -aAuv /old_home1 /home1 > rsync_home1.log 2> rsync_home1.err &
+
rsync -aAuv /old_home1 /home1 > /tmp/rsync_home1.log 2> /tmp/rsync_home1.err &
rsync -aAuv /old_home2 /home2 > rsync_home2.log 2> rsync_home2.err &
+
rsync -aAuv /old_home2 /home2 > /tmp/rsync_home2.log 2> /tmp/rsync_home2.err &
 
</pre>
 
</pre>
 +
* You can see the logs in these files (log is normal output, err is for status warning)
 +
<pre>
 +
tail /tmp/rsync_home1.log
 +
tail /tmp/rsync_home1.err
 +
tail /tmp/rsync_home2.log
 +
tail /tmp/rsync_home2.err
 +
</pre>
 +
* Wen the rsync is finish access to web interface and then insert and replace the configuration that you save on your desktop.
 +
* After replacing, go to Advanced configuration -> disaster recovery -> aplication -> data bases -> and replace the last one.
 +
* Wen this Finnish test the services you have on IPBrick.
  
You can see the logs in this file -> rsync_home1.log
 
Or the errors in this file -> rsync_home1.err
 
  
Wen the rsync is finish access to web interface and then insert and replace the configuration that you save on your desktop.
+
=Scenario 2 - '''rsync using 2 IPBrick'''===
  
After replacing, go to Advanced configuration -> disaster recovery -> aplication -> data bases -> and replace the last one.
+
Install the IPBrick on the new machine or on the new disk.
  
 
+
Make the rsync command to copy all the data to the new disk,
Wen this Finnish test the services you have on IPBrick.
+
Some examples of rsync
  
  
==='''rsync using 2 IPBrick'''===
 
 
----
 
----
 
EX: IPBrick1 New (192.168.69.199) and IPBrick2 OLD (192.168.69.200)
 
EX: IPBrick1 New (192.168.69.199) and IPBrick2 OLD (192.168.69.200)

Revision as of 16:10, 21 August 2015

IPBrick Disk migration

This guide is to assist the IT IPBRICK administrator in the process of migrating a running IPBRICK installation from:

  • scenario 1 : one disk to another disk on the same server machine
  • scenario 2 : one disk to another disk on a different server machine


On the original server machine

On the original installation, apply configuration and save the configurations file to your Desktop.

Just stop the the services you use.

/etc/init.d/asterisk stop
/etc/init.d/apache2 stop
/etc/init.d/ejabberd stop
/etc/init.d/qmail stop
...


Execute this command to backup all the data bases.

php5 /opt/system/backupSYS/backup_DBs.php 

Scenario 1 - only one server machine

Procedure:

  • shutdown the server machine
  • remove/detach the original (old) disk from the server
  • install/attach the replacement (new) disk
  • install the IPBRICK.IC operating system (please refer to IPBRICK.IC installation manual)
    • perform the first boot, proceed with initial setup (FQDN, IP)
    • after finishing installation and initial configuration proceed to the next step
  • with the server power on, connect the old (original) disk using a USB connector
    • now at the command line you can check for the disks
fdisk -l
  • confirm that you have 2 (two) disks: sda (new internal disk) and sdb (old disk connected via usb)
    • you shoudl be able to identify the partition tables
  • create two temporary folders to map/mount the work areas from the old disk
mkdir /old_home1
mkdir /old_home2
ls /old_home* -al
  • Then we need to mount the partitions we need to copy.
mount /dev/sdb7 /old_home1
mount /dev/sdb8 /old_home2
  • Now lets start the rsync
rsync -aAuv /old_home1 /home1 > /tmp/rsync_home1.log 2> /tmp/rsync_home1.err &
rsync -aAuv /old_home2 /home2 > /tmp/rsync_home2.log 2> /tmp/rsync_home2.err &
  • You can see the logs in these files (log is normal output, err is for status warning)
tail /tmp/rsync_home1.log
tail /tmp/rsync_home1.err
tail /tmp/rsync_home2.log
tail /tmp/rsync_home2.err
  • Wen the rsync is finish access to web interface and then insert and replace the configuration that you save on your desktop.
  • After replacing, go to Advanced configuration -> disaster recovery -> aplication -> data bases -> and replace the last one.
  • Wen this Finnish test the services you have on IPBrick.


Scenario 2 - rsync using 2 IPBrick==

Install the IPBrick on the new machine or on the new disk.

Make the rsync command to copy all the data to the new disk, Some examples of rsync



EX: IPBrick1 New (192.168.69.199) and IPBrick2 OLD (192.168.69.200)

On machine IPBrick2 open ssh to root

cat /etc/ssh/sshusers-allowed
operator
root

insert the line root on the file.

Now lets start the rsync on IPBrick1

rsync -avz --rsh="ssh -l root" 192.168.69.200:/home1 /home1 > rsync_home1.log 2> rsync_home1.err
rsync -avz --rsh="ssh -l root" 192.168.69.200:/home2 /home2 > rsync_home2.log 2> rsync_home2.err
  • the route password will be prompt to insert.

You can see the logs in this file -> rsync_home1.log Or the errors in this file -> rsync_home1.err

Wen the rsync is finish access to web interface and then insert and replace the configuration that you save on your desktop.

After replacing, go to Advanced configuration -> disaster recovery -> aplication -> data bases -> and replace the last one.


Wen this Finnish test the services you have on IPBrick.