Migrate Wordpress site from Apache to Nginx?

Joined
Apr 5, 2017
Messages
56
Best answers
0
Points
0
#1
Hello,

Can anyone detail me on the steps to migrate a WordPress site ( on httpd apache ) to NGINX ( on CentOS 6 ) without dataloss and with site data remaining untouched?

Please reply if you know the solution, will be of big help
 

VirtuBox

Global Mod
Staff Member
Joined
May 3, 2016
Messages
1,489
Best answers
4
Ratings
371 8
Points
83
#2
There is no risk of losing your data by replacing apache by nginx, but it's a pretty long configuration and it is will include a downtime and may also require time to fix eventual issues.
In my opinion, you should setup a new server with nginx and migrate your website.
 

BlueLeaf

Active member
Joined
Apr 11, 2017
Messages
76
Best answers
0
Ratings
9 2
Points
8
#3
Hi guys. I run several Wordpress websites on Nginx. I didn't need to do any specific configuration on Wordpress for my Wordpress to work on Nginx. They simply work on Nginx just as they would do on Apache, and that's it.
The Nginx configuration is not easy though, if you do it for the first time. I would strongly advise you to follow documentation on how to configure Nginx. When I configured Nginx for the first time several years ago, I had to reconfigure it several times because I always forgot to include parameters in it (e.g. for PHP, for mailserver, etc). But after configure Nginx for a few times, it became easy. I could even configure it with my eyes closed now, if I didn't have to look at the screen :DD:
And yes, you will have downtime for sure if you replace Apache with Nginx. The best thing to do if you want to have no downtime is to configure a new server, put Nginx on it, move your sites to the new server (which has Nginx) and then change the DNS record by making them to point to your new server.
 
Joined
Feb 6, 2015
Messages
55
Best answers
0
Ratings
4
Points
8
#13
miken
Hi guys. I run several Wordpress websites on Nginx. I didn't need to do any specific configuration on Wordpress for my Wordpress to work on Nginx. They simply work on Nginx just as they would do on Apache, and that's it.
Did you use a control panel that supported Nginx on your server? or is it just a LEMP stack?
 

BlueLeaf

Active member
Joined
Apr 11, 2017
Messages
76
Best answers
0
Ratings
9 2
Points
8
#14
BlueLeaf
I did not use a control panel that supported Nginx on my server? I have a VPS which came empty. I installed Nginx on it along with PHP and all necessary PHP libraries. Finally it became a LEMP stack, and Wordpress worked perfect on it.
 

David Beroff

Well-known member
Joined
Jun 14, 2016
Messages
884
Best answers
0
Ratings
64 1
Points
28
#4
Joined
Mar 17, 2017
Messages
60
Best answers
0
Ratings
2
Points
0
#5
Hello,
If you are migrating data from one server to another then downtime will be negligible and for it you need to transfer data (public_html contents , ssl certificates , database dump) but if you want to change webserver on existing sites then it may bring some downtime as the various things configured on apache will needed to be configured on nginx which may take some time.
 
Joined
Apr 5, 2017
Messages
56
Best answers
0
Points
0
#6
StackArcVPS
Can u elaborate with steps on how to do that on centos 6? I want to change my web server of the site already existing on apache to nginx ( on the same server )
 

rankmyhub

Well-known member
Joined
Feb 14, 2017
Messages
191
Best answers
0
Ratings
18
Points
0
#7
Websites can be migrated from one server to the other without any downtime or less downtime, provided that you know what you are doing. We migrate with zero downtime, as we have been doing things since a long time.

1st thing you need to do is to setup you Nginx properly, as rewrite rules work in a different way in Nginx, so if you are a beginner, you must read nginx docs and other stuff, before you do emulation.

After configuring nginx, you should copy the files to new server that includes db as well as wp files. Then use this https://github.com/tg123/chrome-hostadmin

Firefox plugin and you can emulate the website and test if everything is working or not, without doing any dns changes, this is the same procedure we do at rankmyhub. I should not share our tricks, but i thought to help you.

So emulation is best part, you know if things are working or not without making dns changes to original live site. After testing that everything is working fine, you will reduce the TTL at source server records and then do the migration by doing the final step i.e., DNS changes and done.

All the best with migration, also install another firefox addon to flush your computer or laptop dns. Helpful if you do not know how to flush dns manually.

Thanks
 

Hostpad

Well-known member
Joined
Apr 27, 2017
Messages
97
Best answers
0
Ratings
3
Points
8
#10
Here is the solution you need,
Keep old server untouched
Set up new server with nginx server with database applocation, php , phpmyadmin etc
Set up nginx configuration for wordpress like url rewriting
Take back up your all file in old server
Move them to new server
Move database to new server
Now change the ip of our main domain & www of main domain, this will give less downtime & your data will not be lost.
 
Joined
Jan 27, 2017
Messages
47
Best answers
0
Points
0
#12
It will be difficult to replace the web server only, I mean Apache to nginx. Better to get another VPS & configure nginx there & then move your files, databases & so on !
 
Latest Threads
Similar Threads
Replies
10
Views
97
Replies
12
Views
229
Replies
7
Views
85
Replies
3
Views
1,295

Latest postsNew threads

Latest Hosting OffersNew Reviews

Sponsors

Latest Blog ArticlesMost Viewed Threads