Close Menu
Technoracle
    Facebook X (Twitter) Instagram
    Facebook X (Twitter) Instagram
    TechnoracleTechnoracle
    • Home
    • AWS
      • EC2
      • Lightsail
      • RDS
      • S3
    • Ubuntu
      • Ubuntu 20.04
      • Ubuntu 22.04
    • AI Tools
    • Web Hosting
    • WordPress
    • Tech News
    Technoracle
    Home - AWS - Migrate WordPress Site to AWS in 2023 [Step by Step Guide]
    AWS

    Migrate WordPress Site to AWS in 2023 [Step by Step Guide]

    Rajesh ShivamBy Rajesh ShivamJune 7, 2022Updated:June 10, 2023No Comments4 Mins Read
    Migrate WordPress Site to AWS

    Your website is hosted on shared hosting or any VPS and wants to upgrade your server to AWS for better speed, security, scalability, and performance. In this article, I will explain how to migrate a WordPress site to AWS step by step. So let’s dive in

    Page Contents

    Toggle
    • WordPress Site Migration to AWS
        • Step 1: Setup AWS EC2 instance creation with LAMP Stack
        • Step 2: Choose Instance Type
        • Step 3: Configure Instance Details
        • Step 4: Upload wordpress files and database backup to EC2 instance
        • Step 5: Database creation and import the old database.
          • SSH to the instance
          • Database Creation
          • Import the backup database
        • Step 6: Copy WordPress files to document root
          • Backup WordPress copy to document root
        • Step 7: Domain mapping (Locally)
        • Step 8: Domain mapping on Route53 to make the site live

    WordPress Site Migration to AWS

    First of all, you should take backup of website files, emails and database.

    Now, let’s start step by step to migrate wordpress website to AWS.

    Step 1: Setup AWS EC2 instance creation with LAMP Stack

    Login to AWS Console dashboard, launch an Ubuntu Instance . You can launch instance which is pre-configured with LAMP provided by bitnami.

    Migrate WordPress Site to AWS
    EC2 dashboard

    On EC2 Dashboard, click on the launch instances to start a new ec2 instance.

    Migrate WordPress Site to AWS

    Now, Select the AMI from AWS Marketplace, as we are launching the instance that already pre-configured with LAMP.

    Overview of bitnami LAMP AMI page, then select the AMI

    Migrate WordPress Site to AWS

    Step 2: Choose Instance Type

    You should choose the instance depends upon your requirement. If you are getting more than 500 user per day on your website. Don’t use free tier, otherwise you can use free instance.

    Step 3: Configure Instance Details

    On instance configuration page, keep all the default settings to launch the instance with key pair selection.

    Step 4: Upload wordpress files and database backup to EC2 instance

    Now you can upload all the WordPress files and database backup to the new instance by doing SCP using a key.

    This instance is already pre-configured with the LAMP stack, so we don’t have to install the LAMP stack. Now, we need a MySQL password to create the database and import the database dump.

    To find the bitnami MySQL password,click on actions. Now, under the action, click on Monitor and troubleshoot and then click get system log.

    Migrate WordPress Site to AWS

    Check system log to find the bitnami MySQL password. The default bitnami password is same as MySQL password, however you can change it anytime.

    Migrate WordPress Site to AWS

    Now, upload both WordPress and Database to the AWS Instance using following SCP(Secure Copy) command.

    scp -i [keypair location] [file location of the upload file] bitnami@[IP Address]:[Path where you want to upload the file]

    Example command

    $ scp -i Downloads/serverkey.pem Downloads/website.zip [email protected]:~
    • SCP – Secure Copy
    • keypair location – The location of the key file, you created during instance creation.
    • IP Address – IP Address of the server.

    Step 5: Database creation and import the old database.

    Again SSH to the instance to create a database and import the database dump for the website by following commands.

    SSH to the instance
    $ ssh -i Downloads/techno.pem [email protected]
    Database Creation
    $ mysql - u root -pPassword
    $ mysql> CREATE DATABASE wordpressDb;
    $ mysql> exit
    Import the backup database

    After logout from MySql Server, you have run MySQL database import command.

    $ mysql -u root -p wordpressDb < databaseBackup.sql

    It will ask for password, you have to put MySQL password there.

    To make sure your database imported successfully login to MySQL server and run the following command.

    mysql> SHOW DATABASES;
    mysql> USE wordpressDb;
    mysql> SHOW tables;

    Step 6: Copy WordPress files to document root

    The uploaded wordpress files need to extract to the document root of the server.

    Backup WordPress copy to document root
    $ sudo mv wordpressBackup.zip htdocs
    $ cd htdocs
    $ sudo unzip wordpressBackup.zip

    Now, you have to change the database information on wp-config.php file with new database credentials.

    // ** MySQL settings - You can get this info from your web host ** //
    /** The name of the database for WordPress */
    define( 'DB_NAME', 'database_name_here' );
    
    /** MySQL database username */
    define( 'DB_USER', 'username_here' );
    
    /** MySQL database password */
    define( 'DB_PASSWORD', 'password_here' );
    
    /** MySQL hostname */
    define( 'DB_HOST', 'localhost' );

    Step 7: Domain mapping (Locally)

    To make sure the migrated website is working perfectly, you should check the website by mapping the domain locally on the system hosts file.

    If you are using Ubuntu use the following command on your system.

    $ sudo vi /etc/hosts

    Add the following lines to your hosts file

    [IP Address] yourdomainname.com

    [IP Address] www.yourdomainname.com

    Replace the IP Address with server IP Address and yourdomainname.com with your domain name.

    If the website is loading perfectly, now you map the domain on Route53.

    Step 8: Domain mapping on Route53 to make the site live

    Open Route53 to create hosted zone, add your domain name to complete migrate WordPress site to AWS.

    After hostedzone creation, add A records.

    Migrate WordPress Site to AWS

    Check your domain on intodns to make sure NS updated.

    Step 9: Update your domain SSL

    Now update your domain SSL certificates. If you were using Let’s encrypt you can install it again, read how.

    ubuntu tips
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email Reddit
    Previous ArticleUpdated VI Keyboard Shortcuts – Make Your Command Line Super Friendly [PDF Cheatsheet]
    Next Article How to Increase Execution Time in PHP
    Rajesh Shivam
    • LinkedIn

    Rajesh Shivam is a seasoned professional with expertise in AWS and Linux System Administration. With over 10 years of freelancing experience, he brings a wealth of knowledge to the table. Rajesh has a strong passion for technology and stays connected with the latest happenings in the field. His dedication and expertise make him a trusted resource for all things tech-related.

    Related Posts

    linux commands every user should know in 2025
    Ubuntu 24.04

    25 Must-Know Linux Commands Every User Should Master in 2025

    Read More
    Blog banner showing Ubuntu logo, coding laptop, and icons for VS Code, Docker, and Git with the title 'Perfect Dev Setup in Ubuntu 24.04 – Step-by-step guide for developers' on a dark tech-themed background.
    Ubuntu

    How to Set Up the Perfect Development Environment on Ubuntu 24.04

    Read More
    Convert PEM to PPK file
    AWS

    Convert PEM to PPK File on Windows & Linux [2025 Guide]

    Read More
    Add A Comment
    Leave A Reply Cancel Reply

    linux commands every user should know in 2025

    25 Must-Know Linux Commands Every User Should Master in 2025

    April 10, 2025
    TeamViewer and Ubuntu logos on gradient background – banner for how to install TeamViewer on Ubuntu 24.04 tutorial

    How to Install TeamViewer on Ubuntu 24.04 [Fast & Easy Steps]

    April 10, 2025
    Troubleshooting ‘Permission Denied (publickey)’ SSH error on a Linux server using secure terminal access

    Fix ‘Permission Denied (publickey)’ SSH Error on Linux [Step-by-Step Guide]

    April 8, 2025
    Blog banner showing Ubuntu logo, coding laptop, and icons for VS Code, Docker, and Git with the title 'Perfect Dev Setup in Ubuntu 24.04 – Step-by-step guide for developers' on a dark tech-themed background.

    How to Set Up the Perfect Development Environment on Ubuntu 24.04

    April 8, 2025

    Subscribe to Blog

    Enter your email address to subscribe to
    this blog and receive notifications of new posts by email.

    Facebook X (Twitter) Instagram Pinterest
    • Sitemap
    • Privacy Policy
    • Disclaimer
    • Term of Services
    © 2025 Technoracle

    Type above and press Enter to search. Press Esc to cancel.

    Click to Copy