Start here:Migrating an ADCD z/OS release to the next release.
For background see Should I use tar or pax to backup my Unix files?
System files
If you have done any configuration to products which use Unix services, you are likely to have changed files in the file system. For example /etc/syslog.conf.
Configuration files
Many configuration files are configured in the /etc directory.
If you want to find which files have been changed since you have been using the system you could use the ls -ltr command to display the files in each directory, displayed with the latest changed date at the bottom.
This gets very tedious when you have a lot of directories to example. However you can ask Unix to list all files which match a critera, such as changed in the last n days, or newer than an existing file.
Create a file of the comparison data
touch -t 202202211456 /tmp/foo
This creates a file /tmp/foo with the given date year 2022 month 02 date 21 time 1456
find . -type f -newer /tmp/foo |xargs ls -ltr > aa
This is two commands.
- The find command
- looks in the current directory (.) and subdirectories
- for objects with type of files (rather than directories etc)
- which have been changed more recently than /tmp/foo.
- The file name is passed to the ls -ltr command to display the date time information.
-rwx------ 1 OMVSKERN OMVSGRP 32 Feb 13 2023 ./cssmtp.env
-rw-r--r-- 1 OMVSKERN OMVSGRP 3453 Feb 13 2023 ./mail/ezatmail.cf
-rwxr-xr-x 1 OMVSKERN OMVSGRP 250 Feb 28 2023 ./hosts
-rw-r--r-- 1 OMVSKERN OMVSGRP 226441 Jun 16 2023 ./pkiserv/pkiserv.tmpl.old
-rw-r--r-- 1 OMVSKERN OMVSGRP 22406 Jun 16 2023 ./pkiserv/pkiserv.conf.old
...
if you use
find . -type f -newer /tmp/foo |tar -cvf ~/etc.tar –
it will create a tar file containing the changed files. You can then transport the etc.tar file to the newer system and untar it.
You can use the pax command to package the files
find . -type f -newer /tmp/foo |pax -W “seqparms=’space=(cyl,(10,10))'” -o saveext -wzvf “//’COLIN.PAX.TEST'” -x os390
to save the files in pax format into the data set COLIN.PAX.TEST. If the high level qualifier has been defined as an alias is the master catalog on both systems, the data set will be visible on both systems.
Note: If you specify
find . -type d -newer /tmp/foo
It displays all directory entries which have been changed, and displays all the files within those directories.
For example
total 1344
-rw-r--r-- 1 OMVSKERN OMVSGRP 3252 May 7 2019 ssh_config
-rw-r--r-- 1 OMVSKERN OMVSGRP 553761 May 7 2019 moduli
-rwx------ 1 OMVSKERN OMVSGRP 65 Oct 29 2019 sshd.sh
For example the sshd directory was changed in September this year, so all the files below it are listed.
Application output files
These are usually in the /var sub-directory. You may not need to move these files across.
User data
You will have your own data in the Unix file systems. If you put the data under the /u file system it should be easy to find!
You may have configured userids so their home directory is on a “user” ZFS file system, or your home directory could be mixed in with the systems files. For example the file system for IBMUSER is on an ADCD file system (D5USS2).
IBMUSER:/S0W1/etc: >df -P ~
Filesystem 512-blocks Used Available Capacity Mounted on
ZFS.USERS 2880000 1277970 1602030 45% /u
The newer system also has a ZFS.USERS. You cannot have both old and new ZFS.USERS mounted at the same time, as the mount takes cataloged data set.
For my application data
IBMUSER:/S0W1/etc: >df -P /u/tmp
Filesystem 512-blocks Used Available Capacity Mounted on
COLIN.ZFS2 2817120 788338 2028782 28% /u/tmp
I can take this ZFS system and mount it on the newer system.
You can tar up the files under a directory and move the tar file to the new system, or you can use pax which I think is better, as it creates a dataset out of the ZFS files.
Using tar
Note: if you use an absolute path in the tar command, when you untar the data it will use the same directory- – which may overrwrite data you wanted to keep.
If you use are relative directory, the data is untarred relative to the current directory.
cd /u/colin
tar -cvf ~/relative.tar *
is better than
tar -cvf ~/absolute.tar /u/colin
On the new system if I use
mk dir oldcolin
cd oldcolin
tar -xtvf relative.tar
it will restore the files in oldcolin.
If I use
mk dir oldcolin
cd oldcolin
tar -xtvf absolute.tar *
it will restore the files to /u/colin – and overwrite any files which were there.
What directories were created?
You can use the command
find /u -type d -newer /tmp/foo |xargs ls -ltrd> aa
to display the directories created/modified since the time of the /tmp/foo file.
This gives output like
drwxrwxrwx 10 OMVSKERN SYS1 8192 Dec 8 13:04 ./adcd
drwxr-xr-x 2 OMVSKERN 1000 8192 Mar 15 2023 ./tmp/oemput
drwxrwxrwx 2 OMVSKERN WEBGRP 8192 Apr 25 2023 ./mqweb3/logs
drwxr-xr-x 2 OMVSKERN SYS1 8192 Jun 16 2023 ./mqweb2/oldconf
You can use the pax -E option to display the contents and extended attributes.
pax -E -f "//'COLIN.PAX.HTTP2'"
Notes the double / and both sets of quotes.
To unpax the files on the new system, cd into the directory and use
pax -k -rvf "//'COLIN.PAX.TEST'" .
The
- -k means do not overwrite
- -r read
- -v display the details
- -f from the following file
- into . (the current directory)
To mount a ZFS on the system
You can have an entry in an BPXPRMxx parmlib member, so a ZFS is mounted at IPL time.
You can also use a TSO command, or a batch job to mount a ZFS
//IBMMFAMO JOB 1,MSGCLASS=H
//MOUNT EXEC PGM=IKJEFT1A
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD *
MOUNT FILESYSTEM('AZF220.ZFS') TYPE(ZFS) +
MOUNTPOINT('/u/mfa') +
MODE(RDWR) PARM('AGGRGROW') AUTOMOVE
Sharing File systems
You can display the mounted file systems using the D OMVS,F command
This gives output like
ZFS 16 ACTIVE RDWR 01/15/2024 L=30
NAME=ZFS.USERS 14.38.54 Q=0
PATH=/u
OWNER=S0W1 AUTOMOVE=N CLIENT=N
ZFS 37 ACTIVE RDWR 01/15/2024 L=48
NAME=COLIN.ZFS2 14.38.56 Q=0
PATH=/u/tmp
OWNER=S0W1 AUTOMOVE=Y CLIENT=N
This shows there are two ZFS file systems, both mounted read/write. The first has
- data set name ZFS.USERS. On the z24C system – this is the z24C file system. You cannot mount both the z24C, and the z25D file systems at the same time, because the mount command uses the cataloged data set.
- mounted as path /u
The second has
- data set name COLIN.ZFS2
- mounted as path /u/tmp
You can choose to mount your data under an existing path, or create a new tree such as “/my”.
One thought on “Migrating an ADCD z/OS release: ZFS files.”