Yandex Cloud
Search
Contact UsTry it for free
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • AI for business
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
    • Price calculator
    • Pricing plans
  • Customer Stories
  • Documentation
  • Blog
© 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
      • Formatting Cloud Video content in IFrame

In this article:

  • Make a backup of the site
  • Get your cloud ready
  • Required paid resources
  • Create a VM for WordPress
  • Connect to the VM
  • Install and configure additional components
  • Install the nano editor
  • Install phpMyAdmin
  • Configure phpMyAdmin
  • Import the DB
  • Disable phpMyAdmin
  • Transfer the site files
  • Configure DNS
  • Add a DNS zone
  • Add resource records
  • Delegate the domain name
  • Test the website
  • Install the SSL certificate using Let's Encrypt®
  • Install the Let's Encrypt client
  • Get an SSL certificate
  • Perform auto-update
  • Test the website
  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
Updated at September 29, 2025
  • Make a backup of the site
  • Get your cloud ready
    • Required paid resources
  • Create a VM for WordPress
  • Connect to the VM
  • Install and configure additional components
    • Install the nano editor
    • Install phpMyAdmin
    • Configure phpMyAdmin
  • Import the DB
    • Disable phpMyAdmin
  • Transfer the site files
  • Configure DNS
    • Add a DNS zone
    • Add resource records
    • Delegate the domain name
    • Test the website
  • Install the SSL certificate using Let's Encrypt®
    • Install the Let's Encrypt client
    • Get an SSL certificate
    • Perform auto-update
  • Test the website

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 website to Yandex Cloud:

  1. Make a backup of the site
  2. Get your cloud ready.
  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 DNS.
  9. Create a SSL certificate.
  10. Test the website.

Make a backup of the siteMake a backup of the site

Create a backup of the website and DB files using one of the following methods:

  • Using various WordPress plugins, e.g., 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 DB using phpMyAdmin.

    This method is longer and will take 5 to 20 minutes because you need to copy numerous small files that make up your site.

Get your cloud readyGet your cloud ready

Sign up for Yandex Cloud and create a billing account:

  1. Navigate to the management console and log in to Yandex Cloud or create 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.

Learn more about clouds and folders here.

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 its name to see the list of subnets. If the subnets or network you need are not listed, create them.

Required paid resourcesRequired paid resources

The cost of maintaining a WordPress website includes:

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

Create a VM for WordPressCreate a VM for WordPress

To create a VM:

  1. On the folder dashboard of the management console, click Create resource and select Virtual machine instance.

  2. Under Boot disk image, in the Product search field, enter LAMP and select the LAMP public image containing the required components: Linux, Apache web server, MySQL® DBMS, and PHP interpreter.

  3. Under Location, select the availability zone your VM will reside in. If you are not sure which one to choose, leave the default.

  4. Under Disks and file storages, select the disk type and set the required size.

  5. Under Computing resources, navigate to the Custom tab and specify the platform, number of vCPUs, and RAM size:

    • Platform: Intel Ice Lake
    • vCPU: 2
    • Guaranteed vCPU performance: 20%
    • RAM: 1 GB
  6. Under Network settings:

    • In the Subnet field, select the network and subnet to connect your VM to. If the required network or subnet is not there, create it.
    • Under Public IP address, leave Auto to assign a random external IP address to your VM from the Yandex Cloud pool. Alternatively, select a static address from the list if you reserved one.
  7. Under Access, select SSH key and specify the VM access credentials:

    • In the Login field, enter the username. Do not use root or other reserved usernames. To perform operations requiring root privileges, use the sudo command.
    • In the SSH key field, select the SSH key saved in your organization user profile.

      If there are no SSH keys in your profile or you want to add a new key:

      1. Click Add key.

      2. Enter a name for the SSH key.

      3. Select one of the following:

        • Enter manually: Paste the contents of the public SSH key. You need to create an SSH key pair on your own.

        • Load from file: Upload the public part of the SSH key. You need to create an SSH key pair on your own.

        • Generate key: Automatically create an SSH key pair.

          When adding a new SSH key, an archive containing the key pair will be created and downloaded. In Linux or macOS-based operating systems, unpack the archive to the /home/<user_name>/.ssh directory. In Windows, unpack the archive to the C:\Users\<user_name>/.ssh directory. You do not need additionally enter the public key in the management console.

      4. Click Add.

      The system will add the SSH key to your organization user profile. If the organization has disabled the ability for users to add SSH keys to their profiles, the added public SSH key will only be saved in the user profile inside the newly created resource.

  8. Under General information, specify the VM name: wordpress-vm.

    Alert

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

  9. Under Advanced, select a service account or create a new one.

  10. Click Create VM.

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

Connect to the VMConnect to the VM

You can connect to a VM over SSH once it gets the RUNNING status. To do this, you can use the ssh utility in Linux/macOS/Windows 10 and PuTTY in Windows 7/8.

To connect to the VM, specify its public IP address.

To copy the VM's public IP address:

  1. Open the folder page in the management console.
  2. Select Compute Cloud.
  3. In the left-hand panel, select Virtual machines.
  4. Find the created VM and click its name.
  5. Under Network, copy the IP address from the Public IPv4 address field.

Connect to the VM.

Install and configure additional componentsInstall and configure additional components

Before you transfer your files, do the following:

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

Install the nano editorInstall the nano editor

Ubuntu

Run this command:

sudo apt install nano

Wait for the editor to be installed.

Install phpMyAdminInstall 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 * icon will appear next to Apache2. Press Enter.

  3. Set up phpMyAdmin access to the DB. When prompted Configure database for phpmyadmin with dbconfig-common?, choose <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_ROOT_PASS=KjZKrQV7efFGk
    

    Copy and save the password: MYSQL_ROOT_PASS. You will need it later.

  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://<VM_public_IP_address>/phpmyadmin.

    To log in to phpMyAdmin, use the following data:

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

Configure phpMyAdminConfigure phpMyAdmin

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

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 to the phpmyadmin.conf file. To do this, press 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 these 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 logging in to phpMyAdmin, you will need to enter an additional username and password specified in the .htpasswd file.

Import the DBImport the DB

Ubuntu
  1. Open your website’s WordPress configuration file. To do this, unpack the archive and open the wp-config.php file 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_public_IP_address>/phpmyadmin`
    
  3. Go to the User accounts section and add a user account with the following parameters:

    • Username: Insert a value for DB_USER from wp-config.php.
    • Host name: 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. Fill in 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 DB from a backup:

    • In the left column, select the DB you created.
    • Click Import and select the saved DB backup. If the DB backup exceeds the default limit of 2 MB, edit the php.ini configuration file where this limit 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, 8.1.

    2. Edit the parameters:

      • upload_max_filesize: Maximum size of the uploaded file.
      • post_max_size: Maximum message size for the POST method.
      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 DB import operation.

Disable phpMyAdminDisable phpMyAdmin

All the main DB migration activities are performed. Disable the utility to avoid outside attacks on phpMyAdmin:

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

You can use the terminal to work with the DB.

Transfer the site filesTransfer the site files

To transfer backup files to a VM, 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 VM's public IP address. 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/<username>/.ssh/ folder).

    The FTP client does not 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. As a result, you will connect to the VM.

  6. Find the /var/www/html folder on the VM and paste the backup file there. You do not need to copy index.html.

    Ubuntu

    By default, 755 rights are set for this folder. To copy the site archive file from your hard drive to the html folder, change the permissions for 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 site archive file.

    Alert

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

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

    rm FILENAME.tar.gz
    

    Return the rights for the folders:

    • html and subfolders: 755.
    • For all files inside html: 644.
    • For wp-config.php separately, 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
    

    f parameter: Searches for all files within folders. d parameter: Searches for all folders within html.

Configure DNSConfigure DNS

Use Cloud DNS to manage the domain.

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

Add a DNS zoneAdd a DNS zone

Management console

To add a public DNS 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 DNS zone settings:
    • Zone: example.com.. Or specify your registered domain.
    • Type: Public.
    • Name: example-zone-1.
  4. Click Create.

Add resource recordsAdd resource records

Create DNS records in the public zone:

Management console
  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 containing the example.com DNS zone.
    • Select the example.com DNS zone from the list.
    • Click Create record.
    • Specify the record settings:
      • Name: Leave empty.
      • Type: Leave set to A.
      • Data: Enter your VM's public address.
      • TTL (in seconds) (record time to live): Keep the default value.
    • Click Create.
  3. Create a CNAME record:
    • Select the example.com DNS zone from the list.
    • Click Create record.
    • Specify the record settings:
      • Name: www.
      • Type: Select CNAME.
      • Data: Enter example.com.
      • TTL (in seconds) (record time to live): Keep the default value.
    • Click Create.

Delegate the domain nameDelegate the domain name

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

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

Delegation does not take effect immediately. Internet provider servers normally update records within 24 hours (86,400 seconds). This depends on the TTL value which specifies how long domain records are cached.

You can check domain delegation using Whois or the dig utility:

dig +short NS example.com

Result:

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

Test the websiteTest the website

To test the site, enter its IP address or domain name in your browser:

  • http://<VM_public_IP_address>.
  • http://www.example.com.

Install the SSL certificate using Let's Encrypt®Install the SSL certificate using Let's Encrypt®

Use Let’s Encrypt to install the certificate. Let's Encrypt is a certificate authority that issues free SSL certificates.

Install the Let's Encrypt clientInstall 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 universe and certbot repositories:

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

    Press Enter.

  3. Install the Let's Encrypt client:

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

Get an SSL certificateGet an SSL certificate

Ubuntu
  1. Enter this command:

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

  3. Indicate whether to redirect all pages from http to https when opening your website. Select 2 to redirect to https.

  4. Test your website: paste https://www.ssllabs.com/ssltest/analyze.html?d=example.com to your browser's address bar.

Perform auto-updatePerform auto-update

The certificate is issued for 90 days. You need 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.

Test the websiteTest the website

WordPress sites sometimes have a problem opening internal links when switching from one hosting to another. Check whether the .htaccess file exists in your website'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 program 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.

Test the website. If the links do not open, it means that support for the .htaccess file is disabled in Apache.

To enable .htaccess support:

Ubuntu
  1. Enter this command:

    sudo nano /etc/apache2/sites-available/000-default.conf
    
  2. Add program 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.