Partner with experts to accelerate your digital transformation journey
Bobcares

How to Migrate WordPress to DigitalOcean (Step-by-Step Guide)

PDF Header PDF Footer

Learn how to migrate WordPress to DigitalOcean step-by-step with database. Our WordPress & DigitalOcean team is always here to help you.

How to Migrate WordPress to DigitalOcean (Step-by-Step Guide)

migrate wordpress to digitaloceanLooking to migrate WordPress to DigitalOcean for better performance and control? You’re not alone. Many WordPress users move from shared hosting to a VPS setup like DigitalOcean for faster speed, reliability, and cost-efficiency. In this guide, you’ll get the exact steps needed to move your site without any fluff. Let’s dive right into the process to migrate WordPress to DigitalOcean efficiently.

Step 1: Backup Your Website Files and Database

Before anything, back up your essential WordPress data:

  • MySQL database: Download it from PHPMyAdmin on your current hosting.
  • wp-content folder: This holds your themes, plugins, and media.
  • .htaccess file: If you’ve added any custom rules, back it up as well.

These three components are key to a complete and functional WordPress migration.

Step 2: Spin Up a DigitalOcean Droplet

  1. Create a new droplet (DigitalOcean API create snapshot) using the one-click WordPress on Ubuntu 14.04.
  2. SSH into the server with the root credentials provided.
  3. Update your server with:
sudo apt-get update -y

Once logged in, the welcome screen shows default MySQL and PHP settings (see DigitalOcean no detected components issue if they don’t appear). You can also view them later with:
cat /etc/motd.tail

It’s recommended to change the default MySQL root password using:
mysql_secure_installation

Step 3: Set Up PHPMyAdmin

You’ll need PHPMyAdmin to easily import your old database.

  1. Install PHPMyAdmin:
sudo apt-get install phpmyadmin
  1. Enable PHP mcrypt:
sudo php5enmod mcrypt
  1. Increase file upload limit:
  • Edit /etc/php5/apache2/php.ini
  • Set file_uploads, upload_max_filesize, and post_max_size to 50MB or more.
  1. Restart Apache:
sudo service apache2 restart

Step 4: Import Your Database

Create a new database and user:

Using CLI:

mysql -u root -p
CREATE DATABASE devopscube_db;
CREATE USER db_admin@localhost IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON devopscube_db.* TO db_admin@localhost IDENTIFIED BY 'password';
FLUSH PRIVILEGES;
exit

Or, do it through PHPMyAdmin. Then:

  • Log in to PHPMyAdmin.
  • Select your new database.
  • Use the Import tab to upload your .sql file and import it.

Step 5: Upload wp-content Folder

Transfer your wp-content folder using SCP or FileZilla. Replace the existing one at /var/www/html/wp-content.

Set correct permissions:

sudo chown -R www-data:www-data /var/www/html/wp-content

Update your wp-config.php file:

  • Set the correct database name, user, and password.
  • Make sure the table prefix matches your old setup (e.g., wp_ or custom_).

Step 6: Point Your Domain to DigitalOcean

  • Copy the Droplet’s public IP from the DigitalOcean dashboard.
  • Go to your domain registrar’s DNS panel and update the A record to the new IP.

DNS propagation might take anywhere from a few minutes to several hours (https://bobcares.com/blog/digitalocean-errors-health-check/)

[If needed, Our team is available 24/7 for additional assistance.]

Conclusion

If you follow each step above carefully, you can successfully migrate WordPress to DigitalOcean without breaking anything. It gives you more flexibility, control, and speed. The ability to customize server settings and scale resources easily makes DigitalOcean an ideal choice for WordPress hosting.

0 Comments

Submit a Comment

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

Get featured on the Bobcares blog and share your expertise with a global tech audience.

WRITE FOR US
Bobcares

Use your time to build great apps. Leave your servers to us.

Managing a server is time consuming. Whether you are an expert or a newbie, that is time you could use to focus on your product or service. Leave your server management to us, and use that time to focus on the growth and success of your business.

TALK TO US Or click here to learn more.
server management

Custom WordPress Development Solutions for Your Business

Talk to us

Or click here to learn more.

Speed issues driving customers away?
We’ve got your back!