Configuring VPS | Moving wordpress from old hosting to new VPS | Part 2

Part 2:
As now, you have configured VPS, Now its time to move your old wordpress site to our new VPS(Which is already configured with LAMP). If you have not configured till yet, then it is my suggestion that you go back to my first tutorial
Configure VPS | Install LAMP on Centos VPS Part 1

So now lets begin the tutorial
As now, you know the basics on how to handle putty software and the ssh commands,
So lets start

First we will create the backup of the folder in your old server/hosting,
This is can be much easier through Cpanel, but if you don't have, then you have to enable the ssh by asking your hosting people.
Then connect to your old servers ssh and follow these steps

cd public_html/your_directory_of _your_website_folder
tar -cvf foldername.tar
Remember your_directory_of _your_website_folder should be your wordpress folder and foldername.tar foldername will be the wordpress folder name, and your backup will be created in the name of that folder.

Now exit and connect to your new VPS, and follow these commands

cd /var/www/html
wget http://nirajmchauhan.blogspot/wordpress.tar
tar -xvf wordpress.tar

In the first line we are giving the command to change the directory.
Second line, is used to download the compressed backup file from your old server.
REMEMBER:The URL and the back-up-file-name should be perfect, don't directly copy-paste mine
Third line is used to extract the backup

Till now we were successful to bring the wordpress to our new VPS, now we will bring the database of the wordpress.

The very first thing is to create the back-up of the wordpress mysql database, by logging into your old servers phpmyadmin, selecting the appropriate database and exporting that.
For this I ll suggest you to follow this link,
Backing up database

Now if you are ready with the mysql database backup, its time to bring it on our new VPS.


cd /var/www/html
tar -xvf mysql.tar

after extraction of database backup we will integrate it with phpmyadmin.
Before doing this, you have log in to new VPS php-my-admin window and create a new database, lets consider it as niraj

Sample of the code:

mysql -u user -p dbname < {path}/backup.sql 

Actual Code:

mysql -u root -p niraj < /var/www/html/backup/niraj.sql
Just assuming my username to be root, my roots password to be password, niraj to be my new database in php-my-admin, which we created, and niraj.sql is the database sql file which we extracted before few steps.

You have successfully installed your old site to new VPS,
just after this you need to configure your wordpress wp-config file and add user to your php-my-admin for your database.
If any questions, feel free to ask


About Me

My Photo
NiRaJ (asp or php)!!!!!!
I am basically a software engineer and Website designer & developer (final year student)
View my complete profile


WooThemes - Made by Designers