The same gdbm library must be running on both hosts. This mainly means that the OS must be complatible and the endianess must be identical.
As long as the directory structure is identical the following directories/files have to be moved or created :If parts of the directory structure differs from the source machine some adjustments need to be made.
- File /usr/etc/pnfsSetup has to be moved.
- Directory $database has to be moved.
- All gdbm databases have to be moved. The 'mdb show' command gives a list of all database locations.
- And of course the binaries and tools in $pnfs/tools.
- The $trash directory must be created, with the corresponding substructures $trash/1 ... $trash/7.
- Last but not least : the log directories have to be created and the logfiles should be touched : $pmountdLog, $pnfsdLog, $dbserverLog.
Files or directories which are listed in /usr/etc/pnfsSetup only have to be modified within this file if there new location differs from the old ones.
If a database file gets a new location the corresponding link $database/D-xxxx has to be modified. After all D* files contain the correct destination the $database/databases files has to be removed and 'mdb enable admin' needs to be called to recreate the $database/databases file again.
- The same gdb library must be running on both hosts. This mainly means that the OS must be complatible and the endianess must be identical.
- There is no way to change the dabaseId of an existing database. Consequently the destination pnfs system must not yet use the database Id of the database which will be moved.
What is needed from the source pnfs system ?You need the pnfsId of the top directory within the database which will be moved.Copy the databasefile to the new machine/location and make it known to the destination pnfs system
Theoretically it's possible that there is more than one topdirectory. This depends on how offen the command mkdir .(<databaseId>)(<dirName>) has been used in conjunction with the concerning database. If there is more than one, the procedure has to be repeated for each of them.
- 'cd' into the directory were the 'mkdir' command has been issued.
- use cat .(id)(<dirName>) to obtain the pnfsId of the linkdirectory. <dirName> is the name which was used in the mkdir command. This resulting pnfsId will be used to relink the directory within the new system.
The first 4 digits of the pnfsId must be the hex representation of the concerning databaseId.
- The destination pnfs system must be active for the following steps :
- Get the internal dbid of the moved database : md2tool <databaseFileName> getdbid
- use mdb show to make sure this database id is not yet in use.
- use mdb add <dbName> <fullDatabaseFilePath> to add the file to the destination system. <dbName> as well must be unique and not yet in use by the dest. system, but need not be the same as on the source system.
- 'cd' into the directory from where you want to link to the top directory (directories) of the moved databases.
- do a : basename `pwd` -> <dirName>
- do a : cd ..
- do a : cat .(id)(<dirName>) -> <dirPnfsId>
- the first 4 digits of this <dirPnfsId> are the databaseId of the database where we have to create the link.
- use 'mdb show' to determine the full path of this database.
- deactivate the destination pnfs system : pnfs.server stop
- run 'mdb <fullDbPath>' with the following input line :
addtodirectory <dirPnfsId> <dirName> <linkPnfsId>where :
- <dirPnfsId> is the pnfsId of the directory where you want to have the link to the new database.
- <dirName> name of this link.
- <linkPnfsId> is the pnfsId of the topdirectory to which we want to link.
- activate the system again (pnfs.server start)
- run 'mdb update'