[page_submenu alignment=”center” sticky=”true” bg_color=”#225277″ link_color=”#ffffff”][page_link link_url=”#RemoveFiles” title=”Remove Existing Site Files” id=”1582836095705-2″ tab_id=”1582836095706-9″] [/page_link][page_link link_url=”#DownloadBackups” title=”Download Backup from AWS S3″ id=”1582836095779-8″ tab_id=”1582836095780-8″] [/page_link][page_link title=”Upload Backup to Hosting Server” id=”1582836095832-3″ tab_id=”1582836095833-8″ link_url=”#UploadBackup”][/page_link][page_link title=”Restore cPanel Archive” id=”1582836095878-10″ tab_id=”1582836095879-7″ link_url=”#restore-cpanel-archive”][/page_link][page_link title=”Back To All Guides” id=”1582836095923-3″ tab_id=”1582836095924-7″ link_url=”/how-to-guides”][/page_link][/page_submenu]

REMOVE EXISTING SITE FILES

  • If site files currently exist but are either corrupted or unwanted…
  • In Terminal, use the following command line to remove the current WP Install:
ssh user@host "rm -r -f destination/dir"
    • where user@host is from main SFTP login info for this cPanel account (For example, it might be [email protected].)
    • ***Be sure you know the correct directory before deleting, since this cannot be undone.
    • ***Be sure not to delete the public_html folder.***
    • destination/dir represents the file path to the directory where the WP files for this particular site start. For example, if this WP install is located in a store folder within the public_html folder for this cPanel account, the path would be public_html/store. In many cases the path might be just public_html. (You can use FTP or FileManager to locate the path if needed.) If files are located directly in the public_html folder, you can delete each of the wp-content, wp-admin, wp-includes… folders individually, and the single files in that folder via FTP.
    • The other parts of this script should be typed exactly as shown.
  • Verify that the has been deleted via FTP.
[divider line_type=”Full Width Line” line_thickness=”1″ divider_color=”default” custom_height=”60″]

DOWNLOAD BACKUP FROM AWS S3

For live/dev sites

  • Found in AWS S3 drive in ubs-liquid bucket.
  • In the folder of the day you’d like to backup from, locate the .tar.gz file associated with the cPanel account where this site is hosted.
  • Download the .tar.gz file, move into it’s own folder on your local machine, and then unzip the file with the following command line in Terminal:
    • In Terminal, navigate to the folder that contains the .tar.gz file, then:
tar -zxvf filename.tar.gz
  • In Terminal, navigate to the folder within the newly unzipped backup folder that is associated with the website you’d like to restore (this could be the public_html folder).
  • From there, use the following command line to create a new .tar.gz file of the website you’d like to restore:
    tar -czvf fileneame.tar.gz .
    • This will be the file you use to restore WP files form backup.
  • Database backups are .sql files located in mysql folder in the cPanel backup.

For archived sites

  • Found in AWS S3 drive in ubs-archives bucket.
  • In the SiteArchives –> [domainName] folder, locate the .tar.gz file associated with the website install that you’d like to restore.
  • Download the .tar.gz file to your local machine. This will be the file you use to restore WP files from backup.
  • Download the .sql databse file to your local machine. This will be the file you use to restore database from backup.
[divider line_type=”Full Width Line” line_thickness=”1″ divider_color=”default” custom_height=”60″]

UPLOAD BACKUP TO HOSTING SERVER

Restore WP Files

  • In Terminal, make sure you’re in the dir that contains the .tar.gz file that you’d like to use to restore from backup.
  • From there, use the following command line to upload this backup back into the hosting server to restore the site files:
    scp "filename.tar.gz" user@host:path/
      • where filename.tar.gz is the new restore file that you created in the steps above,
      • user@host is from main SFTP login info for this cPanel account (For example, it might be [email protected].)
      • path/ represents the path that points to the folder in the hosting environment where you’d like this file to be uploaded (most likely in the public_html folder)
  • Then, unzip and open the tarball file in the hosting environment with the following command:
    ssh user@host "cd path; tar –xvf filename.tar.gz"
  • Then, delete the tarball file:
    ssh user@host "cd path; rm –r -f filename.tar.gz"

Restore Database

  • If needed, re-create the associated database and database user in cPanel. (Take a look at the .wp-config file in the WP files to get database name, username, and password.) Follow these instructions to create a database.
  • If there is already a database associated with this site, delete all of the database tables as a clean slate (in phpMyAdmin).
  • In phpMyAdmin, click on the (blank) database. Import the .sql file to restore the database tables.

Restore cPanel Archive

  • Navigate to AWS and download the appropriate cPanel archive tarball
    • ubs-archives folder if it’s an archive
    • ubs-web, ubs-webappssecure, or ubs-indeed if it’s a backup
  • Delete the current cPanel by going to “List Accounts” and finding the correct one. Click on the little plus icon to the left of the domain name and click “Terminate Account”
  • Navigate to “Restore a Full Backup/cpmove File” and scroll down to “Settings”
  • Choose “Restore with File”, upload the tarball you downloaded from AWS, and make sure “Replace all instances of the original server’s IP address with the new IP address, such as in custom A records (default).” is still checked
  • Click “Restore” and you should see the restored cPanel under “List Accounts”

Restore MULTI-SITE cPanel Archive

  • Steps are the same for a single site, with execption of one thing, you’ll need to enable “Remote Domains”
  • 1. In WHM, go to “Tweak Settings”
    2. Search for “Remote Domains”
    3. Toggle to allow remote domains
  • Navigate to AWS and download the appropriate cPanel archive tarball
    • ubs-archives folder if it’s an archive
    • ubs-web, ubs-webappssecure, or ubs-indeed if it’s a backup
  • Delete the current cPanel by going to “List Accounts” and finding the correct one. Click on the little plus icon to the left of the domain name and click “Terminate Account”
  • Navigate to “Restore a Full Backup/cpmove File” and scroll down to “Settings”
  • Choose “Restore with File”, upload the tarball you downloaded from AWS, and make sure “Replace all instances of the original server’s IP address with the new IP address, such as in custom A records (default).” is still checked
  • Click “Restore” and you should see the restored cPanel under “List Accounts”
  • (IMPORTANT) Go back to Tweak Settings and toggle of the allow remote domains (for security reasons)