Server Administration & Management

How to transfer WordPress blog to new server in cPanel

Normally moving thousands of files from one server to another is a time consuming and tiring job but if you use good and effective technique to move your WordPress blog from one webhost to another then it will only take less than an hour to transfer Gigabytes of data from one server to another.

Fully Automated One click backup of all your cPanel data: cPanel Built-in Remote Backup Feature

This method is the best from all the methods I’ll mention below because Remote Backup requires least of your effort and transfer ALL of the data available to you in your old cPanel to your new host’s cPanel Dashboard. There are some things that needs to be available in order to successfully move your blogs, your New and Old Web Host must have to offer cPanel not any other Hosting Management System, ‘Backups’ feature from both new and old hosts is required to be enabled. If both of your Web Hosts implies to these situations then you are good to go just follow simple steps i am going to mention below.

1. Open the Backups manager in your cPanel and click “Generate/Download a Full Backup”
2. For Backup destination choose “Remote FTP Server (Passive Mode Transfer)”
3. Enter the FTP server, username and password
4. Enter the FTP server port (this is usually “21?)
5. Leave Remote Dir field empty
6. Hit “Generate Backup”

Your backup will now be passively generated and transfer from server to server using the net2ftp protocol. If you don’t see this option in your cPanel then you need to ask your host to enable it. If you are using this method to transfer your files you don’t need to manually backup & restore your databases.

Backing up and Restoring your Files & Databases Partially: Compress, Download & Upload site files via SSH (Secure Shell)

SSH is a network protocol that allows data to be exchanged over a secure channel between two computers. Mostly all Web hosts provide SSH facility to users you may have to get it enabled by contacting to your Web host support team. You will also need the PuTTy client to connect to your server via SSH.

1. Login to your Old server via SSH and open the folder which you want to backup e.g.
# cd /home/somepath/to/yourwebsite/public_html
2. Make a compressed archive out of this folder using the command
# tar -cvf sitepack.tar ./
3. Now login to your New server via SSH and use the command below to fetch the backup from server
# wget yourdomain.com/sitepack.tar
4. Next step is to uncompress the archive using the command
# tar -xvf sitepack.tar

Backup & Restore your MySQL databases

If you are using SSH to transfer your files from one server to another you also need to port your databases from old web host to new one. Here I am going to share the most easiest way of backing up and restoring databases is to do from your cPanel’s ‘Backups’ feature. Follow few simple steps to perform successful DB backups.

a) In your cPanel dashboard locate ‘Backups’ menu.
b) There you’ll see list of all your MySQL databases, Simply click on any of the database name and save compressed DB file to your computer.
c) Now when you backed up all the databases to your computer, log in to your new Web host Panel Dashboard and locate ‘Backups’ menu.
d) Here you’ll see ‘Restore a MySQL Database’ simply choose file and restore your databases one by one.

Add MySQL users to your Databases

Now when you have all your files and databases moved in to your new Web host you need to add MySQL users to your databases for that local ‘MySQL Databases’ icon in your cPanel.

4. Add domains to your New Host

Locate ‘Addon Domains’ in your cPanel and add Domains to your new Web host and make sure while adding domains you choose correct site files path in your /public_html/ directory associated to appropriate domain.

5. Edit wp-config.php if your new cPanel Username is different than old

If your new cPanel username is different then it’s important to edit wp-config.php to make MySQL database login information correct and accurate or your blog will encounter ‘can’t establish a database connection’ error.

This is it.

February 27, 2011 Posted by | cPanel, WordPress | , , | 3 Comments