Yandex Cloud
Search
Contact UsGet started
  • Blog
  • Pricing
  • Documentation
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • ML & AI
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Customer Stories
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Education and Science
    • Yandex Cloud Partner program
  • Blog
  • Pricing
  • Documentation
© 2025 Direct Cursus Technology L.L.C.
Tutorials
    • All tutorials
      • Transferring a WordPress website from a different hosting provider to Yandex Cloud
      • Setting up virtual hosting
      • Creating a Python web application with Flask
      • Hosting a static Gatsby website
      • Migrating to Cloud CDN from a third-party CDN provider
      • Getting website traffic statistics with S3 Select

In this article:

  • Make a backup of the site
  • Prepare your cloud
  • Required paid resources
  • Create a virtual machine for WordPress
  • Connect to the VM
  • Install and configure additional components
  • Install the nano editor
  • Install phpMyAdmin
  • Configure phpMyAdmin
  • Import the database
  • Disable phpMyAdmin
  • Transfer the site files
  • Configure the DNS
  • Add a zone
  • Add resource records
  • Delegate the domain name
  • Check that the website is running
  • Install the SSL certificate using Let's Encrypt®
  • Install the Let's Encrypt client
  • Get an SSL certificate
  • Perform auto-update
  • Check that the website is running
  1. Application solutions
  2. Creating a website
  3. Transferring a WordPress website from a different hosting provider to Yandex Cloud

Transferring a WordPress website from a different hosting provider to Yandex Cloud

Written by
Yandex Cloud
Improved by
Danila N.
Updated at May 7, 2025
  • Make a backup of the site
  • Prepare your cloud
    • Required paid resources
  • Create a virtual machine for WordPress
  • Connect to the VM
  • Install and configure additional components
    • Install the nano editor
    • Install phpMyAdmin
    • Configure phpMyAdmin
  • Import the database
    • Disable phpMyAdmin
  • Transfer the site files
  • Configure the DNS
    • Add a zone
    • Add resource records
    • Delegate the domain name
    • Check that the website is running
  • Install the SSL certificate using Let's Encrypt®
    • Install the Let's Encrypt client
    • Get an SSL certificate
    • Perform auto-update
  • Check that the website is running

WordPress is an open-source content management system.

With WordPress, you can create news sites, personal or corporate blogs, business websites, online stores, and other services.

It allows you to launch your website with minimal effort using one of the many available templates or your own design. Ready-made plugins help you easily add new blocks or features to a created service.

In Yandex Cloud, you can quickly create a website on WordPress or transfer from another hosting provider.

To transfer a WordPress CMS website to Yandex Cloud:

  1. Make a backup of the site.
  2. Prepare your cloud.
  3. Create a virtual machine for WordPress.
  4. Connect to the VM.
  5. Install and configure additional components.
  6. Import the database.
  7. Transfer the site files.
  8. Configure the DNS.
  9. Create a SSL certificate.
  10. Check that the website is running.

Make a backup of the site

Make a backup of the site and database files using one of the following methods:

  • Using various plugins for WordPress (for example BackWPup or Updraft Plus).
  • Using built-in tools from the hosting control panel for your website.
  • Copying all the files to your hard drive using an FTP client and exporting the database using the phpMyAdmin panel.
    This method is longer and will take 5 to 20 minutes because you need to copy numerous small files that make up your site.

Prepare your cloud

Sign up in Yandex Cloud and create a billing account:

  1. Navigate to the management console and log in to Yandex Cloud or register a new account.
  2. On the Yandex Cloud Billing page, make sure you have a billing account linked and it has the ACTIVE or TRIAL_ACTIVE status. If you do not have a billing account, create one and link a cloud to it.

If you have an active billing account, you can navigate to the cloud page to create or select a folder for your infrastructure to operate in.

Learn more about clouds and folders.

Make sure the selected folder has a cloud network with a subnet in at least one availability zone. To do this, select Virtual Private Cloud on the folder page. If the list contains a network, click on its name to see the list of subnets. If the subnets or network you need are not listed, create them.

Required paid resources

The cost of hosting a website in WordPress includes:

  • Fee for continuously running VM (see Yandex Compute Cloud pricing).
  • A fee for using a dynamic or public IP address (see Yandex Virtual Private Cloud pricing).
  • A fee for public DNS queries and zones (see Yandex Cloud DNS pricing).

Create a virtual machine for WordPress

To create a VM:

  1. Open the folder page in the management console.

  2. In the upper-right corner, click Create resource and select Virtual machine.

  3. In the Name field, enter the VM name wordpress-vm.

    • It must be from 2 to 63 characters long.
    • It may contain lowercase Latin letters, numbers, and hyphens.
    • It must start with a letter and cannot end with a hyphen.
  4. Select an availability zone to place the VM in. If you do not know which availability zone you need, leave the default one.

  5. Under Image/boot disk selection, go to the Cloud Marketplace tab and select LAMP, an image that includes the appropriate set of components: the Linux OS, Apache web server, MySQL DBMS, and PHP interpreter.

  6. Under Disks, select the disk type and set the size.

  7. Under Computing resources:

    • Choose a VM platform.
    • Specify the required number of vCPUs and the amount of RAM.

    For a regular WordPress site, the minimum configuration is enough:

    • Platform: Intel Ice Lake.
    • Guaranteed vCPU share: 20%.
    • vCPU: 2.
    • RAM: 1 GB.
  8. Under Network settings, select the network and subnet to connect the VM to. If you do not have a network or subnet, create them on the VM creation page.

  9. Under Public address, keep Auto to assign your VM a random external IP address from the Yandex Cloud pool, or select a static address from the list if you reserved one in advance.

  10. Enter the VM access information:

    • Select a service account or create a new one.
    • Enter the username in the Login field.
    • In the SSH key field, paste the contents of the public key file.
      You will need to create a key pair for the SSH connection yourself, see Connecting to a Linux VM via SSH.

    Alert

    Once created, the VM will be assigned an IP address and a host name (FQDN) for connections. If you selected No address in the Public address field, you won't be able to access the VM from the internet.

  11. Click Create VM.

    It may take a few minutes to create the VM. When the VM status changes to RUNNING, you can upload the website files.

Connect to the VM

You can connect to a VM using the SSH protocol when it is running (the VM's status is RUNNING). To do this, you can use the ssh utility in Linux/macOS/Windows 10 and PuTTY in Windows 7/8.

To connect to a VM, you must specify its public address.

To copy a VM's public address:

  1. Open the folder page in the management console.

  2. Select Compute Cloud.

  3. In the menu on the left, select Virtual machines.

  4. Locate the created VM and click on its name.

  5. Under Network, copy the address from the Public IPv4 field.

Run the connection to a virtual machine.

Install and configure additional components

Before you transfer your files, do the following:

  • Install the text editor nano. You need it to edit some of the configuration files.
  • Install and configure phpMyAdmin to manage the site database.

Install the nano editor

Ubuntu

Run this command:

sudo apt install nano

Wait for the editor to be installed.

Install phpMyAdmin

Ubuntu
  1. Run the following commands:

    sudo apt-get update
    sudo apt-get install phpmyadmin php-mbstring php-gettext
    
  2. During the installation process, select the server to install phpMyAdmin on. Select Apache2 and press the space bar on the keyboard: the * symbol appears next to Apache2. Click Enter.

  3. Configure access of phpMyAdmin to the database. To do this, answer the question Configure database for phpmyadmin with dbconfig-common? with <yes>. You can skip entering the password, the system will automatically generate it. To copy the generated password, run the command:

    sudo cat /root/default_passwords.txt
    

    The text of the file must contain the following data:

    MYSQL_PASS=DOEC21WECnhF1 
    MYSQL_ROOT_PASS=KjZKrQV7efFGk 
    MYSQL_USER=wordpress 
    MYSQL_DB=wordpress
    
    Apache Web Auth:
    login: admin 
    password: ***************
    

    Copy and save the contents of the default_passwords.txt file to my computer.

  4. Enable the mbstring extension for PHP:

    sudo phpenmod mbstring
    
  5. To accept all changes, restart Apache:

    sudo systemctl restart apache2
    
  6. Open phpMyAdmin in the browser. In the address bar, enter http://<public address of the VM>/phpmyadmin.

    To log in to phpMyAdmin use the following data:

    User: root
    Password: generated by the system (from the default_passwords.txt file)
    

Configure phpMyAdmin

Set up an additional password to log in to the phpMyAdmin panel. To enable the use of access settings in .htaccess, edit the phpmyadmin.conf file.

Ubuntu
  1. Run this command:

    sudo nano /etc/apache2/conf-available/phpmyadmin.conf
    
  2. Add the AllowOverride All line to the phpmyadmin.conf file:

    <Directory /usr/share/phpmyadmin>
    Options SymLinksIfOwnerMatch
    DirectoryIndex index.php
    AllowOverride All
    
  3. Save the changes in the phpmyadmin.conf file. To do this, click Ctrl + O and Enter. To exit the file, press Ctrl + X.

  4. Restart Apache:

    sudo systemctl restart apache2
    
  5. Create .htaccess:

    sudo nano /usr/share/phpmyadmin/.htaccess
    
  6. Copy the lines to .htaccess:

    AuthType Basic
    AuthName "Restricted Files"
    AuthUserFile /etc/phpmyadmin/.htpasswd
    Require valid-user
    
  7. Save the changes to the file.

  8. Create .htpasswd:

    sudo htpasswd -c /etc/phpmyadmin/.htpasswd <username>
    

    Set the desired password and repeat it.

  9. Restart Apache:

    sudo systemctl restart apache2
    

Now, when you log in to phpMyAdmin, you will need to enter an additional username and password specified in the .htpasswd file.

Import the database

Ubuntu
  1. Open the WordPress configuration file of your website. To do this, unpack the archive and open wp-config.php in the root folder. Find the values of the DB_USER, DB_NAME, and DB_PASSWORD parameters:

    define('DB_USER', 'UsernameTEST');
    define('DB_NAME', 'database_wordpress');
    define('DB_PASSWORD', 'MySecretPassword');
    
  2. Log in to phpMyAdmin: enter the following in the browser address bar:

    http://<VM's public address/phpmyadmin`
    
  3. Go to the User accounts section and add a user account with the following parameters:

    • Username: Insert a value of DB_USER from wp-config.php.
    • Hostname: Leave the default value %.
    • Password: Insert a value for DB_PASSWORD from wp-config.php.
    • Global privileges: Enable the Mark all option.

    Leave the other default parameters when creating a user. At the bottom of the screen, click Forward.

  4. Go to the Databases section. Complete the Database name field with a value for DB_NAME from wp-config.php. Select the utf8_general_ci encoding. Click Create.

  5. Import the database from a backup:

    • In the left column, select the database you created.
    • Click Import and select the saved database backup. If the database backup exceeds the default limit of 2 MB, edit the configuration file php.ini where this restriction is set.
    1. Run this command:

       sudo nano /etc/php/X.X/apache2/php.ini
      

      X.X: php version. Possible values 5.6,7.0,7.1,7.2,7.3,7.4,8.0, and 8.1.

    2. Edit the parameters:

      • upload_max_filesize: The maximum size of the uploaded file.
      • post_max_size: The maximum amount of POST method data allowed.
      upload_max_filesize = 80M
      post_max_size = 80M
      
    3. Save the changes: Press Ctrl + O and Enter. To exit the file, press Ctrl + X.

    4. Restart Apache:

      sudo systemctl restart apache2
      
    5. Repeat the database import operation.

Disable phpMyAdmin

All the main migration activities on the database are performed. In order not to expose phpMyAdmin to attacks from outside, disable the utility:

Ubuntu
sudo a2disconf phpmyadmin.conf && sudo /etc/init.d/apache2 restart

You can use the terminal to work with the database.

Transfer the site files

To transfer backup files to a virtual machine, use the FileZilla FTP client:

  1. Open FileZilla.

  2. Go to File → Site manager and add a new website.

  3. Select SFTP and enter the public IP address of the virtual machine. Under Logon type, select File with the key.

  4. Specify the user created when configuring the VM and select the key file (located in the /Users/<user_name>/.ssh/ folder).

    The FTP client doesn't see the hidden folder by default. Press Cmd + Shift + G and select the id_ed25519 file without the pub extension. A message is displayed that the file is not supported. The FTP client will offer to convert it to the desired format. Click Yes. Save the converted file in a convenient location.

  5. Click Connect and enter the passphrase that you created at the beginning of the work. You'll be connected to the VM.

  6. Find the /var/www/html folder on the VM and copy the backup file there. You don't need to copy index.html.

    Ubuntu

    By default, this folder requires 755 rights. To copy the archive file of the site from your hard drive to the html folder, change the rights to the folder:

    sudo chmod 777 /var/www/html
    

    Unpack the backup:

    cd /var/www/html
    tar -xvf FILENAME.tar.gz
    

    Instead of FILENAME, specify the name of the archive file of the site.

    Alert

    You should unpack all the files to the root directory html, not to the subdirectory /var/www/html/wordpress.

    Delete the backup file so that it does not take up space:

    rm FILENAME.tar.gz
    

    Return the rights to the folders:

    • html and subfolders: 755.
    • For all files inside html: 644.
    • For wp-config.php, an individual access level: 600.
    cd var/www/
    sudo find ./ -type d -exec chmod 0755 {} \;
    sudo find ./ -type f -exec chmod 0644 {} \;
    sudo chmod 600 wp-config.php
    

    The f parameter: Searches for all files inside folders. The d parameter: Searches for all folders inside html.

Configure the DNS

Use Cloud DNS to manage the domain.

The tutorial below describes configuring DNS for the example.com domain name.

Add a zone

To add a public zone:

  1. Open the Cloud DNS section of the folder where you need to create a DNS zone.
  2. Click Create zone.
  3. Specify the zone settings:
    • Zone name: example-zone-1.
    • Zone: example.com. Specify your registered domain.
    • Type: Public.
  4. Click Create.

Add resource records

Create DNS records in the public zone:

  1. Under Network on the VM page in the management console find the VM's public IP address.
  2. Create an A record:
    • Open the Cloud DNS section of the folder where the example.com zone is located.
    • Select example.com from the list.
    • Click Create record.
    • Set the record parameters:
      • Name: Leave empty.
      • Record type: Keep A as the value.
      • TTL (record time to live): Leave the default.
      • Value: Enter your VM's public address.
    • Click Create.
  3. Create a CNAME record:
    • Select example.com from the list.
    • Click Create record.
    • Set the record parameters:
      • Name: www.
      • Record type: Select CNAME as the value.
      • TTL (record time to live): Leave the default.
      • Value: Enter example.com.
    • Click Create.

Delegate the domain name

Delegation is the transfer of authority from the registrar's servers to yours. For a domain, NS resource records are created (ns1.yandexcloud.net and ns2.yandexcloud.net).

To delegate a domain, specify its DNS servers in the registrar's account.

Delegation does not take effect immediately. It normally takes internet service providers up to 24 hours (86400 seconds) to update records. This depends on the TTL value which determines how long domain records are cached.

You can verify domain delegation using the Whois service or the dig utility:

dig +short NS example.com

Result:

ns2.yandexcloud.net.
ns1.yandexcloud.net.

Check that the website is running

To check that the site is up, enter its IP address or domain name in your browser:

  • http://<virtual machine public IP address>.
  • http://www.example.com.

Install the SSL certificate using Let's Encrypt®

To install the certificate, use Let’s Encrypt. Let's Encrypt is a certificate authority that offers free SSL certificates.

Install the Let's Encrypt client

Ubuntu
  1. Enter the following command in the terminal:

    sudo apt-get update && sudo apt-get install software-properties-common
    
  2. Add the unverse and certbot repositories:

    sudo add-apt-repository universe && sudo add-apt-repository ppa:certbot/certbot
    

    Click Enter.

  3. Install the Let's Encrypt client:

    sudo apt-get update && sudo apt-get install certbot python-certbot-apache
    
  4. Click Y and Enter.

Get an SSL certificate

Ubuntu
  1. Enter the command:

    sudo certbot --apache
    
  2. In the interface, enter the name of your domain example.com or www.example.com.

  3. Decide if you need to redirect all pages from http on https when opening a website. Select 2: Redirect to https.

  4. Test your site: Enter https://www.ssllabs.com/ssltest/analyze.html?d=example.com in the address bar of the browser.

Perform auto-update

The certificate is issued for 90 days. You need to to update it regularly. Configure the update schedule using cron:

Ubuntu
  1. Enter the following command in the terminal:

    sudo crontab -e
    
  2. In the dialog, select the first item from the list.

  3. Add a line of code to the very end of the file:

    30 2 * * 1 /usr/bin/certbot renew >> /var/log/le-renew.log
    

    As a result, an SSL certificate is scheduled to be updated every Monday at 2:30 am. The result will be recorded in a log file.

Check that the website is running

WordPress sites sometimes have a problem opening internal links when switching from one host to another.

In this case, check whether the .htaccess file exists in your site's root folder: var/www/html/.htaccess.

If there is no file, create it.

Ubuntu
  1. Enter the following command in the terminal:

    sudo nano /var/www/html/.htaccess
    
  2. Add a code:

    <IfModule mod_rewrite.c>
         RewriteEngine On
         RewriteBase /
         RewriteRule ^index\.php$ - [L]
         RewriteCond %{REQUEST_FILENAME} !-f
         RewriteCond %{REQUEST_FILENAME} !-d
         RewriteRule . /index.php [L]
    </IfModule>
    
  3. Save the changes: Ctrl + O and Enter. To exit, press Ctrl + X.

Check the website. If the links don't open, it means the support of the .htaccess file was disabled in Apache.

To enable the support of .htaccess:

Ubuntu
  1. Enter the command:

    sudo nano /etc/apache2/sites-available/000-default.conf
    
  2. Add a code:

    <Directory /var/www/html>
        AllowOverride All
        Order allow,deny
        allow from all
    </Directory>
    
  3. As a result:

    <VirtualHost *:80 [::]:80>
        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/html
        <Directory /var/www/html>
    	   AllowOverride All
    	   Order allow,deny
    	   allow from all
        </Directory>
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
    </VirtualHost>
    
  4. Restart Apache:

    sudo systemctl restart apache2
    

Was the article helpful?

Previous
Terraform
Next
Overview
© 2025 Direct Cursus Technology L.L.C.