I earlier wrote a post on the need and use for moving your website to a new host. I also gave a gist on the process of moving to a new host. In this post i will share a simple tutorial for transferring your wordpress blog from a existing host to a new host.
The main thing that is to be done for a website transfer to a new host is to copy your existing files, database and modifying the wp-config.php file in your main WordPress folder. In the wp-config.php following MySQL settings need to be altered:-
- DB_NAME :- Here you should enter the name of the WordPress database, e.g define(‘DB_NAME’, ‘user_techvorm’);
- DB_USER :- Here the desired username needs to be entered with privileges to access the above mentioned database, e.g define(‘DB_USER’, ‘user_techvorm’);
- DB_PASSWORD :- Select the desired password for your database, e.g define(‘DB_PASSWORD’, ‘password’);
- DB_HOST :- Enter the MYSQL host, most of the times no alteration is required, e.g define(‘DB_HOST’, ‘localhost’);
P.S :- This is a simple and straight forward technique, if you need any more assistance feel free to ask.
@ Paritosh. Will surely consider.
.-= Ashish´s last blog ..AshishM2: Luks like will have to take help of Cyber Crime Cell. Got some useful info that they can use. This would be the 4th CCC matter in 2 yrs. =-.
@ Ashish It was just an offer. Consider it whenever you get time !
Will surely consider doing this. But if you check the number of updates to my (so called) blog, you will know how frequently I manage to write 😀
.-= Ashish´s last blog ..AshishM2: WOW! Got reply to an email sent to Matrix TechSupport. Let’s see how it goes. I am truly tried of this PABX. =-.
@ Ashish Don’t worry about the link. It will be there. I respect other’s work. BTW, you can also guest post (if you want to). Here is the link : Write For Us
I have no prob. Go ahead and make a separate post. Would it be too much to ask for a link back/credit to Expertrio in the article?
No love lost. The links were to article on the same topic i.e. how to transfer your site from one server to another in different scenarios.
Might as well have an article with those links. 🙂
Cheers!
Ashish.
.-= Ashish´s last blog ..AshishM2: Here goes my day’s planning for toss. When’ll ppl realise value of time? Being late by 1 hr is unacceptable. I was itching to cancel meeting =-.
@ Ashish Mehta You explained the entire procedure in the comments section !!! Do you mind if i post this comment as a separate article ? Also your comment containing links to various posts has been deleted as we don’t allow links in our comments section.
Hi
If both – old and new – host have cPanel, transfer is quite simple. Provide backup (cPanel > Backup > Full Site) to new host and they can simply restore. No need to change anything.
If both hosts have different control panels, then all things – files and DB have to be transferred manually – as was done with this site some time back 🙂
But cPanel or no cPanel. The main problem in transferring sites with DB is DNS propagation. You never know which visitor will go to new server and which to old. … and “upto 48 to 72 hours” is quite a long time in my opinion. That way you may lose some UGC (User Generated Content). There is one method of transferring a site with DB to minimise this loss of UGC and reduce this time of 48 hours to a few hours (depending on the size of DB).
1. First transfer all static content i.e. files, images, etc.
2. Then stop updating blog and disable comments.
3. Transfer DB to new host.
4. Change DB details (name, user, password, location) in new host if required.
5. Put the same details (except location) in OLD host.
6. In OLD host put location of DB as IP of new host (in place of “localhost”). Confirm with your new host about what IP to use. It can be different than IP of your main site.
7. Re-enable comments, etc.
8. Change DNS of your domain name.
Now when a visitor goes to old host or new host the DB at new host will get updated. So downtime = time taken to transfer the DB and not 48 to 72 hours 🙂
People who land up at old host may find the site little slow because the database is hosted remotely. But that’s a small price to pay.
Cheers!
Ashish.
@Tech-Freak Its a very common problem. This post is for all those who have little or no knowledge of wordpress (as i did)
Thanks for this. It is really very helpful Once I faced this problem with the Wp-Config file as I dint change my DB password, So my blog remained inaccessible for about 2 days.
.-= Tech-Freak Stuff´s last blog ..Tech-Freak Stuff gets Google PageRank 2 =-.