### Here you have ####
I - Backup
II - Restoring process
I - Backup
II - Restoring process
III - Conclusion
#########################
I - Backup #########################
1) Preparing to backup
Be sure your vob is umounted and unlocked.
# cleartool umount /vobs/2013-01
# cleartool lock vob:/vobs/2013-01
Locked versioned object base "/vobs/2013-01".
2) Doing the backup
2.1) Let's create a list from with the existing files.
find /vobstore/2013-01.vbs/ > /tmp/list-from-production
2.2) Create a list of files and permissions at <vbs>/.identity/
ls -lhta /vobstore/2013-01.vbs/.identity/
total 8.0K
drwxr-xr-x 8 pmoura pmoura 4.0K Mar 10 00:30 ..
drwx------ 2 pmoura pmoura 4.0K Jan 21 13:56 .
-r----s--- 1 pmoura pmoura 0 Jan 21 13:56 gid
-r-S------ 1 pmoura pmoura 0 Jan 21 13:56 uid
2.3) Then let create the backup.
tar czvf /tmp/2013-01.vob.tar.gz /vobstore/2013-01.vbs
3) Testing if I'm able to restore the backup to an alternative place:
mkdir /tmp/testing-backup
tar xzf /tmp/2013-01.vob.tar.gz -C /tmp/testing-backup
Create a list witht the files
find /tmp/testing-backup/ > /tmp/listfrombackup
Since my alternative place have two more levels the the original vob store, i.e:
/tmp/testing-backup/vobstore/2013-01.vbs/
instead
/vobstore/2013-01.vbs/
I will create a new file list (from backup) without /tmp/testing-backup/ and the 2 first lines (that will show /tmp and testing),
just to facilitate the comparison:
sed -e 's/\/tmp\/testing-backup//' -e 1,2d /tmp/listfrombackup > /tmp/listfrombackup-same-path
Then I ran:
diff /tmp/list-from-production /tmp/listfrombackup-same-path
1c1
< /vobstore/2013-01.vbs/
---
> /vobstore/2013-01.vbs
We can disregard the so few differences above and and assume the all files were restore, so our backup seems to be good.
After I have realized my backup is good, I should make a copy from the backup file to other machine (for security purpose), and then I delete the original vbs:
rm -rf /vobstore/2013-01.vbs
Note: If I tried to mount the vob now I'll have failure:
# cleartool mount /vobs/2013-01
cleartool: Error: The VOB storage directory "/vobstore/2013-01.vbs" was not found.
II - Restoring process
1) Restoring the vbs using the backup file.
1.1)
# tar xzf /tmp/2013-01.vob.tar.gz -C /
Double check if the permissions on <vbs>/.identity still the same (collected from I - 2.2 above):
ls -lhta /vobstore/2013-01.vbs/.identity/
total 8.0K
drwxr-xr-x 8 pmoura pmoura 4.0K Mar 10 00:30 ..
drwx------ 2 pmoura pmoura 4.0K Jan 21 13:56 .
-r----s--- 1 pmoura pmoura 0 Jan 21 13:56 gid
-r-S------ 1 pmoura pmoura 0 Jan 21 13:56 uid
2) Describing the vob, and not it still locked:
# cleartool desc vob:/vobs/2013-01
versioned object base "/vobs/2013-01" (locked)
created 2013-01-21T13:56:08-05:00 by pmoura.pmoura@abcMachine
VOB family feature level: 5
VOB storage host:pathname "abcMachine:/vobstore/2013-01.vbs"
VOB storage global pathname "/vobstore/2013-01.vbs"
database schema version: 54
modification by remote privileged user: allowed
atomic checkin: disabled
VOB ownership:
owner pmoura
group pmoura
Attributes:
FeatureLevel = 5
3) Unlocking the vob
# cleartool unlock vob:/vobs/2013-01
Unlocked versioned object base "/vobs/2013-01".
4) Testing the vob
# cleartool mount /vobs/2013-01
# su - pmoura
$ cleartool pmoura_view
$ cleartool setview pmoura_view2
$ cd /vobs/2013-01/
$ ls
lost+found repro testblabla.txt
$ cleartool co -nc .
Checked out "." from version "/main/3".
$ cleartool mkdir test
Creation comments for "test":
.
Created directory element "test".
Checked out "test" from version "/main/0".
$ cleartool ci -nc test .
Checked in "test" version "/main/1".
Checked in "." version "/main/4".
Then we can conclude our backup was suscefull and we can delete the vbs copy restored on the alternative place
rm -rf /tmp/testing-backup/vobstore/
####
In case you get problems - on using the restored vob - like that:
mkelem command fails with Error: Vob server operation "Create Container" failed
http://www-01.ibm.com/support/docview.wss?uid=swg21416428
Vob server operation Create Container failed
http://www-01.ibm.com/support/docview.wss?uid=swg21147316
####
In case you get problems - on using the restored vob - like that:
cleartool mkelem testefile.txtDouble check the ownership/Permissions and is probably we have an Old process related the the Vob still running:
Creation comments for "testefile.txt":
.
cleartool: Error: Vob server operation "Create Container" failed.
Additional information may be available in the vob_log on host "abcMachine"
cleartool: Error: Unable to create directory "/vobstore/2013-01.vbs/s/sdft/10": No such file or directory.
cleartool: Error: Unable to create element "testefile.txt".
mkelem command fails with Error: Vob server operation "Create Container" failed
http://www-01.ibm.com/support/docview.wss?uid=swg21416428
Vob server operation Create Container failed
http://www-01.ibm.com/support/docview.wss?uid=swg21147316
####
III - Conclusion
Vob Backup is not a matter of copy vbs, but we need to be sure:
There is no process running on this Vob.
The backup must be tested.
The restore process must keep the permissions inside .identity directory.
##########################################Disclaimer ##############################################
"The postings on this site are my own and don't necessarily represent IBM's positions, strategies or opinions." #
#################################################################################################
"The postings on this site are my own and don't necessarily represent IBM's positions, strategies or opinions." #
#################################################################################################