Transferring a website professionally – Web Host Pro
Transferring a cPanel website and server involves moving all your website files, databases, and configurations from one cPanel account and server to another.
Here’s a step-by-step guide for websites and servers:
Contents
Option 1: Full cPanel Backup and Restore (Recommended)
- Go to the Backup Wizard or Backup under the Files section.
- Select Full Backup and choose the backup destination (you can save it locally or send it to a remote FTP server).
- Once the backup is completed, download the backup file to your computer.
- Go to the Backup Wizard or Backup again and choose Restore.
- Upload the full backup file you downloaded earlier.
- The restoration will import all your files, databases, emails, and configurations.
Option 2: Manual Transfer
- In the source cPanel, go to File Manager under Files.
- Compress the public_html directory (or the relevant directory) into a .zip file.
- Download the compressed file to your computer.
- Go to phpMyAdmin under Databases.
- Select the database(s) you need and click on Export to download a .sql file.
- In the destination cPanel, go to File Manager and upload the .zip file to the public_html directory.
- Extract the file after uploading.
- In the destination cPanel, go to MySQL Databases and create a new database and user.
- Go to phpMyAdmin and select the new database, then click Import and upload the .sql file you downloaded earlier.
- Ensure that the configuration files (like wp-config.php for WordPress or config.php for other CMS platforms) have the correct database credentials (name, username, password, host).
- Before updating DNS settings, test the website by accessing it via a temporary URL or by editing your local hosts file.
Option 3: Using the cPanel Transfer Tool (for server admins)
- If you have root access, the Transfer Tool in WHM can be used to directly transfer accounts from one server to another.
Post-Transfer Steps
- Update the DNS settings to point to the new server.
- Wait for DNS propagation (this may take up to 48 hours).
- Test your website to ensure everything is working correctly.
Server Transfer
Transferring a server involves migrating all the data, applications, configurations, and settings from one server to another. This can be more complex than moving a single website, as it often involves various services, databases, and other critical elements. Here’s a general step-by-step guide to transferring a server:
Step 1: Assess the Environment and Prepare
- List all software, services, databases, and applications running on the current server.
- Identify dependencies and specific configurations.
- Ensure the destination server meets or exceeds the requirements (OS version, software, hardware).
- Install necessary software, libraries, and services that your applications require.
- Take a full backup of the source server, including files, databases, and configuration settings.
- Ensure you have a rollback plan in case something goes wrong.
Step 2: Transfer Files and Data
- Use rsync, scp, or SFTP to copy files securely:
rsync -avz /source/directory/ user@destination_server:/target/directory/scp -r /source/directory/ user@destination_server:/target/directory/
- MySQL/MariaDB: Use mysqldump to export the databases and import them on the new server:
mysqldump -u root -p database_name > backup.sql
Then, import on the new server:
mysql -u root -p database_name < backup.sql
- PostgreSQL: Use pg_dump for export and import:
pg_dump database_name > backup.sql
And on the destination server:
psql database_name < backup.sql
- Copy over any critical configuration files (e.g., /etc/nginx/nginx.conf, /etc/apache2/apache2.conf, /etc/php.ini) and adjust paths or settings as needed for the new environment.
Step 3: Update and Test Services
- Set up and configure the web server (Nginx, Apache, etc.) to serve your application on the new server.
- Ensure that any firewall rules, security groups, and SSL certificates are correctly configured.
- Make sure application configuration files point to the correct database on the new server.
- Perform tests to ensure that the website or applications are functioning as expected.
- Check logs for errors and troubleshoot as necessary.
Step 4: Update DNS and Go Live
- Update the DNS settings to point to the new server’s IP address. This is typically done through your domain registrar or DNS provider.
- Allow up to 24–48 hours for full DNS propagation.
- During the DNS propagation, monitor both servers for any issues.
- Once confident that the transition is smooth, decommission the old server.
Step 5: Final Cleanup and Optimization
- Implement security measures like firewalls, SSH key authentication, etc.
- Optimize server performance settings based on your application’s needs.
- Set up automated backups for the new server to ensure you can recover data in case of an issue.