WordPress website migration
-
I want to migrate my WordPress site from server1.mydomain.com to server2.mydomain.com
What is the best way to accomplish this? I'd rather not use GUI tools of any kind.
My initial thoughts are rsync to copy WordPress files and doing a mariadb export. I would also need to copy the apache config file as I made a couple changes.
So i setup server 2 with the same exact commands. I literally just copied my history minus passwords of course. However, when I request a LE cert, I get a message stating I have no virtual hosts listening on port 80.
It's really weird because i am using same OS centos7 and literally copied my commands.
-
@IRJ I've moved Wordpress to different servers quite a few times.
- I normally deactivate any wordpress plugins first.
- I export the sql to a file.
- I copy all wordpress files from the Public_html Directory to a tar or zip.
- I then create a new database and database user on new host.
- I edit the WP-Config.php file and change to reflect the new database details.
- I then import the sql to the new database using phpmyadmin.
- Upload the compressed file and extract on new host into the Public_html folder.
- activate the plugins again.
(You don't have to change the database details, you could create the same, but why the hell not change the password while your at it)
-
@IRJ are you sure you opened the firewall, etc on the new server?
Did you copy over the Apache config file for your site?
-
@JaredBusch said in WordPress website migration:
@IRJ are you sure you opened the firewall, etc on the new server?
Did you copy over the Apache config file for your site?
Firewall rules are in place. I haven't copied the config yet.
-
-
If you are changing the domain name, you will need to do sed or something on the SQL file to update links to point to the new domain. Then you should be safe to import the SQL file.
-
@IRJ That is probably why then. Virtual host settings are in the apache config
-
Get familiar with wordpress CLI so you can change the web site site address from command line
-
@Emad-R said in WordPress website migration:
Get familiar with wordpress CLI so you can change the web site site address from command line
Easy enough to do with wp-settings file as well. I did not need to change domains in this case though
-
Everything is migrated over to new server. I confirmed that domain is resolving to the new server. I was not able to grab a new cert, but the old one appears to be working fine. Maybe it's because I was requesting a cert for the same domain?
-
Well wtf copying the config didn't allow me to grab a let's encrypt cert. However it did fix my url rewrites, but that was expected.
Still same virtual host error.
-
Doesn't full mean it's using my cert? This seems odd.
-
I see now that it doesn't verify certificate unless you select strict. OK back to figuring out the LE issue
Unable to find a virtual host listening on port 80 which is currently needed for Certbot to prove to the CA that you control your domain. Please add a virtual host for port 80.
-
@IRJ Full (strict) requires a valid certificate.
-
Why use a LE cert if oyu have CloudFlare in front? Use the cloudflare cert for the machine.
-
@JaredBusch said in WordPress website migration:
Why use a LE cert if oyu have CloudFlare in front? Use the cloudflare cert for the machine.
Fine
-
@IRJ said in WordPress website migration:
@JaredBusch said in WordPress website migration:
Why use a LE cert if oyu have CloudFlare in front? Use the cloudflare cert for the machine.
Fine
I thought I had a guide around here on how to use LetsEncrypt with Cloudflare and an Nginx proxy. If not, I could write one quick enough when I get home, I have it scripted now. I'd imagine you could use the same setup for your Wordpres site.
-
@travisdh1 said in WordPress website migration:
@IRJ said in WordPress website migration:
@JaredBusch said in WordPress website migration:
Why use a LE cert if oyu have CloudFlare in front? Use the cloudflare cert for the machine.
Fine
I thought I had a guide around here on how to use LetsEncrypt with Cloudflare and an Nginx proxy. If not, I could write one quick enough when I get home, I have it scripted now. I'd imagine you could use the same setup for your Wordpres site.
But what would be the point? You can have a 100% solid reliable encryption without that headache simply by using the machine CERT from cloud flair
-
@JaredBusch said in WordPress website migration:
@travisdh1 said in WordPress website migration:
@IRJ said in WordPress website migration:
@JaredBusch said in WordPress website migration:
Why use a LE cert if oyu have CloudFlare in front? Use the cloudflare cert for the machine.
Fine
I thought I had a guide around here on how to use LetsEncrypt with Cloudflare and an Nginx proxy. If not, I could write one quick enough when I get home, I have it scripted now. I'd imagine you could use the same setup for your Wordpres site.
But what would be the point? You can have a 100% solid reliable encryption without that headache simply by using the machine CERT from cloud flair
or use the CloudFlare plugin for Wordpress..
https://wordpress.org/plugins/cloudflare/ -
@IRJ This would be a heck of a guide if you ever get the time to do it