How do I transfer my wordpress.org website from an old server to a new one, while maintaining the old IP address?
Hello everyone,
I'll explain in which situation I find myself because I haven't had a lot of experience with this stuff and I'm getting stuck quite often😂
So, I need to update PHP on my Linode that is storing files for my website: in fact, I own a Linode that has Debian 8 has an OS and this, since it's quite an old version, and I apparently need to update to have a more recent version of PHP. I would have updated the OS anyway because it has never been in ages.
To do so, I thought that I could transfer all of my data on a new Linode with a Debian 10 configuration (getting it with WordPress already installed). After that, I used a plugin called WPvivid Backup to transfer all my data to the new server.
After that, I swapped the IP between the two servers and waited a bit, but my computer was still redirecting to an HTTPS address, even though I've never owned an SSL certificate on the old server. Am I doing everything right or are there some settings that I forgot to tick out while creating the new server? Or is there something wrong with the way I'm doing it?
If anyone could help me in way that I could understand, that would be amazing🙂
Thank you so much
3 Replies
I would setup a new server, setup Wordpress there so you have the latest working version, transfer your Wordpress files to the new server, check that everything is working good via the IP address, and point dns to the new IP address. It will take about 24 hours to fully propagate over.
The other option is, you might be able to upgrade Debian. But double check about upgrading from a couple versions behind.
Whichever method you choose, make sure you have a RELIABLE backup.
If you are keeping the domain name the same for your WordPress site, this is how we do it.
First step is to zip the entire WP directory on the old server. Yeah it can be a big file but not big deal.
We then do a mySQL dump of the database which will give us a large .sql file.
We create the new server and set up the LAMP stack (via SFTP and SSH) using the Linode guides and create the Apache virtual-host for the domain and we make sure it works.
We create a new database on the new server.
Then we get back on the old server and transfer the big zip file and the .sql file to the new server (We use SCP) into the public_html directory.
We then unzip the zip file (We always build out WordPress sites in sub-directories (some people like to use sub-domains instead.))
If necessary (and it usually is) we will 'chown' the files to 'user and www-data' and then set restrictive permissions on several files (like wp-config.php)
We then import the .sql file into the new database via the mysql command line… but you can use the myPhpAdmin utility as well.
We next go into the WordPress wp-config.php file using SFTP (we use the Transmit utility as we are an Apple shop) and a text editor (BBEdit) and make the changes for the new database name, server name, password, etc.
Finally we change necessary DNS records at the registry (or change the nameserver to let Linode DNS Manager handle that function.) We wait a few hours for propagation and the new WordPress should work.
I'm sure there are easier and faster ways to do all of this stuff but we do web sites for a living (newmediacreate dot com) and over the past fifteen years we've learned that the slow, step-by-step method of moving WordPress sites without relying heavily on plugins and/or utilities results in far fewer headaches.
If you are changing domain names there is another important step to do… you need some SQL query code OR a utility to scan the new database and replace all instances of the old domain with the new one. This is one time we use a utility which works well… we've been using it for many years: https://interconnectit.com/search-and-replace-for-wordpress-databases/
I hope this helps you a little bit. As I said earlier there are lots of methodologies to do what you want to do…and my guess is that most of them are faster… but we are 'old school' and we like to do our own installations and configurations step by step with our own 'playbook.'
Having been in software programming and systems development and dev-ops for 45 years (yeah, I'm old… 74… but I can still out-tech most (but not all) 25 year olds) I try to avoid the old software paradigm of:
There is never enough time to do it right, but there is always enough time to do it over!
I hope this helps. I would have made this post shorter… but I didn't have the time. :-)