Categories
Uncategorized

Unzip and Restore Website Files Using the SSH Command Line

In a previous article I described how to zip and backup your website files using the LINUX server ssh command line, this time I’ll explain how to unzip and restore website files using the LINUX command line. The process is really quite simple and is achieved in just 2 main steps.

  1. Locate the backup archive file.
  2. Extract the file to the target directory

1. Locate the Backup File

  1. ssh host.server.com
    (replace “host.server.com” with the address of the server where the backup file is located)
  2. cd ~/archive
    (replace “~/archive” with the name of the folder containing the backup file)

2. Extract the file to the target directory

  1. tar -zxvf archive_filename -C destination_parent_folder
    (replace “archive_filename” with the name of the backup file)
    (replace “destination_parent_folder” with the name of the directory which will contain the extracted directories and files)
  2. And there you go. Go to the new destination folder and check that the files are there.
    If the root folder name already exists in the destination parent folder, use the –strip 1 parameter to exclude the root directory while the archive unpacks. This avoids the site root name appearing twice.

Leave a Reply

Your email address will not be published. Required fields are marked *