Prepare the environment for the pnfs tools as usual:
[root] #. /usr/etc/pnfsSetup[root] #PATH=${pnfs}/tools:$PATH
Note that you have to do this now even if you did it before because the
content of /usr/etc/pnfsSetup changed.
The conversion of the GDBM file
<backupDir>/databases/<gdbmFile>
is done with the following command:
[root] #gdbm2psql -r -o -i <backupDir>/databases/<gdbmFile>
It is necessary to use the full path to the file. A new database in the PostgreSQL server will be created and the data from the GDBM file will be written into it. A typical output is
Connection string: dbname=template1 user=pnfsserver Connection string: dbname=admin user=pnfsserver WARNING: there is no transaction in progress Put record #1 into the database...time=0 key 000000000000xxxxxxxxxxxx is found at 1310 There are 3671 records in the database.
The conversion script also takes a bit of time, but is fairly
quick. In fact, you may exceed PostgreSQL’s checkpointing
capability, in which case edit the
<database_directory_name>/data/postgresql.conf
file and increase the number of
checkpoint_segments (for example from 3 to
10).
To speed up the conversion the program does not create the database key, so you have to do it in a separate step. For each database created during the conversion run
[root] #psql -U pnfsserver -c 'ALTER TABLE pnfs ADD primary key (pnfsid)' <dbName>
(or use the script
${pnfs}/tools/make-key.sh). This also can
take a while if the files were large.