With the files taken care of, it’s time to add the site to Nginx. Remember to substitute your old server’s IP address and the path to the site’s web root. Issue the following command from the new server. We’ll start by migrating the site’s files, which includes WordPress and any files in the web root. ssh you’re unable to connect, go back and verify the previous steps before continuing. Then verify that you’re able to connect to the old server from the new server using SSH. On the old server add the public key to your authorized_keys file: sudo echo "public_key" > ~/.ssh/authorized_keys You can view the public key, like so: cat ~/.ssh/id_rsa.pub Then copy the public key to your clipboard. On the newly provisioned server, create a new SSH key using the following command: ssh-keygen -t rsa -b 4096 -C "your_server_ip_or_hostname" Under the hood, SCP uses SSH therefore we need to generate a new SSH key so that we can connect to our old server from the new server. SCP will allow us to copy the files server-to-server, without first downloading them to our local machine. There are a couple of methods, including SFTP, but the safest and quickest route is to use SCP. (Interested in a super quick and easy way to provision new servers tuned for hosting WordPress? Check out how SpinupWP works.) Let’s get started! Securely Copying Filesīefore we begin migrating files, we need to figure out the best way to copy them to the new server. If you haven’t already completed the previous chapters to fire up a fresh new server, you should start at the beginning. This approach allows you to test everything is working on the new server before switching the DNS and directing traffic to it. The truth is a lot can go wrong upgrading the OS of a live server and it’s just not worth the trouble.Ī much safer approach is to spin up a fresh server, migrate existing sites, and shut down the old server. That is, we don’t recommend upgrading Ubuntu even though Ubuntu might encourage it. We do not recommend upgrading a server’s operating system (OS).
![install phpmyadmin ubuntu 20.04 nginx digitalocean install phpmyadmin ubuntu 20.04 nginx digitalocean](https://bmtechtips.com/wp-content/uploads/2018/09/subdd.jpg)
?Īnother good reason to migrate a site is to retire a server. I promise it will save you time and headaches. If you’re moving a site to a server you’ve set up with SpinupWP, the following guide will work but I recommend using our documentation on migrating a site to a SpinupWP server for more specific instructions.
![install phpmyadmin ubuntu 20.04 nginx digitalocean install phpmyadmin ubuntu 20.04 nginx digitalocean](https://digitaloceancode.com/wp-content/cache/thumbnails/2019/05/how-to-setupinstall-lamp-on-ubuntu-16.04-Digital-Ocean-Droplet-1200x1200.jpg)
Perhaps you’re moving from one web host to another. There can be lots of reasons to migrate a site. In this article, I’m going to walk you through the steps required to migrate an existing WordPress site to a new server.
![install phpmyadmin ubuntu 20.04 nginx digitalocean install phpmyadmin ubuntu 20.04 nginx digitalocean](https://kirelos.com/wp-content/uploads/2020/09/echo/ubuntu-1804-ispconfig-login.png)
In the previous chapter we enhanced security and performance with tweaks to the Nginx configuration.