How to restore cpanel backup on new server

Restoring a cPanel backup on a new server involves several steps. Here's a step-by-step guide to help you through the process:

Prerequisites:

  1. You have a valid cPanel backup file (usually a .tar.gz or .tar.bz2 file).
  2. You have access to the new server where you want to restore the backup.
  3. The new server has cPanel installed and configured.
  4. You have the necessary permissions and credentials to access the new server.

Step 1: Upload the backup file to the new server

  1. Use an SFTP client (e.g., FileZilla) to connect to the new server.
  2. Navigate to the /home directory (or the directory where you want to restore the backup).
  3. Upload the backup file to the new server.

Step 2: Extract the backup file

  1. Log in to the new server via SSH.
  2. Navigate to the directory where you uploaded the backup file.
  3. Extract the backup file using the following command:
    tar -xvf <backup_file_name>.tar.gz

    Replace <backup_file_name> with the actual name of your backup file.

Step 3: Restore the database

  1. Log in to the new server via SSH.
  2. Navigate to the /var/cpanel/backups directory.
  3. Run the following command to restore the database:
    mysql -u root -p<root_password> <database_name> < <backup_file_name>.sql

    Replace <root_password> with the root password of your MySQL database, <database_name> with the name of the database you want to restore, and <backup_file_name> with the actual name of your backup file.

Step 4: Restore the files

  1. Log in to the new server via SSH.
  2. Navigate to the /home directory (or the directory where you want to restore the files).
  3. Run the following command to restore the files:
    cp -r <backup_file_name>/* /home/

    Replace <backup_file_name> with the actual name of your backup file.

Step 5: Update the DNS records

  1. Update the DNS records for your domain to point to the new server's IP address.
  2. Verify that the DNS changes have propagated by checking the domain's DNS records using a tool like dig or nslookup.

Step 6: Verify the restoration

  1. Log in to the new server via SSH.
  2. Verify that all files and databases have been restored correctly.
  3. Test your website and email services to ensure they are functioning properly.

Additional tips:

By following these steps, you should be able to successfully restore your cPanel backup on a new server.