Veritas NetBackup™ Commands Reference Guide
- Introduction
- Appendix A. NetBackup Commands
Name
bprestore — restore files from NetBackup Server
SYNOPSIS
[-A | -B | -rb] [-K] [-l | -H | -y] [-r] [-T] [-L progress_log [-en]] [-R rename_file] [-C client] [-D client] [-S master_server] [-disk_media_server media_server][-t policy_type] [-p policy] [-k "keyword_phrase"] [-cm] [-drs] [-md] [-dd] [-td temp_dir] [-s date] [-e date] [-F file_options] [-spsredir_server hostname] [-spscurver] [-spsignorelock] [-spspreserveiis] [-spsrestoresecurity] [-spsverkeep [0 | 1 | 2]] [-vhd_fn VHD_filename] [-vhd_type 0 | 1] [-vhd_dsize VHD_disk_size] [-vhd_dof 0 | 1] -BR portal_name | teamsite_name | Exchange_2010_redirected_path] [-copy copy_number] [-granular_restore] [-priority number] [-w [hh:mm:ss]] [-ev_migrated_data] -f listfile | filenames [-print_jobid] [-optimized_backup 0 | 1]
On UNIX systems, the directory path to this command is /usr/openv/netbackup/bin/
On Windows systems, the directory path to this command is install_path\NetBackup\bin\
DESCRIPTION
bprestore lets users restore a backed up or archived file or list of files. You can also name directories to restore. If you include a directory name, bprestore restores all files and subdirectories of that directory. You can exclude a file or a directory path that was previously included in the restore by placing an exclamation mark (!) in front of the file or the directory path (does not apply to NDMP restores). For example, the exclude capability is useful if you want to exclude part of a directory from the restore.
Note:
If a policy or date range is not specified, bprestore starts with the most recent full backup image. It includes all subsequent incremental and differential backup images. The most recent copy of a file is restored from these images.
By default, you are returned to the system prompt after bprestore is successfully submitted. The command works in the background and does not return completion status directly to you. The -w option lets you change this behavior so bprestore works in the foreground and then returns completion status after a specified time period.
The bprestore command restores the file from the most recent backups within the time period you specify, except for a true-image restore. (See the -T option description.)
bprestore overwrites any file of the same name that already exists on the local client disk, unless you include the -K option. You also can restore the files that were backed up or archived on another client (-C option). To restore from other clients, the NetBackup administrator must validate you.
bprestore writes informative and error messages to a progress log file if you do the following: create the file before you run the bprestore command and then specify the file with the -L progress_log option. If bprestore cannot restore the requested files or directories, you can use the progress log to find the reason for the failure.
For detailed troubleshooting information, create a directory that is named /usr/openv/netbackup/logs/bprestore (UNIX systems) or install_path\NetBackup\logs\bprestore (Windows systems) with public-write access. bprestore then creates a debug log file in this directory.
For UNIX systems, if a nonroot user specifies USEMAIL = mail_address in the $HOME/bp.conf
file, the following occurs: NetBackup sends mail on the restore completion status to mail_address. This message is sent when the restore process is complete.
The following restrictions apply to bprestore:
You can restore the files and the directories that you own and those owned by other users if you have read access. You need write access to another user's directories and files to restore that user's files to their original location.
The operating system restricts the number of files and directories that you can specify on a single bprestore command line. If this restriction is a problem, use the -f option to restore the files.
Use the bplist command to display information on the files and directories that were backed up or archived.
Note:
If you restore catalog files directly by using bprestore on a Solaris system, use the following path: /opt/openv/netbackup/bin/bprestore.
OPTIONS
- -A | -B | -rb
Specifies if data is to be restored from archives (-A), backups (-B), or snapshot rollbacks (-rb). The default is -B.
Note:
The rollback (-rb) operation always occurs from copy 1. If copy 1 is expired, the rollback fails.
- -BR portal_name | teamsite_name | Exchange_2010_redirected_path
Specifies a portal name, team site name, or Exchange 2010 redirected path name where the selected portal or team site is to be redirected in a SharePoint farm. A user should specify the redirected portal or team site as
http://portalname
|http://teamsitename
, and should already exist in a farm.- -C client
Specifies a client name to use for finding backups or archives from which to restore files. This name must be as it appears in the NetBackup catalog. The default is the current client name.
Note:
The destination client does not default to the source client. See the description for -D client option.
- -cm
Enables the restore operation to play through log files and roll back any incompleted transactions. Use this option if your selection contains the last backup to be restored. If this option is not selected, the database is left in an intermediate state and is not yet usable.
- -copy copy_number
Specifies the copy number to restore from. The user is able to restore from a different copy than the primary copy. For example, -copy 3 restores copy 3 of a file or list of files.
Alternatively, you may specify the copy from which to restore at a global level (for all restore operations). Put the copy number into the file ALT_RESTORE_COPY_NUMBER.
Refer to "Restoring from a specific backup copy" of the NetBackup Backup, Archive, and Restore online Help for a complete description.
- -D client
Specifies a destination client. The default is the current client name.
On UNIX systems, the master server root user can use this option to do the following: Direct restored files to a computer other than the client that the -C option specifies.
On Windows systems, the master server administrator can use this option to do the following: Direct restored files to a computer other than the client that the -C option specifies.
- -disk_media_server media_server
Identifies the disk media server to be used for the restore operation. The default server is the one currently being used.
- -drs
Restores the files without access-control attributes. By default, access-control attributes are restored along with file and directory data. Option -drs is available only to NetBackup administrators.
- -ev_migrated_data
Restores the migrated data from Enterprise Vault. bprestore -ev_migrated_datadoes not support the restoration of migrated data from a non-Enterprise Vault source. Use the other bprestore parameters as required.
The following example restores migrated data from Vault1 to master server ms1 using an NDMP policy type. The files to be restored are listed in file
restorefiles
.# bprestore -S ms1 -C Vault1 -t 19 -ev_migrated_data restorefiles
- -f listfile
Specifies a file (listfile) that contains a list of files to be restored and can be used instead of the filenames option. In listfile, list each file path must be on a separate line.
The required format for the file list depends on whether the files have spaces or newlines in the names.
To restore the files that do not have spaces or new lines in the names, use this format:
filepath
Where filepath is the path to the file that you restore. For example:
Note:
For Windows systems, use upper case for the drive letter. For example,
C:\NetBackup\Log1
.UNIX systems:
/home /etc /var
Windows systems:
C:\programs C:\winnt C:\documents\old_memos
To restore the files that have spaces or new lines in the names, use one of the following formats:
filepathlen filepath filepathlen filepath start_date_time end_date_time filepathlen filepath -s datetime -e datetime
The filepath is the path to the file you restore.
The filepathlen is the total number of characters in the file path.
The start_date_time and end_date_time are the decimal number of seconds since 01/01/1970 00:00:00.
datetime is the same as the command line (mm/dd/yy [hh[:mm[:ss]]]). The command uses the start date, end date, and time from the command line unless a line in listfile overrides it. The dates may change from line to line.
The required date and time values format in NetBackup commands varies according to your locale. The
/usr/openv/msg/.conf
file (UNIX) and theinstall_path\VERITAS\msg\LC.CONF
file (Windows) contain information such as the date-time formats for each supported locale. The files contain specific instructions on how to add or modify the list of supported locales and formats.See "About specifying the locale of the NetBackup installation" in the NetBackup Administrator's Guide, Volume II.
To exclude a file or a directory path that was previously included in the restore, place an exclamation mark (!) in front of the file or the directory path. NDMP and FlashBackup restores do not support the exclude option.
The following is an example that uses filepathlen filepath:
UNIX systems:
5 /home 4 /etc 4 /var 19 /home/abc/test file 12 !/etc/passwd
Windows systems:
11 C:\programs 8 C:\winnt 22 C:\documents\old memos 17 !C:\programs\test -f filenames
Names one or more files to be restored and can be used instead of the -f option.
Any files that you specify must be listed at the end of the command line after all other options. You must use absolute file paths.
To exclude a file or a directory path that was previously included in the restore, place an exclamation mark (!) in front of the file or the directory path. NDMP and FlashBackup restores do not support the exclude option.
For Windows systems, use upper case for the drive letter. For example,
C:\NetBackup\log1
.- -F file_options
Allows NetBackup files to be restored.
- -granular_restore
Enables the restore of the objects and attributes in the Active Directory. If this option is not specified, the restore still runs, but the backup cannot produce granular restores.
- -J
If specified, newer snapshots on the volume may be lost. This option is used only with the rollback restore (-rb) option.
- -K
Causes bprestore to keep existing files rather than overwrite them when it restores files with the same name. The default condition is to overwrite existing files.
When you use -K with the rollback (-rb) option, it means to not perform verification before the rollback. Files that are added on the volume after the snapshot is taken would be lost.
- -k "keyword_phrase"
Specifies a keyword phrase for NetBackup to use when it searches for backups or archives from which to restore files. The phrase must match the one that was previously associated with backup or archive by the -k option of the bpbackup or the bparchive command.
Use this option in place of or in combination with the other restore options to more easily restore your backups and archives. The meta-characters that follow simplify the match of keywords or parts of keywords in the phrase:
* matches any string of characters.
The "?" character matches any single character.
[ ] matches one of the sequence of characters that is specified within the brackets.
[ - ] matches one of the range of characters that the "-" separates.
The keyword phrase can be up to 128 characters in length. All printable characters are permitted including space (" ") and period (".").
The phrase must be enclosed in double quotes ("...") or single quotes ('...').
The default keyword phrase is the null (empty) string.
- -L progress_log [-en]
Specifies the name of an existing file in which to write progress information. For example:
UNIX systems:
netbackup/logs/user_ops/proglog
Windows systems:
NetBackup\logs\user_ops\proglog
The default is not to use a progress log.
Include the -en option to generate a log entry in English. The name of the log contains the string _en. This option is useful to support any personnel that assist in a distributed environment where different locales may create logs of various languages.
Only default paths are allowed for this option and Veritas recommends to use the default paths. If you cannot use the NetBackup default path in your setup, you should add custom paths to the NetBackup configuration.
For more information on how to add a custom path, see the "BPCD_WHITELIST_PATH option for NetBackup servers and clients" topic in the NetBackup Administrator's Guide, Volume I.
- -l | -H | -y
Note:
The -l | -H | -y options apply only when you restore UNIX files to a UNIX system.
Specify -l to rename the targets of UNIX links by using the -R rename_file option in the same way as when you rename files.
Specify -H to rename UNIX hard links by using the -R rename_file option in the same way as when you rename files. Soft links are unchanged.
Specify -y to rename UNIX soft links by using the -R rename_file option in the same way as when you rename files. Hard links are unchanged.
See Example 5 in the EXAMPLES section.
- -M
Enables the client job to be monitored.
- -md
Mounts the database so that it is available to users. This option is only available if
is selected.- -optimized_backup 0 | 1
Specifies if the restore operation is done from an optimized backup.
- -p policy
Specifies the policy for which the backups or archives were performed.
- -print_jobid
Display to the
stdout
the job ID of the restore job that the bprestore command initiates.- -r
Specify this option to restore raw partitions (UNIX systems) or disk images (Windows systems) instead of file systems.
- -R rename_file
Specifies the name of a file with name changes for alternate-path restores.
For example: bprestore -R /C/renamefile /C/origfile
Where
/C/rename_file
is the file with the name change and/C/origfile
is the file to be renamed. The pathname that you enter must be an absolute path.Use the following form for entries in the rename file:
change backup_filepath to restore_filepath
The file paths must start with / (slash)
The first backup_filepath that is matched is replaced with the restore_filepath string.
The default is to restore by using the original path.
On UNIX systems: For example, the following entry renames
/usr/fred
to/usr/fred2
:change /usr/fred to /usr/fred2
On Windows systems: For example, the following entry renames
C:\users\fred
toC:\users\fred2
:change /C/users/fred to /C/users/fred2
Use all upper case for the drive letter and end the entry with a return.
When you restore to a Windows client, you can also use the following method for specifying entries in the rename file. (Do not use this method for other clients.)
rename bulength backup_filepath reslength restore_filepath
Where:
bulength is the number of ASCII characters in the backup path.
reslength is the number of ASCII characters in the restore path.
The first backup_filepath that is matched is replaced with the restore_filepath string.
For example, the following entry renames
C:\fred.txt
toC:\fred2.txt
:rename 11 /C/fred.txt 12 /C/fred2.txt
(Be sure to end the entry with a return.)
Only default paths are allowed for this option and Veritas recommends to use the default paths. If you cannot use the NetBackup default path in your setup, you should add custom paths to the NetBackup configuration.
For more information on how to add a custom path, see the "BPCD_WHITELIST_PATH option for NetBackup servers and clients" topic in the NetBackup Administrator's Guide, Volume I.
- -s date, -e date
Specifies the start and the end date range for the listing. The bprestore command restores only files from backups or the archives that occurred within the specified start and end date range.
-s specifies a start date and time for the restore window. bprestore restores files only from the backups or the archives that occurred at or after the specified date and time.
Note:
To restore multistreamed images, first run bplist -l to get the modification time of the desired files during the last backup that contained the files. Specify that date as the -s when you run the bprestore command. If you specify no start or no end date for the files that have been backed using multiple data streams, errors may result.
The required date and time values format in NetBackup commands varies according to your locale. The
/usr/openv/msg/.conf
file (UNIX) and theinstall_path\VERITAS\msg\LC.CONF
file (Windows) contain information such as the date-time formats for each supported locale. The files contain specific instructions on how to add or modify the list of supported locales and formats.More information is available about the locale of your system.
See "About specifying the locale of the NetBackup installation" in the NetBackup Administrator's Guide, Volume II.
The valid range of dates is from 01/01/1970 00:00:00 to 01/19/2038 03:14:07. The default start date is 01/01/1970 00:00:00.
The default is to return the most recent image. For backups, this image is the most recent full backup if a full backup exists. If a full backup does not exist, then the most recent incremental or user-directed backup is restored.
-e specifies an end date and time for the restore window. bprestore restores only files in the backups or the archives that occurred at or before the specified date and time. Use the same format as for the start date and time.
The end backup date and time do not need to be exact, except for a true-image restore (see the -T option description). bprestore restores the file that has the specified backup date and time. Or it restores the file that precedes the end date and time, which is the most recent backup. The default is the current date and time.
- -S master_server
Specifies the name of the NetBackup server.
On UNIX systems, the default is the first server found in the
/usr/openv/netbackup/bp.conf
file.On Windows systems, the default is the server designated as current on the Servers tab of the dialog box. To display this dialog box, start the Backup, Archive, and Restore user interface on the client. Then click on the File menu.
- -spscurver
For SharePoint operation, -spscurver restores only the most recent version of an item.
- -spsignorelock
For SharePoint operation, -spsignorelock releases the lock on the SharePoint farm topology, if it is set.
- -spspreserveiis
For SharePoint operation, -spspreserveiis preserves the existing Internet Information Services (IIS) website and application pool.
- -spsredir_server hostname
For SharePoint operation, this option specifies the web server on which the redirected portal or team site resides in a SharePoint farm. The redirected web server should be specified as hostname.
- -spsrestoresecurity
For SharePoint operation, -spsrestoresecurity includes security information in the restore operation.
- -spsverkeep 0 | 1 | 2
For SharePoint operation, -spsverkeep specifies if versioning is enabled on the restore destination.
- -t policy_type
Specifies one of the following numbers that corresponds to the policy type. The default is 0 for all clients except Windows, where the default is 13.
0 = Standard
8 = MS-SharePoint
13 = MS-Windows
16 = MS-Exchange-Server
19 = NDMP
20 = FlashBackup
21 = Split-Mirror
25 = Lotus-Notes
29 = FlashBackup-Windows
30 = Vault
35 = NBU-Catalog
38 = PureDisk-Export
39 = Enterprise-Vault
40 = VMware
41 = Hyper-V
44 = BigData
- -T
Specifies a true-image restore, where only the files and the directories that existed in the last true-image backup are restored. This option is useful only if true-image backups were performed. If this option is not specified, all files and directories that meet the specified criteria are restored, even if they were deleted.
When the -T option is specified, the image that is requested must be uniquely identified. Unique identification is accomplished by using the -e option with seconds granularity. The -s option (if any) is ignored. The seconds granularity of an image can be retrieved by using the bplist command with the -l and -Listseconds options.
- -td temp_dir
This option provides a location where the associated log and any patch files are to be kept until the database is restored. If storage groups are restored, a subdirectory in temp_dir is created for each storage group. The log and patch files for each storage group are kept in the corresponding subdirectory.
On UNIX systems, the default location is /temp.
On Windows systems, the default location is C:\temp.
- -vhd_dof 0 | 1
For Hyper-V operation, -vhd_dof specifies whether or not to delete on any failure. Possible values are 1 (delete on failure) and 0 (do not delete on failure).
- -vhd_dsize VHD_disk_size
For Hyper-V operation, -vhd_dsize specifies the size of the VHD file to be recovered.
- -vhd_fn VHD_filename
For Hyper-V operation, -vhd_fn specifies the name of the VHD file to be recovered.
- -vhd_type 0 | 1
For Hyper-V operation, -vhd_type specifies the type of the VHD file. Possible values for this option are the following:
1 - Fixed.
2 - Dynamic.
- -w [hh:mm:ss]
Causes NetBackup to wait for a completion status from the server before it returns you to the system prompt.
The required date and time values format in NetBackup commands varies according to your locale. The
/usr/openv/msg/.conf
file (UNIX) and theinstall_path\VERITAS\msg\LC.CONF
file (Windows) contain information such as the date-time formats for each supported locale. The files contain specific instructions on how to add or modify the list of supported locales and formats.More information is available about the locale of your system.
See "About specifying the locale of the NetBackup installation" in the NetBackup Administrator's Guide, Volume II.
You can optionally specify a wait time in hours, minutes, and seconds. The maximum wait time you can specify is 23:59:59. If the wait time expires before the restore is complete, the command exits with a timeout status. The restore, however, still completes on the server.
If you specify 0 or do not specify a time, the wait time is indefinite for the completion status.
EXAMPLES
Example 1 - Restore files from backups of file1 that were performed between 04/01/2010 06:00:00 and 04/10/2010 18:00:00. Enter the following:
UNIX systems:
# bprestore -s 04/01/2010 06:00:00 -e 04/10/2010 18:00:00 /usr/user1/file1
Windows systems:
# bprestore -s 04/01/2010 06:00:00 -e 04/10/2010 18:00:00 C:\user1\file1
Example 2 - Restore the files that are listed in a file named restore_list by using the most recent backups, enter the following:
UNIX systems:
# bprestore -f restore_list
Windows systems:
# bprestore -f c:\restore_list
Example 3
UNIX systems:
Restore directory /home/kwc
from the backups that are associated with a keyword phrase that contains "My Home Directory". Use a progress log named /usr/openv/netbackup/logs/user_op/bkup.log
. Enter the following on one line:
# bprestore -k "*My Home Directory*" -L /usr/openv/netbackup/logs/user_op/bkup.log /home/kwc
Windows systems:
Restore directory C:\kwc
from the backups that are associated with a keyword phrase that contains "My Home Directory". Use a progress log named c:\Program Files\Veritas\NetBackup\logs\user_ops\bkup.log
. Enter the following on one line:
# bprestore -k "*My Home Directory*" -L c:\Program Files\Veritas\NetBackup\logs\user_ops\bkup.log C:\kwc
Example 4 - Restore the D drive on the Windows client slater from the backups that are associated with a keyword phrase that contains "My Home Dir". Use a progress log named bkup.log. Enter the following all on one line or use the backslash continuation character:
UNIX systems:
# bprestore -k "*My Home Dir*" -C slater -D slater -t 13 -L /usr/openv/netbackup/logs/user_op/bkup.log /D
Windows systems:
# bprestore -k "*My Home Dir*" -C slater -D slater -t 13 -L c:\Program Files\Veritas\NetBackup\logs\user_ops\bkup.log D:\
Example 5 - Assume that you have a rename file named /usr/openv/netbackup/logs/user_ops/rename
on a UNIX client and it contains the following:
change /home/kwc/linkback to /home/kwc/linkback_alt
To restore the hard link that is named /home/kwc/linkback
to alternate path /home/kwc/linkback_alt
on that client, run the following command:
# bprestore -H -R /usr/openv/netbackup/logs/user_ops/rename /home/kwc/linkback
Example 6 - Assume that you want to restore files from backups of the file user1.
The backups were performed between 04/01/12 06:00:00 and 04/10/12 18:00:00. You also want to exclude all files with a .pdf extension, except for the file named final_doc.pdf. To perform this operation, run the following (on one line):
UNIX systems:
# bprestore -s 04/01/12 06:00:00 -e 04/10/12 \ 18:00:00 /home/user1 !/home/user1/*.pdf /home/user1/final_doc.pdf
Windows systems:
# bprestore -s 04/01/12 06:00:00 -e 04/10/12 18:00:00 C:\user1\ !C:\user1\*.pdf C:\user1\final_doc.pdf
FILES
UNIX systems:
$HOME/bp.conf /usr/openv/netbackup/logs/bprestore/log.mmddyy
Windows systems:
install_path\NetBackup\logs\bprestore\*.log