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:
- You have a valid cPanel backup file (usually a
.tar.gz
or.tar.bz2
file). - You have access to the new server where you want to restore the backup.
- The new server has cPanel installed and configured.
- You have the necessary permissions and credentials to access the new server.
Step 1: Upload the backup file to the new server
- Use an SFTP client (e.g., FileZilla) to connect to the new server.
- Navigate to the
/home
directory (or the directory where you want to restore the backup). - Upload the backup file to the new server.
Step 2: Extract the backup file
- Log in to the new server via SSH.
- Navigate to the directory where you uploaded the backup file.
- 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
- Log in to the new server via SSH.
- Navigate to the
/var/cpanel/backups
directory. - 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
- Log in to the new server via SSH.
- Navigate to the
/home
directory (or the directory where you want to restore the files). - 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
- Update the DNS records for your domain to point to the new server's IP address.
- 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
- Log in to the new server via SSH.
- Verify that all files and databases have been restored correctly.
- Test your website and email services to ensure they are functioning properly.
Additional tips:
- Make sure to test your backup before restoring it to a new server to ensure it's complete and accurate.
- If you're restoring a backup from an older version of cPanel, you may need to update the cPanel version on the new server to match the version of the backup.
- If you encounter any issues during the restoration process, you may need to contact your hosting provider or a cPanel expert for assistance.
By following these steps, you should be able to successfully restore your cPanel backup on a new server.