This tutorial explains how to upgrade a WordPress site to a new One-Click WordPress app instance. The website is 100% available during this process. You'll have plenty of time to test the new site before making it public for your users. If you have a maintenance window when the site can be offline, we have a simplified version of this guide.
Several times a year, Vultr refreshes the WordPress One-Click app with software updates and security patches. These updates apply to newly deployed instances, but not to previously-deployed servers. To ensure your servers are fully patched and secure, migrate your deployed server to a new One-Click WordPress app periodically. Migrating is also a reliable method to deploy a new server with more memory, speed, or bandwidth.
This procedure also applies to a WordPress site hosted anywhere. You can move to Vultr with confidence and 100% uptime for your users. Choose any of our server platforms to boost your website speed: Cloud Compute, High Frequency Compute, Bare Metal, or Dedicated Cloud.
Before performing any troubleshooting, it is vital to have a reliable backup as a starting point. Please do not skip this step. If you are upgrading a Vultr VPS to a new One-Click WordPress, Vultr snapshots allow you to restore an exact point in time backup in case something goes wrong. See our Snapshot Quickstart guide for more details. If you are migrating your server to Vultr from another location, make sure you have a backup of the source server before proceeding. Make a complete server image backup if possible, or use a backup plugin for WordPress such as Updraft or Jetpack.
All-in-One WP Migration is a popular plugin for relocating WordPress sites. The free version is enough for most websites, and several professional upgrades are available with advanced features.
Enter All-in-One WP Migration in the Search plugins... field at the upper-right of the page. Locate this plugin in the list.
Click Install Now.
Click Export To > File to export the entire site, including themes and plugins.
A download prompt appears after the backup completes. Click the green download button.
Save the export file to your computer.
Deploy a One-Click WordPress server at Vultr. Make a note of the IP address of the new target server.
Use the OS-specific instructions below to edit your local computer's hosts file. Map the website domain name to the new target server's IP address by adding this line to the bottom. Replace the values with your target server IP address and server domain name. This entry overrides DNS for your computer only during the upgrade process. To ensure 100% uptime for your users, leave the public DNS pointing to the old IP address for now.
Right-click on Notepad, select Run as Administrator.
Click Yes on the Windows UAC prompt.
Open Terminal, and edit the hosts file.
$ sudo nano /private/etc/hosts
Open Terminal, and edit the hosts file.
$ sudo nano /etc/hosts
After changing the hosts file, your computer's IP stack or web browser may cache the source IP address. You may need to close your browser, reset your network, or simply reboot before the URL points to the correct IP address. Verify the IP address is correct when accessing the server's domain name.
If you are using Let's Encrypt, follow these steps to install a certificate on the target server manually. Manual mode is required because the public DNS isn't updated yet. After the migration is complete, you'll configure certbot for automatic renewals.
If you use a commercial SSL certificate, follow the instructions from your vendor.
Run certbot with the certonly and --manual options. Replace www.example.com with your server's fully qualified domain name.
# certbot certonly --manual \ -d www.example.com \ -m firstname.lastname@example.org \ --preferred-challenges dns --agree-tos \ --no-eff-email --manual-public-ip-logging-ok
The certbot wizard will print instructions to add a TXT record to your domain's DNS. The certbot wizard will pause at this point. Do not press ENTER until you've completed the DNS steps below. For example:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Please deploy a DNS TXT record under the name _acme-challenge.www.example.com with the following value: U5Y4xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxN914 Before continuing, verify the record is deployed. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Press Enter to Continue
Use a web browser to navigate to your DNS provider.
Test the TXT record propagation. Popular ways to test the TXT record include
dig and the dnschecker.org website. Replace example.com with your name in these examples:
To test with
dig, open another terminal window and lookup the domain record, replacing example.com with your domain. Verify that the value returned is correct.
# dig +short TXT _acme-challenge.www.example.com "U5Y4xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxN914"
To use dnschecker.org, navigate to the URL, replacing example.com with your domain. Verify that the value returned is correct.
In the propagation test, when you see the correct TXT record, return to the certbot wizard and press ENTER to continue. If the certificate challenge succeeds, certbot will report the location of the new certificate files.
... Cleaning up challenges IMPORTANT NOTES: - Congratulations! Your certificate and chain have been saved at: /etc/letsencrypt/live/example.com/fullchain.pem Your key file has been saved at: /etc/letsencrypt/live/example.com/privkey.pem
Archive the existing Nginx certificate.
# mv /etc/nginx/ssl/server.crt /etc/nginx/ssl/server.crt.old # mv /etc/nginx/ssl/server.key /etc/nginx/ssl/server.key.old
Link the Let's Encrypt certificate where Nginx expects to find it.
# ln -s /etc/letsencrypt/live/example.com/fullchain.pem /etc/nginx/ssl/server.crt # ln -s /etc/letsencrypt/live/example.com/privkey.pem /etc/nginx/ssl/server.key
# service nginx restart
Navigate to your website by domain name with HTTPS (https://www.example.com). Verify the certificate is correct. Because you have updated your hosts file and manually installed the SSL certificate, the new target website should load properly.
Enter the username and password from step 1 Sign in pop-up.
Note: This login protects the admin area with extra security before entering your WordPress Administrator account information. If you want to remove this additional security layer, follow the instructions in the **"Remove wp-admin Security" section of the One-Click WordPress documentation.
Run the WordPress installation wizard. Select your language and click Continue.
Enter your site title, username, and email address. This information isn't critical, and it will be overwritten when the plugin imports the old server's data. Make a note of the password, because you'll need it to log in the first time.
Click Install WordPress. Wait for WordPress to finish the installation, then log in to your WordPress dashboard.
Click Import From > File.
Select your export file.
After the file upload completes, click Proceed on the import confirmation.
Click Save permalinks structure on the success confirmation.
A new browser tab will open. The database import is complete, so you must log in with the username and password of the source WordPress server.
Browse the target server and verify the content is correct when viewed from your computer, which still has the hosts file entry. You can take as much time as needed. Until you update DNS in the next step, users won't see this new server. Other testers that need to view the site should update their hosts file by following the same instructions in Step 4 above.
Replace the source IP address with the target IP address for your server's domain name in DNS. It may take up to 48 hours for DNS changes to propagate across the net.
Anyone testing the site should now remove the line added to the hosts file in Step 4. You may need to reset your IP stack or reboot before your computer retrieves the correct IP address from DNS.
Traffic on the old server should dwindle as DNS updates. Correspondingly, activity on the new server should pick up. You should monitor both servers for a few days before you decommission the old server.
If you are using Let's Encrypt certificates, run certbot again without the --manual and certonly options. Follow the directions in our One-Click WordPress documentation to automatically update SSL. Certbot will make the required changes to systemd, crontab, and nginx for you.
Whether you are migrating from another host or just upgrading WordPress, migrating to a new One-Click app is the best procedure. You'll have a secure WordPress installation that we've tested with the latest PHP, MariaDB, Nginx, and Ubuntu updates.