KOHA
Backup i restore: Revision 22
MySQL baza iz komandne linijeBackup$ mysqldump --add-drop-table --single-transaction -u _root_ -p_password_ koha > 2008-11-11_koha.sql $ mysqldump --add-drop-table -u _root_ -p_password_ koha issues > 2008-11-11_koha.issues.sql http://www.nabble.com/Backing-up-3.0-to21076508.html Restore$ mysql -u _root_ -p_password_ koha < koha.sql $ mysql -u _root_ -p_password_ koha.issues < koha.issues.sql Restore sa zfsopr - zfs backup server# Find backup snapshot to restore dpavlin@opl:~$ ./veid2hostname.sh 212052 koha-dev.rot13.org 212056 webpac2.rot13.org 212226 koha.ffzg.hr dpavlin@opl:~$ sudo zfs list | grep 212226 | tail -3 opl/backup/212226@2010-01-05 662M - 25.4G - opl/backup/212226@2010-01-06 28K - 25.4G - opl/clone/212226-mlin 30.0M 24.5G 25.4G /opl/clone/212226-mlin # make clone to access files dpavlin@opl:~$ sudo zfs clone opl/backup/212226@2010-01-06 opl/clone/koha-2010-01-06 dpavlin@opl:~$ df -h /opl/clone/koha-2010-01-06 Filesystem Size Used Avail Use% Mounted on opl/clone/koha-2010-01-06 50G 26G 25G 51% /opl/clone/koha-2010-01-06 cpio file transfer
root@mlin:/virtual.clone# mkdir koha-2010-01-06 root@mlin:/virtual.clone# cd koha-2010-01-06/ # start listener for cpio data transfer root@mlin:/virtual.clone/koha-2010-01-06# nc -l -p 8888 | pv | cpio --extract --make-directories --preserve-modification-time --numeric-uid-gid --sparse dpavlin@opl:~$ sudo bash root@opl:~# cd /opl/clone/koha-2010-01-06 root@opl:/opl/clone/koha-2010-01-06# find . | cpio --create | pv | nc 10.60.0.93 8888 rsync file updatedpavlin@mlin:~$ sudo rsync -ravH --numeric-ids --sparse --delete --exclude 'backup*' \ 10.60.0.90:/opl/clone/koha-2010-01-06/ /virtual.clone/koha-2010-01-06/ real 24m48.767s user 5m0.027s sys 2m3.656s Kopiranje postojeće virtualne mašine prije rsync-a da bi se smanjilo broj promjena koje treba prenjeti rsync-om: dpavlin@mlin:/virtual.clone/koha.ffzg.hr$ time sudo cp -ar * ../koha-2010-01-06/ real 14m59.742s user 0m0.932s sys 0m38.278s Virtualna mašinaNakon restora sa zfs-a treba napraviti slijedeća podešavanja: Pokrenuti screen u kojem će biti virtualna mašinadpavlin@mlin:~$ screen -S koha-upgrade Filesystemlvcreate -s /dev/vg/koha -L 80G -n koha-upgrade root@mlin:~# mount /dev/vg/koha-upgrade /virtual.clone/koha-upgrade/ root@mlin:~# df /virtual.clone/koha-upgrade/ Filesystem 1K-blocks Used Available Use% Mounted on /dev/mapper/vg-koha--upgrade 82569904 56551456 26018448 69% /virtual.clone/koha-upgrade Start LXCroot@mlin:~# cd /srv/sysadmin-cookbook/recepies/lxc/ root@mlin:/srv/sysadmin-cookbook/recepies/lxc# ./ve2lxc.sh /virtual.clone/koha-upgrade/ 10.60.0.253 koha-upgrade Setup inside LXC
BTRFSroot@opl:~# zfs clone opl/backup/212226@2010-03-06 opl/clone/koha-2010-03-06 root@prod:/virtual# time rsync -rav --exclude 'backup/*' --delete 10.60.0.90::clone/koha-2010-03-06/ /virtual/koha/ receiving incremental file list ... sent 3297036 bytes received 4392640729 bytes 6527004.85 bytes/sec total size is 23473104677 speedup is 5.34 real 11m13.873s user 1m15.985s sys 0m39.890s root@prod:/virtual# btrfsctl -s /virtual/koha@2010-03-06 /virtual/koha operation complete Btrfs Btrfs v0.19 root@prod:/virtual# btrfsctl -s /virtual/koha-242 /virtual/koha operation complete Btrfs Btrfs v0.19 dpavlin@prod:~$ sudo bash ve2lxc.sh /virtual/koha-242 10.60.0.242 koha-242 |