This article aims at aiding the end-user in migrating a Wordpress website/application to Linode using the Bunnyshell platform. Learn more about Bunnyshell.
-
Connect your Linode account to Bunnyshell
-
Connect Linode in the integrations page
-
-
Create an infrastructure: to serve your application
-
Virtual Machine/Web Server Cluster with the packages you intend to utilize.
-
Mysql, Nginx, Apache, Litespeed, Varnish ... etc
-
-
-
Create a WordPress application: Install a WordPress Application on the newly created infrastructure
-
Make sure the application created utilizes the same WordPress and PHP versions of your existing application.
-
-
Precautionary step: On your existing WordPress installation disable any caching to avoid any conflicts at a later stage
-
Migrate your files: There are 2 ways to achieve this
-
Using a Migration plugin, depending on your application you can utilize any migration plugins available for WordPress, for more on the available tools check out this link.
-
Install the plugin of your choice on the existing application
-
Take a backup of the website. (This process is dependent on the plugin of your choice)
-
Install the same plugin on the newly created WordPress application in Bunnyshell.
-
Restore the backup you created to the new WordPress application.
-
-
Using SFTP (shell based, putty, Filezilla ... etc) and any database client you prefer (php-my-admin, datagrip, dbeaver, ... etc)
-
Using whichever tool provided by your current provider to backup the files and database of your application.
-
On the newly created application you are given SFTP Credentials and Database Credentials using these and your preferred tools restore the files and database on the new application.
-
-
-
Setup your Domain: After migrating your files and database, go to the application on Bunnyshell and navigate to the domain tab and create your domain and alias.
-
Set your newly created domain as the default domain
-
-
Update your DNS settings: In order to point your application to the new infrastructure on Linode you will have to update your DNS to point at the newly created records
-
To achieve this click on the connect button at the far right side of your newly created main domain on Bunnyshell and follow the instructions.
-
After updating the DNS go ahead and click on connect again on the pop-up window provided.
-
-
Generate a certificate from the certificates tab on Bunnyshell (next to domain)
-
Make sure you include your main domain and alias.
-
-
Congratulations your website is online.
Why use Bunnyshell?
We provide access to a set of tools that facilitate orchestrating and automating operational tasks, allowing the user to concentrate on more business/development-oriented tasks.
Migrating your website
Connect Linode to Bunnyshell
The first thing you would need to do after registering on Bunnyshell is connect your Linode Account. To do that you must first Create an API Token. On your Linode account dashboard, go to your profile and select API Tokens.
From this point forward all your work resides on Bunnyshell. Depending on your requirements, you can either go with creating a Virtual Machine (VM) or a Web Server (Cluster). Clustering your application is beneficial in many forms (DB Isolation, Resource Allocation, Load balancing … etc).
But for the purposes of this document, we will be creating a Virtual Machine.
Create Infrastructure
To create a Virtual Machine, navigate to virtual machines in the sidebar and click on create virtual machine button found in the right corner.
The next page you get is where you choose the packages you want to use in our case these will be:
Web Server Type: Nginx:latest
Programming Languages: PHP Version 8.0 (we will be installing a WordPress application)
Database: Mysql Version 8.0
Cloud: Linode
Operating System: Ubuntu 20.04 LTS
Location / Subnet / Plan: Amsterdam / Default / Development-1-2 (These options will differ according to what region and plan you require, but for the purpose of this tutorial we will use a development plan).
Virtual Machine Name: Linode-VM-Tutorial (choose a name that would be clear and appropriate to your case scenario).
Finally, click on CREATE VIRTUAL MACHINE, and that's it, a VM will be spun up ready for application installation. Next up we will go through creating an application.
Create an application
To create an application on the virtual machine we just created, navigate to that virtual machine and click on the application tab. Next, on the applications page, click on create application button found in the top right of the screen.
Select WordPress, fill in the application name (slug is autogenerated) Mysql select current virtual machine, and last but not least click on Create application!
In a few moments, we will have access to a WordPress application, next, we will leave you with some pointers on how to migrate your files and database.
Migrate your files/database
Make sure you disable any caching plugins you have on your existing WordPress website before migrating your files and database.
The traditional way of migrating your files and database is to utilize SFTP and MySQL-client on the server directly, but luckily there are easier ways to do this on WordPress; you can make use of any of the available WP migration plugins. Different plugins will have slightly different - but mostly similar - methods to complete the migration of files and database; we will leave you with 2 links that will introduce you to a few existing plugins but feel free to research which suits your needs best.
Migration Plugins Link 1| Migration Plugins Link 2
We will explain the old school way in this tutorial:
-
Using whichever FTP client you prefer (Examples Putty/Filezilla/SCP … etc) copy the files across onto the server using the application credentials found under the Overview tab in the application we just created. Note: make sure you backup the .htaccess and wp-config.php before copying the files across, and make sure the files are copied into the app folder.
-
Next, we will need to backup the database from the source and restore the exported database to our new Mysql.
-
You can use MySQL-client to directly restore the database if you are proficient with using a terminal/command-line. If you choose to go down the terminal and you have MySQL-client installed, here are a few hints:
-
Make sure that port 3306 is open to your IP address (you can do this from the security tab on Bunnyshell).
-
Navigate to the folder where you exported your database on your local machine.
-
Open up a shell/terminal/command-line.
-
Issue the following command:
mysql -h [host-ip] -p [port] -u [db-username] -p[password] [databasename] < /path/to/mysql-dump-file.sql
You can get all the credentials from the Bunnyshell interface under database credentials in the app overview tab. You will need the host and port directives if you are attempting this step remotely, otherwise, if you ssh into the server then you can do this without the host and port directives.
-
-
Another method is to use phpmyadmin/adminer. You can install either in Bunnyshell by creating a new application and navigating to the tools section of the application creation where you will find phpmyadmin and adminer. From this point on simply restore the database backup you have after you sign in using the database credentials provided in the WordPress application we created earlier.
-
Next up we need to set up the DNS and SSL Certification for our app.
Setup your DNS and SSL Certification
Your website might not work at this stage if you did not alter the URLs in the database. For you to be able to test your website before altering the DNS, we suggest you install Better-Search-Replace plugin on your new WordPress and search for your old domain name and update it to the auto-generated URL provided by Bunnyshell.
Our next step is to add our domain and point it to our new server.
-
Navigate to the application on Bunnyshell.
-
Go to the domains tab and add your domain.
-
Click on Add new
-
Select Domain
-
Insert domain and click add
-
-
Click on Add new
-
Select Domain Alias
-
Select Domain from the list and add www as the alias
-
-
On your main domain click on the options menu at the far right (3 vertical dots) of the row and select make default
-
Our next step is to change the DNS records:
-
On the main domain row, you will find a button labeled connect, click on it.
-
You are prompted by 2 ways to point your DNS records to the new website, login to your DNS provider, and update the DNS records according to the options provided in the connect pop-up window. Your options are:
-
A-record (we recommend using A-Records for the main domain)
-
CNAME
-
-
Click connect in the open
-
Apply similar steps for the alias.
-
In case you did update the URLs in the database at this point you will need to change them back to your main domain using the same plugin.
It is time to get our SSL Certificate sorted. Navigate to the Certificates tab in the application we created earlier, next click on add certificate button in the top right corner of the page, and select Let’s Encrypt Certificate. Select your domain and alias and click on generate the certificate.
If all is fine and you have not altered your .htaccess/apache/nginx/OLS vhost configuration in a way that would block access to the .well-known folder.
At this point, your Domains are pointing to the new application and you have a self-signed Let’s Encrypt SSL certificate attached to the vhost as well. We now need to do some final touches.
If you find anything not functioning as expected please attempt restarting services. To do so, navigate to the Services tab on the Virtual Machines page and restart the services you find there by clicking on the 3 vertical dots and selecting restart service.
Re-enable caching
Re-enable your cache plugin if you have one.
If you have migrated from Nginx/Apache to an OLS-based Web Server please make sure you remove your cache plugins and install LiteSpeed cache plugin for better compatibility.
Test your migration
Do your final checks, make sure you navigate down to the leaf node of your website (IE: if you have a blog make sure you navigate your way to the blog post step by step not by searching for it), test your search, test your caching, test your mailer if you have one.
Bunnyshell advises against using sendmail or postfix for mail functionalities and strongly advocates utilizing SMTP Mail Relay.
Congratulations you are online
& Voila, you are good to go.
We hope this article can assist you in one way or another, if you ever face difficulties send through your inquiries to the Bunnyshell support team, we are more than happy to advise on inquiries.