Skip to content
Follow
CMS Ubuntu Linux

Seamless WordPress Migration to Google Cloud

Richard
Written by
Richard
Dec 29, 2021 Updated Jul 14, 2026 9 min read
How to Display Seconds on Ubuntu Top Menu Clock
How to Display Seconds on Ubuntu Top Menu Clock
  • Web browsers
    • The latest version of Google Chrome
    • Firefox
    • Microsoft Edge
    • Microsoft Internet Explorer 11 and later
    • Safari 8 and later. Note that Safari is not supported in private browser mode.
  • Virtual machine configurations
    • All Linux VM images are natively available in Google Cloud.
  • You won’t need extra software or browser extensions. Log into the Google Cloud Console, then go to Menu > Compute Engine > VM instances.

    Click the SSH button next to the instance you want to connect to. You can also click its name and then click SSH on the instance details page.

    establish ssh connection to vm instances
    establish ssh connection to vm instances

    This opens an SSH terminal window for your Ubuntu Linux instance, where you can now run commands.

    connect to google cloud instance host
    connect to google cloud instance host

    Install LAMP or LEMP on the new server before migration

    Before migrating your WordPress site to Google Cloud, you must install a LAMP or LEMP stack on your new server to make sure it has the right software.

    Install a LAMP (Linux, Apache, MySQL, PHP) or LEMP (Linux, Nginx, MySQL, PHP) stack on the new server before migration. Your goal is to ensure the new Google server has all the same servers and packages as your current one. We’ve listed some helpful posts you can use to install Apache, Nginx, MySQL, MariaDB, or PHP.

    Here are some other posts you may want to use when installing LAMP or LEMP on Ubuntu Linux.

    You can use the posts above to install the same servers and packages you have on your current server. Just make sure to install specific packages on your new server using the identical posts mentioned.

    Once all the packages are installed, you can transfer content from your current server to the new one.

    Configure your new Google server similar to your current server

    To make your WordPress migration to Google Cloud go smoothly, you need to set up your new server to be just like your old one.

    Web server settings must match between your old WordPress site and the new Google Cloud server for a successful migration. These settings include the directory structure and content of Virtual Host or Server blocks. Apache and Nginx are common web servers, and guides for setting up these configurations appear in the links below, offering clear instructions.

    • Apache directory: /etc/apache2/
    • Nginx directory: /etc/nginx/

    Your PHP configuration should also be identical to your current server’s PHP settings. Use the post above to install a specific PHP version and all the modules you have on your current server.

    • PHP directory: /etc/php/

    Your MySQL or MariaDB configurations should also mimic your current server. Validate each file, directory, and other data to ensure your new server is no different from your current server before migration.

    • MySQL / MariaDB directory: /etc/mysql/

    Once you’ve completed these checks, you can continue with the migration process.

    Back up current server data and database before migration

    Before moving your WordPress site to Google Cloud, it’s important to back up all your current website files and database.

    Backing up WordPress website content and database content is an essential first step. This backup process protects both the website files and all the data stored within the database, ensuring no information is lost during the migration.

    At this point, stop all changes on your current server before backing it up. You won’t want new changes added after the backup is complete.

    To back up WordPress content, log into your server via SSH. Once in your current server’s SSH console, run the commands below to back up your WordPress content, usually located at /var/www/html/.

    When you run the commands below, a backup file named current-server-backup.tar will be created containing your WordPress content.

    🐧Bash / Shell
    sudo tar -cvf current-server-backup.tar /var/www/html/
    ⚠️Warning
    Next, back up your database content. Again, you need to use the root account or an account with full access to the database you wish to back up.
    ⚠️Warning
    To back up all databases on the server, run the commands below:
    🐧Bash / Shell
    sudo mysqldump -u username –p --all-database > all_databases_backup.sql

    A file named all_databases_backup.sql should also be created in the current working directory.

    You should now have two files: current-server-backup.tar and all_database_backup.sql.

    Copy the current server’s content to the Google Cloud server

    At this point, you should be ready to copy the current server’s content over to your new server. There are several ways to transfer the tar and SQL data files.

    You can use the rsync command from the new server. SSH into it and use a command similar to the one shown below (remember to change the host names as needed).

    While connected to your Google Cloud console, run the commands below to connect to your current server and copy over the backed-up content.

    💻Code
    rsync -avz user@old-server.com:/home/<username>/all_database_backup.sql
    rsync -avz user@old-server.com:/home/<username>/current-server-backup.tar

    You could also use SCP to copy your files securely. The syntax looks like this:

    💻Code
    scp user@old-server.com:/home/<username>/all_database_backup.sql /home/username/
    scp user@old-server.com:/home/<username>/current-server-backup.tar /home/username/

    If you can’t get the files using SSH, you can use the wget command to download the files to your new Google Cloud server.

    You must copy the files to the current server’s web server root directory to use the commands below.

    Command Prompt
    cd ~
    wget http://old-web-site.com/all_database_backup.sql
    wget http://old-web-site.com/current-server-backup.tar

    Once the files are copied to your new server, continue to extract them below and import the database content into your database server.

    Restore the current server’s content to the Google Cloud server

    After backing up your WordPress site, the next step is to restore those files and your database to your new Google Cloud server.

    🐧Bash / Shell
    tar -xvf current-server-content.tar
    sudo cp -rf /var/www/html/ /var/www/html/

    Next, run the commands below to import the database content to your servers.

    🐧Bash / Shell
    sudo mysql -u root -p < all_database_backup.sql

    At this point, your Google server should have the current server and database content. Next, run the commands below to set up the correct permissions.

    Validate that all configurations on your current server match your new Google Cloud server. Once everything is validated, restart your web server.

    🐧Bash / Shell
    sudo systemctl restart nginx
    sudo systemctl restart apache2

    If you encounter an error, make sure to resolve it.

    Update your DNS and point your domain to your new Google server IP address

    The last step in your WordPress migration to Google Cloud is updating your domain’s DNS settings to point to your new server’s IP address.

    Once your local test is successful, log in to your DNS provider portal and update the DNS A record to point to your new server IP address.

    If everything works, you can continue fine-tuning your new server to ensure all configurations are correct.

    That should do it!

    Conclusion:

    Migrating a WordPress website to Google Cloud requires following specific steps. Achieving a smooth transition means remembering key actions.

    • Take Inventory: Document your existing server’s environment before starting the migration.
    • Set Up Your Google Cloud Server: Ensure your new configuration matches your current setup.
    • Install Required Software: Ensure all necessary software (LAMP/LEMP) is installed on the new server.
    • Back-Up Data: Always back up your website files and database before making any changes.
    • Transfer Content: Use secure methods such as rsync or SCP to transfer your files to the new server.
    • Restore Data: Extract and import your database and website content to your Google Cloud server.
    • Test Before Going Live: Conduct local tests to ensure everything functions as expected.
    • Update DNS Records: Point your domain to the new server’s IP address once everything is verified to be working.

    Following these steps will help you migrate your WordPress site with minimal downtime, ensuring a smooth experience for your visitors.

    Can I run WordPress on Google Cloud?

    Google Cloud's hosting services give your WordPress site improved performance, virtually limitless scalability, stronger security, greater control, and more flexibility. Once your free trial ends, you can continue to host your website starting at USD 13.17/month with WordPress on Google Cloud.

    Migrating your WordPress website to Google Cloud Platform (GCP) means moving your site and its information to a new online home without stopping your site for visitors.

    Google Cloud Platform is a set of tools for running websites and apps online, offering great speed and the ability to grow your site’s capacity easily.

    You can move your WordPress site to Google Cloud without any downtime by setting up your Google Cloud services first. This includes preparing your virtual computer, database, and network. Tools like Compute Engine and Cloud SQL help with this.

    Updating your site’s DNS records is a key step to make sure your WordPress site runs correctly on Google Cloud. This guide walks you through the process to make moving your site simpler.

    ⚡ Quick Answer

    Prepare your existing server by documenting its configuration, then set up a new virtual machine instance on Google Cloud. Install a LAMP or LEMP stack on the new server to match your current setup before transferring your WordPress files.

    Taking inventory of a Linux server before migration

    Before moving your WordPress site to Google Cloud, you need to know what’s on your current Linux server.

    Here’s what you need to gather from your current server:

    • Web server and version number
    • Database server and version number
    • PHP and related modules
    • Other servers and services and how they’re configured

    To find the Apache web server version on Ubuntu Linux, run specific commands. These commands output the exact Apache version number, such as Apache/2.4.41, which is crucial for compatibility checks and security updates.

    💻Code
    apache2 -v

    For more detailed version checks and steps to install a specific Apache version, read the post below:

    How to check and install specific Apache versions on Ubuntu Linux

    Nginx web server version checking on Ubuntu Linux requires specific commands. To find the Nginx version, users on Ubuntu Linux can run the command `nginx -v`. This command directly displays the installed Nginx software version, for example, `nginx version: nginx/1.18.0`.

    💻Code
    nginx -v

    For more detailed version checks and steps to install a specific Nginx version, read the post below:

    How to check and install specific Nginx versions on Ubuntu Linux

    To check your PHP version and learn how to install a specific one on Ubuntu Linux, read the post below:

    How to check and install specific PHP versions on Ubuntu Linux

    Whether you’re running MySQL or MariaDB, the post below shows you how to determine which version runs on Ubuntu Linux.

    How to find what version of MySQL or MariaDB runs on Ubuntu Linux

    How to set up and connect to your Google Cloud server

    Setting up your Google Cloud server for WordPress means creating a virtual machine, called a Compute Engine instance, and then connecting to it.

    Google Cloud servers, specifically Compute Engine, let you connect to your virtual machine (VM) instance directly from your browser via SSH within the Google Cloud Console.

    SSH from the browser supports the following web browsers: Google Chrome (latest version), Firefox, Microsoft Edge, Internet Explorer 11 and later, and Safari 8 and later. Note that Safari does not support private browser mode.

    • Web browsers
      • The latest version of Google Chrome
      • Firefox
      • Microsoft Edge
      • Microsoft Internet Explorer 11 and later
      • Safari 8 and later. Note that Safari is not supported in private browser mode.
    • Virtual machine configurations
      • All Linux VM images are natively available in Google Cloud.

    You won’t need extra software or browser extensions. Log into the Google Cloud Console, then go to Menu > Compute Engine > VM instances.

    Click the SSH button next to the instance you want to connect to. You can also click its name and then click SSH on the instance details page.

    establish ssh connection to vm instances
    establish ssh connection to vm instances

    This opens an SSH terminal window for your Ubuntu Linux instance, where you can now run commands.

    connect to google cloud instance host
    connect to google cloud instance host

    Install LAMP or LEMP on the new server before migration

    Before migrating your WordPress site to Google Cloud, you must install a LAMP or LEMP stack on your new server to make sure it has the right software.

    Install a LAMP (Linux, Apache, MySQL, PHP) or LEMP (Linux, Nginx, MySQL, PHP) stack on the new server before migration. Your goal is to ensure the new Google server has all the same servers and packages as your current one. We’ve listed some helpful posts you can use to install Apache, Nginx, MySQL, MariaDB, or PHP.

    Here are some other posts you may want to use when installing LAMP or LEMP on Ubuntu Linux.

    You can use the posts above to install the same servers and packages you have on your current server. Just make sure to install specific packages on your new server using the identical posts mentioned.

    Once all the packages are installed, you can transfer content from your current server to the new one.

    Configure your new Google server similar to your current server

    To make your WordPress migration to Google Cloud go smoothly, you need to set up your new server to be just like your old one.

    Web server settings must match between your old WordPress site and the new Google Cloud server for a successful migration. These settings include the directory structure and content of Virtual Host or Server blocks. Apache and Nginx are common web servers, and guides for setting up these configurations appear in the links below, offering clear instructions.

    • Apache directory: /etc/apache2/
    • Nginx directory: /etc/nginx/

    Your PHP configuration should also be identical to your current server’s PHP settings. Use the post above to install a specific PHP version and all the modules you have on your current server.

    • PHP directory: /etc/php/

    Your MySQL or MariaDB configurations should also mimic your current server. Validate each file, directory, and other data to ensure your new server is no different from your current server before migration.

    • MySQL / MariaDB directory: /etc/mysql/

    Once you’ve completed these checks, you can continue with the migration process.

    Back up current server data and database before migration

    Before moving your WordPress site to Google Cloud, it’s important to back up all your current website files and database.

    Backing up WordPress website content and database content is an essential first step. This backup process protects both the website files and all the data stored within the database, ensuring no information is lost during the migration.

    At this point, stop all changes on your current server before backing it up. You won’t want new changes added after the backup is complete.

    To back up WordPress content, log into your server via SSH. Once in your current server’s SSH console, run the commands below to back up your WordPress content, usually located at /var/www/html/.

    When you run the commands below, a backup file named current-server-backup.tar will be created containing your WordPress content.

    🐧Bash / Shell
    sudo tar -cvf current-server-backup.tar /var/www/html/

    Next, back up your database content. Again, you need to use the root account or an account with full access to the database you wish to back up.

    To back up all databases on the server, run the commands below:

    🐧Bash / Shell
    sudo mysqldump -u username –p --all-database > all_databases_backup.sql

    A file named all_databases_backup.sql should also be created in the current working directory.

    You should now have two files: current-server-backup.tar and all_database_backup.sql.

    Copy the current server’s content to the Google Cloud server

    At this point, you should be ready to copy the current server’s content over to your new server. There are several ways to transfer the tar and SQL data files.

    You can use the rsync command from the new server. SSH into it and use a command similar to the one shown below (remember to change the host names as needed).

    While connected to your Google Cloud console, run the commands below to connect to your current server and copy over the backed-up content.

    💻Code
    rsync -avz user@old-server.com:/home/<username>/all_database_backup.sql
    rsync -avz user@old-server.com:/home/<username>/current-server-backup.tar

    You could also use SCP to copy your files securely. The syntax looks like this:

    💻Code
    scp user@old-server.com:/home/<username>/all_database_backup.sql /home/username/
    scp user@old-server.com:/home/<username>/current-server-backup.tar /home/username/

    If you can’t get the files using SSH, you can use the wget command to download the files to your new Google Cloud server.

    You must copy the files to the current server’s web server root directory to use the commands below.

    Command Prompt
    cd ~
    wget http://old-web-site.com/all_database_backup.sql
    wget http://old-web-site.com/current-server-backup.tar

    Once the files are copied to your new server, continue to extract them below and import the database content into your database server.

    Restore the current server’s content to the Google Cloud server

    After backing up your WordPress site, the next step is to restore those files and your database to your new Google Cloud server.

    🐧Bash / Shell
    tar -xvf current-server-content.tar
    sudo cp -rf /var/www/html/ /var/www/html/

    Next, run the commands below to import the database content to your servers.

    🐧Bash / Shell
    sudo mysql -u root -p < all_database_backup.sql

    At this point, your Google server should have the current server and database content. Next, run the commands below to set up the correct permissions.

    Validate that all configurations on your current server match your new Google Cloud server. Once everything is validated, restart your web server.

    🐧Bash / Shell
    sudo systemctl restart nginx
    sudo systemctl restart apache2

    If you encounter an error, make sure to resolve it.

    Update your DNS and point your domain to your new Google server IP address

    The last step in your WordPress migration to Google Cloud is updating your domain’s DNS settings to point to your new server’s IP address.

    Once your local test is successful, log in to your DNS provider portal and update the DNS A record to point to your new server IP address.

    If everything works, you can continue fine-tuning your new server to ensure all configurations are correct.

    That should do it!

    Conclusion:

    Migrating a WordPress website to Google Cloud requires following specific steps. Achieving a smooth transition means remembering key actions.

    • Take Inventory: Document your existing server’s environment before starting the migration.
    • Set Up Your Google Cloud Server: Ensure your new configuration matches your current setup.
    • Install Required Software: Ensure all necessary software (LAMP/LEMP) is installed on the new server.
    • Back-Up Data: Always back up your website files and database before making any changes.
    • Transfer Content: Use secure methods such as rsync or SCP to transfer your files to the new server.
    • Restore Data: Extract and import your database and website content to your Google Cloud server.
    • Test Before Going Live: Conduct local tests to ensure everything functions as expected.
    • Update DNS Records: Point your domain to the new server’s IP address once everything is verified to be working.

    Following these steps will help you migrate your WordPress site with minimal downtime, ensuring a smooth experience for your visitors.

    Can I run WordPress on Google Cloud?

    Google Cloud's hosting services give your WordPress site improved performance, virtually limitless scalability, stronger security, greater control, and more flexibility. Once your free trial ends, you can continue to host your website starting at USD 13.17/month with WordPress on Google Cloud.

    Was this guide helpful?

    Was this helpful?
    Richard

    About the Author

    Richard

    Tech Writer, IT Professional

    Richard, a writer for Geek Rewind, is a tech enthusiast who loves breaking down complex IT topics into simple, easy-to-understand ideas. With years of hands-on experience in system administration and enterprise IT operations, he’s developed a knack for offering practical tips and solutions. Richard aims to make technology more accessible and actionable. He's deeply committed to the Geek Rewind community, always ready to answer questions and engage in discussions.

    📚 Related Tutorials

    How To Reset Microsoft Edge To Default Settings On Windows 11
    Browsers How To Reset Microsoft Edge To Default Settings On Windows 11
    How to Change Copy-Paste Settings in Microsoft Edge
    Browsers How to Change Copy-Paste Settings in Microsoft Edge
    How to Migrate a Website to Google Cloud Without Downtime
    CMS How to Migrate a Website to Google Cloud Without Downtime
    How to Enable or Disable Sign-in to Microsoft Edge using non-Microsoft accounts in Windows 11
    Browsers How to Enable or Disable Sign-in to Microsoft Edge using non-Microsoft accounts in Windows 11

    No comments yet — be the first to share your thoughts!

    Leave a Comment

    Your email address will not be published. Required fields are marked *