bprestore

Article:HOWTO43687  |  Created: 2011-03-07  |  Updated: 2011-03-07  |  Article URL http://www.symantec.com/docs/HOWTO43687
Article Type
How To


Environment

Subject


Name

bprestore — restore files from NetBackup Server

SYNOPSIS

bprestore [-A | -B] [-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] [-copy copy_number] [-granular_restore] [-priority number] [-w [hh:mm:ss]] -f listfile | filenames [-ev_migrated_data]

On UNIX and Linux 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, schedule type, or date range is not specified, bprestore starts with the most recently 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 and Linux 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 and Linux 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 using bprestore on a Solaris system, use the following path: /opt/openv/netbackup/bin/bprestore.

OPTIONS

-A | -B

Specifies whether to restore from archives (-A) or backups (-B). The default is -B.

-BR portal_name | teamsite_name

Specifies a portal name or the team site name to 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.

-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.

-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 masterserver 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 file_options

Allows either Backup Exec files to be restored, or both Backup Exec and NetBackup files to be restored. The default ( -F is not specified), is to restore only NetBackup files.

To restore only Backup Exec files specify:

-F 524288

To restore Backup Exec and NetBackup files specify:

-F 1048576
-K

Causes bprestore to keep existing files rather than overwrite them when it restores files with the same name. The default is to overwrite existing files.

Note:

The -l | -H | -y options apply only when you restore UNIX files to a UNIX system.

-granular_restore

-l | -H | -y

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.

-md

Mounts the database so that it is available to users. This option is only available if Commit after restore completes is selected.

-r

Specify this option to restore raw partitions (UNIX and Linux systems) or disk images (Windows systems) instead of file systems.

-L progress_log [-en]

Specifies the name of an existing file in which to write progress information. For example:

UNIX and Linux systems: /home/tlc/proglog

Windows systems: c:\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.

-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.

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 and Linux 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 to C:\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 to C:\fred2.txt:

rename 11 /C/fred.txt 12 /C/fred2.txt

(Be sure to end the entry with a return.)

-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.

-D client

Specifies a destination client. The default is the current client name.

On UNIX and Linux systems, the master server root user can use this option to do the following: Direct restored files to a machine 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 machine other than the client that the -C option specifies.

disk_media_server media_server

Specifies the disk media server to be used for the restore operation. The default is the current media server.

-S master_server

Specifies the name of the NetBackup server.

On UNIX and Linux 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 Specify NetBackup Machines dialog. To display this dialog box, start the Backup, Archive, and Restore user interface on the client. Then click Specify NetBackup Machines 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) Web site 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

4 = Oracle

6 = Informix-On-BAR

7 = Sybase

8 = MS-SharePoint

10 = NetWare

13 = MS-Windows-NT

14 = OS/2

15 = MS-SQL-Server

16 = MS-Exchange-Server

19 = NDMP

Note that the following policy types apply only to NetBackup Enterprise Server:

11 = DataTools-SQL-BackTrack

17 = SAP

18 = DB2

20 = FlashBackup

21 = Split-Mirror

22 = AFS

35 = NBU-Catalog

39 = Enterprise-Vault

-p policy

Specifies the policy for which the backups or archives were performed.

-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 end date for 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 /user/openv/msg/.conf file (UNIX and Linux) and the install_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 the "Specifying the locale of the NetBackup installation" topic 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.

-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 and Linux systems, the default location is /temp.

On Windows systems, the default location is C:\temp.

-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.

-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 /user/openv/msg/.conf file (UNIX and Linux) and the install_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 the "Specifying the locale of the NetBackup installation" topic 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.

-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.

-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 and Linux 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 /user/openv/msg/.conf file (UNIX and Linux) and the install_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 the "Specifying the locale of the NetBackup installation" topic 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. (Exception: NDMP restores)

The following is an example that uses filepathlen filepath:

UNIX and Linux 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, following all other options. You must also specify 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 pat. (Exception: NDMP restores.)

For Windows systems, use upper case for the drive letter. For example, C:\NetBackup\log1.

EXAMPLES

Example 1 - Restore files from backups of file1 that were performed between 04/01/2006 06:00:00 and 04/10/2006 18:00:00. Enter on one line the following:

UNIX and Linux 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/10 06:00:00 -e 04/10/10 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 and Linux systems: # bprestore -f restore_list
Windows systems: # bprestore -f c:\restore_list

Example 3

UNIX and Linux 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 /home/kwc/bkup.log. Enter the following on one line:

# bprestore -k "*My Home Directory*" -L /home/kwc/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 d:\kwc\bkup.log. Enter the following on one line:

# bprestore -k "*My Home Directory*" -L d:\kwc\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 and Linux systems: # bprestore -k "*My Home Dir*" -C slater 
-D slater -t 13 -L /home/kwc/bkup.log /D
Windows systems: # bprestore -k "*My Home Dir*" -C slater -D slater 
-t 13 -L c:\kwc\bkup.log D:\

Example 5 - Assume that you have a rename file named /home/kwc/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 /home/kwc/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/10 06:00:00 and 04/10/10 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 and Linux systems: # bprestore -s 04/01/10 06:00:00 -e 04/10/10 \ 
18:00:00 /home/user1 !/home/user1/*.pdf /home/user1/final_doc.pdf
Windows systems: # bprestore -s 04/01/10 06:00:00 -e 04/10/10 18:00:00 
C:\user1\ !C:\user1\*.pdf C:\user1\final_doc.pdf

FILES

UNIX and Linux systems:

$HOME/bp.conf
/usr/openv/netbackup/logs/bprestore/log.mmddyy

Windows systems:

install_path\NetBackup\logs\bprestore\*.log

SEE ALSO

See bp.

See bparchive.

See bplist.


Legacy ID



v14666184_v55366869


Article URL http://www.symantec.com/docs/HOWTO43687


Terms of use for this information are found in Legal Notices