• DevOps
    Case Study

    How we built a resilient multi-account, multi-cloud solution for a Health Tech service provider!

    READ CASESTUDY
    icon

    24/7 DevOps as a Service

    Round-the-clock DevOps for uninterrupted efficiency.

    icon

    Infrastructure as a Code

    Crafting infrastructure with ingenious code.

    icon

    CI/CD Pipeline

    Automated CI/CD pipeline for seamless deployments.

    icon

    DevSecOps

    Integrated security in continuous DevOps practices.

    icon

    Hire DevOps Engineers

    Level up your team with DevOps visionaries.

    icon

    Consulting Services

    Navigate success with expert DevOps consulting.

  • TechOps
    Case Study

    How we built a scalable Odoo solution for a Travel Tech service provider!

    READ CASESTUDY

    WEB HOSTING SUPPORT

    icon

    HelpDesk Support

    Highly skilled 24/7 HelpDesk Support

    icon

    Product Support

    Boost your product support with our expertise.

    MANAGED SERVICES

    icon

    Server Management

    Don’t let server issues slow you down. Let us manage them for you.

    icon

    Server Monitoring

    Safeguard your server health with our comprehensive monitoring solutions.

    STAFF AUGMENTATION

    icon

    Hire an Admin

    Transform your business operations with our expert administrative support.

    icon

    Hire a Team

    Augment your workforce with highly skilled professionals from our diverse talent pool.

  • CloudOps
    Case Study

    How we helped a Private Deemed University in India, save US $3500/m on hosting charges!

    READ CASESTUDY
    icon

    AWS Well Architected Review

    Round-the-clock for uninterrupted efficiency

    icon

    Optimize

    Efficient CloudOps mastery for seamless cloud management

    icon

    Manage

    Automated CI/CD pipeline for seamless deployments

    icon

    Migrate

    Upgrade the journey, Migrate & Modernize seamlessly

    icon

    Modernize

    Simplify compliance complexities with our dedicated services

    icon

    FinOps as a Service

    FinOps as a Service

  • SecOps
    Case Study

    How we built a scalable Odoo solution for TravelTech service provider!

    READ CASESTUDY
    icon

    VAPT

    Vulnerability Assessment and Penetration Testing

    icon

    Source Code Review

    Ensuring source code security ans safe practices to reduce risks

    icon

    Security Consultation

    On demand services for improving server security

    icon

    System Hardening

    Reduced vulnerability and proactive protection

    icon

    Managed SoC

    Monitors and maintains system security. Quick response on incidents.

    icon

    Compliance as a Service

    Regulatory compliance, reduced risk

  • Insights
    Case Study

    How we helped a Private Deemed University in India, save US $3,500/m on hosting charges!

    READ CASESTUDY
    icon

    Blog

    Explore our latest articles and insights

    icon

    Case Studies

    Read about our client success stories

    icon

    Flipbook

    Explore our latest Flipbook

    icon

    Events

    Join us at upcoming events and conferences

    icon

    Webinars

    Watch our educational webinar series

  • Our Story
  • Contact Us

Interested to collaborate?

Get in touch with us!

Ready to elevate your business with certified cloud expertise? Contact us today to learn how our team can help you leverage cloud technology to drive growth, streamline operations, and enhance security.

  • AWSAWS
  • Azure CloudAzure Cloud
  • Google CloudGoogle Cloud
  • Akamai CloudAkamai Cloud
  • OVHOVH
  • Digital OceanDigital Ocean
  • HetznerHetzner
  • Kubernetes Consultancy Services
  • K8s & Cloud native Solutions
  • 24/7 Infrastructure Monitoring
  • DevOps as a Service
  • Cloud CI/CD Solutions
  • White Labeled MSP Support
  • Our story
  • Life@SupportSages
  • Insights
  • Careers
  • Events
  • Contact Us

Connect with us!


LinkedInFacebookXInstagramYouTube

aws partneraws advanced partner
SupportSages

Copyright © 2008 – 2026 SupportSages Pvt Ltd. All Rights Reserved.
Privacy PolicyLegal TermsData ProtectionCookie Policy

Everything you need to know about WordPress Migration

Betsy Bernard

  • 10 min read
Everything you need to know about WordPress Migration

Generating audio, please wait...

WordPress is one of the most widely used platforms for blogging in the world wide web. Sometimes you may plan to move WordPress website from one hosting to another hosting, this is what we call as ‘WordPress Migration’.

There are lots of ways to migrate a WordPress site. Lots of plugins can do it. You can do it over simple (S)FTP .I’m going to cover one way of WordPress migration i.e, by using command line tools as this would help you irrespective of the control panel you are using.But that does come with an important provision, you need to have access to a shell (via a simple local terminal or SSH) to both ends of the migration.But if you’ve got that, this way is a great deal faster.

Let’s discuss the steps involved in WordPress Migration.

1. Login Via SSH To Your Existing Web Hosting Account

SSH (Secure Shell) is a network protocol that allows you to securely access your server over an encrypted connection.Login to your existing web hosting account. The basic command to do this is:

“`

ssh [email protected] or ssh username@ipaddress

“`

If the port is other than the default, add the port number also with the command using the option ‘-p’.

eg :ssh -p 2222 username@ipaddress

2. Backup your Files

It’s best practice to always backup your website before making any changes.To create the backup you can compress your entire folder using the following command:

“`

tar -cvzf wpback.tar.gz public_html

“`

(wpback.tar.gz is the compressed file) ie [Compressing directory to single file]

3. Transfer your Files

Once you are logged into your existing web hosting account, you can start the transfer process. Before you can initiate the transfer though, you need to know where your content is located on the existing server, and where you want to put the content on the new server. In most cases, everything will be located in the public_html folder. You will be making the transfer using the SCP command, which stands for Secure Copy.

Type: pwd to figure out where you’re at on the server:

“`

pwd

/home/betsy

“`

Type: cd public_html to “change directory” to public_html:

“`

cd public_html

“`

Type: pwd again to verify your location on the server and to get the full address location:

“`

pwd

/home/betsy/public_html

“`

The address location will be needed when you enter the command to start the transfer. Verify the location you want to transfer your content to on your new server. In most cases, the location will be the same, public_html. To start the transfer use this command, but be sure to modify it to match your username, addresses, and locations for both servers:

“`

scp –P 2200 -r source_folder/location/ [email protected]: /destination_folder/

“`

The username and server IP would be of your destination server.

You can also use sftp to transfer files.

4. Backup the Database

WordPress stores data in a MySQL database. You’ll need to move this database to move the site. You’ll need to back up the database from the old site first.

You can export the database with the following command.

“`

mysqldump -u [username] -p [database_name] > [name_your_backup_file].sql

“`

(Refer the screenshot attached mysql4.png)

The username isn’t the same here as your SSH login, it’s your MySQL access username. The database name you can get from the `wp_config.php` file if you’ve forgotten. It will also ask you for a password after this command, which is the database password, which you can also get from the `wp- config.php` file.

This will create a file (which you named in the last part of that command) which is a complete backup of your database.

Now you need to transfer your database for this you can use scp command

“`

scp –P 2200 [backup_file].sql [username]@[server-ip]:[backup_file].sql

“`

The usename and server IP would be of your destination server.

5. Extract your Files

As you need to extract your files in the destination server, you need to login to your destination server via ssh first. Now, you can extract the compressed file ( here; wpback.tar.gz) to the document root of your new website, (public_html in most of the cases) using the following command

“`

tar -xzvf wpback.tar.gz public_html

“`

Also, change the ownership of the public_html as newusername.nobody and all the files and folders within the public_html folder as newusername.newusername and using the following command

“`

chown betsy.nobody pubic_html

chown -R betsy.betsy public_html

“`

As of now ensure that the default permissions of files and folder as 644 and 755 are correctly updated.

6. Import the database

To import the database first you need to login to MYSQL as root user using the following command.

“`

mysql -u root -p

“`

Now you need to create new database and user. (Refer the screenshot attached mysql3.png)

Once you created new user and database, login to the mysql as the new user and follow the steps to import the database.

(Refer the screenshot attached mysql5.png

7.Edit the wp-config file

WordPress stores your database information in the wp-config.php file. Without this information, your WordPress website will not work, and you will get the ‘error establishing database connection‘ error. So you will need to edit the

wp-config file with the new user, database, and the password.

  1. Change the database name:

“`

define(‘DB_NAME’, ‘db_name’);

“`

  1. Change the Database Username:

“`

define(‘DB_USER’, ‘db_user’);

“`

  1. Change The Database User Password

“`

define(‘DB_PASSWORD’, ‘db_pass’);

“`

8. Changing the SIte URL and Home URL

If you are moving to a new/different domain be sure to replace <old_url> with

<new_url> .If not, then you can skip this because you don’t have to update your site to point to a different domain.

The following steps will help you to find and replace all the old URLs with the new URLs.

“`

mysql -u wp_user1 -p Enter password:

“`

Use the database named “store-db”

“`

mysql> use store-db;

“`

Database changed, Show the tables

“`

mysql> show tables;

+————————————-+
| Tables_in_store-db |
+————————————-+
| wp_commentmeta |
| wp_comments |

| wp_customcontactforms_field_options |

| wp_customcontactforms_fields |

| wp_customcontactforms_forms |

| wp_customcontactforms_styles |

| wp_customcontactforms_user_data |

| wp_links |

| wp_options |

| wp_postmeta |

| wp_posts |

| wp_term_relationships |

| wp_term_taxonomy |

| wp_terms |

| wp_usermeta |

| wp_users |

+————————————-+

16 rows in set (0.00 sec)

“`

mysql> select * from wp_options where option_value = ‘http://www.domain1.com/wordpress’;

“`

“`

mysql> update wp_options set option_value = ‘http://www.domain2.com’ where option_id = 1;

Query OK, 1 row affected (0.00 sec)

Rows matched: 1 Changed: 1 Warnings: 0

 

“`

“`

mysql> select * from wp_options where option_value = ‘http://www.domain1.com/wordpress’;

Empty set (0.00 sec)

“`

mysql> select * from wp_options where option_value = ‘http://www.domain2.com.com’;

+———–+———+————-+————————+———-+

| option_id | blog_id | option_name | option_value | autoload |

+———–+———+————-+————————+———-+

| 1 | 0 | siteurl | http://www.domain2.com | yes |

+———–+———+————-+————————+———-+

1 row in set (0.00 sec)

“`

9. Changing the DNS Records

Before you can use the site on your new host you will need to check whether all the contents and databases are correctly updated on the new website. You need to forcefully load your website from your local machine, for this you need to add host entry in your local machine.

“`

To add hosts entry :

1) In a Windows machine, Add entry in this file : %SystemRoot%\system32\drivers\etc\hosts

(where %SystemRoot% is C:\Windows in a Normal case, change it accordingly)

2) In a Linux machine, Add entry in this file : /etc/hosts

3) In Mac OS, Add entry in this file : /private/etc/hosts

The entry is:

———————————-

<IP> domain.com www.domain.com

———————————-

“`

Please keep in mind to remove this entry once testing is done.

After confirming that your website is working fine on your local machine, you need to reconfigure your domain’s DNS settings. They will be set to point to your old host and you will need to point the correct records to the new server IP address. This process will depend on where you have your domain registered. DNS changes can take up to 48 hours to fully propagate. During this 48 hour, you should avoid making any changes to your website as you may be changing the old version of the site.

Though WordPress migration seems to be difficult it would be easy if you follow the above steps correctly.

Wordpress migration offer

  • WordPress
Everything you need to know about WordPress Migration

Posts by Betsy Bernard

Betsy Bernard