restore

$ kopia restore <source> <target-path>

Restore a directory or file from a snapshot into the specified target path.

By default, the target path will be created by the restore command if it does not exist.

The source to be restored is specified in the form of a directory or file ID and optionally a sub-directory path.

For example, the following source and target arguments will restore the contents of the ‘kffbb7c28ea6c34d6cbe555d1cf80faa9’ directory into a new, local directory named ‘d1’

‘restore kffbb7c28ea6c34d6cbe555d1cf80faa9 d1’

Similarly, the following command will restore the contents of a subdirectory ‘subdir/subdir2’ under ‘kffbb7c28ea6c34d6cbe555d1cf80faa9’ into a new, local directory named ‘sd2’

‘restore kffbb7c28ea6c34d6cbe555d1cf80faa9/subdir1/subdir2 sd2’

When restoring to a target path that already has existing data, by default the restore will attempt to overwrite, unless one or more of the following flags has been set (to prevent overwrite of each type):

–no-overwrite-files –no-overwrite-directories –no-overwrite-symlinks

The restore will only attempt to overwrite an existing file system entry if it is the same type as in the source. For example a if restoring a symlink, an existing symlink with the same name will be overwritten, but a directory with the same name will not; an error will be thrown instead.

Flag Short Default Help
--[no-]consistent-attributes false When multiple snapshots match, fail if they have inconsistent attributes
--[no-]ignore-errors false Ignore all errors
--[no-]ignore-permission-errors true Ignore permission errors
--mode auto Override restore mode
--[no-]overwrite-directories true Overwrite existing directories
--[no-]overwrite-files true Specifies whether or not to overwrite already existing files
--[no-]overwrite-symlinks true Specifies whether or not to overwrite already existing symlinks
--parallel 8 Restore parallelism (1=disable)
--[no-]skip-existing false Skip files and symlinks that exist in the output
--[no-]skip-owners false Skip owners during restore
--[no-]skip-permissions false Skip permissions during restore
--[no-]skip-times false Skip times during restore
Argument Help
source Source directory ID/path in the form of a
directory ID and optionally a sub-directory path. For example,
‘kffbb7c28ea6c34d6cbe555d1cf80faa9’ or
‘kffbb7c28ea6c34d6cbe555d1cf80faa9/subdir1/subdir2’
target-path Path of the directory for the contents to be restored
Last modified January 1, 0001