Knowledgebase: Tips and tricks
Changing User/Group file attributes during restore
Posted by Sven Koester, Last modified by Andre Kuehnemund on 10 May 2011 11:29
During file restore, PresSTORE restores all file attributes, including the user and group attribute, as they were on the file that was originally saved. |
From PresSTORE 3.0.6 on, the user and group file attributes can be changed during restore operations on Unix hosts.
This is helpful e.g. when a different user that the one who owned the original files files wants to restore them (and could not access them otherwise),
or when restoring files from a different computer.
The way this is implemented is a mapping from the original user and group id to a new id.
The setup is done in the configuration file
To enable mapping, add the following lines:
ns_param userMap "mymapping"
ns_param groupMap "mymapping"
The line userMap defines the user id mapping, the line groupMap the group id mapping. Each of the two lines can be omitted, in which case PresSTORE keeps the original user or group.
Each mapping, in the above lines shown as "mymapping" is declared to have the following format:
"original-id-1 replacement-id-1" "original-id-2 replacement-id-2" "original-id-3 replacement-id-3" ...
The placeholder "-1" stands for any id, e.g. the following line:
ns_param groupMap "-1 100"
defines a mapping from any group id to the id 100.
The following map:
ns_param userMap "0 500 100 100 101 105 -1 110"
defines the following conversion:
The section heading in the above
refers to the host "localhost". In case the mapping shall be applied on a different host, enter that hosts client name (from the PresSTORE Client list) instead of the "localhost".