How do I move wordpress site to digital ocean with out Downtime?

Posted May 11, 2020 3.8k views

I am planning on migrating my WordPress hosting from GoDaddy to a WordPress droplet using the same domain name. I want to minimize downtime. How best do I do this?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
2 answers

Hi there @osoisi,

The process that you need to follow is:

  • You would need to first set up a Wordpress Droplet, to do that you can either follow the steps on how to do that manually here:

Or you could use the 1-Click installation here:

  • After that, you need to backup your Wordpress files and Database from your GoDaddy account

  • Then using SFTP or SSH upload your Wordpress files and database to your DigitalOcean Droplet.

If you are using the 1-Click installation, you can delete the files from the /var/www/html folder and upload your files from GoDaddy to that folder.

  • Then you would have to create a new database and a username and import your Wordpress database that you’ve backed up from your GoDaddy account

  • After that make sure to update your wp-config file with the new database details

  • Then in order to avoid any downtime, you can test your site on your Droplet. To do that you can edit the hosts file on your PC to bypass the DNS lookup and access the site on our servers through your main domain.

This only affects your computer and your visitors will see the site as normal.

The location of the file is as follows:

  • Windows PC
  • Mac OSX:
  • Linux:

Just open it up in your favorite text editor (e.g. Notepad) and add that line on the bottom:

  • server_ip_address

Once you have made the change, save the file and browse to your website as normal. Make sure to clear the cache of your browser.

You will see it served from your DigitalOcean Droplet and will be able to test the full functionality of your CMS before actually pointing your domain name to your DigitalOcean Droplet.

To view the site on your existing host, just remove the line from your hosts file.

  • Finally once you are sure that your website is working as it should, then you will need to point your domain name to your Droplet, you can do that by either changing your A record to point to your Droplet’s IP address or changing your nameservers to the DigitalOCean nameservers:

So to summarize:

  • Create a WordPress Droplet
  • Backup your website
  • Upload your website to your Droplet
  • Import your database and update your wp-config file
  • Test your website with your hosts file
  • Once you are sure that the website is working point your domain to your Droplet

Let me know if you have any questions.
Hope that this helps!

by Josh Barnett
by Kathleen Juell
DNS is the naming system that is used to bind a domain name to a web server. In this guide, we will change the nameservers for a domain that we have registered and point it to a DigitalOcean Droplet.
  • Hey @bobbyiliev, great answer!

    How is this procedure changing if the existing website has an SSL and the WordPress/web server is configured so it automatically redirects all HTTP traffic to HTTPS?

    I have a similar situation, I did what you said (before reading your post, so I confirm that this should work) but it redirects to HTTPS and it fails (as my droplet does not have any HTTPS configured yet).


    • The domain name is hosted on Cloudflare (or any other DNS hosting company)

    • Current website is hosted to a shared Godaddy (or any other shared hosting company) hosting with SSL configured.

    • Current website has various domain name related services running (Ex. google analytics, google maps, etc)

    • New website will be hosted on DigitalOcean Droplet (ex IP: XXX.XXX.XXX.XXX)

    Some questions:

    Provided that we follow your steps above, visiting the domain (ex. will fail as it’s going to redirect to but the hosts file is pointing just to

    1. How do I configure HTTPS on the droplet before pointing the A records to the droplet’s IP address?

    2. Say we gain access to the email (customer will give it to us) and we try to issue a new SSL, will this invalidate the current SSL configured on the current hosting? [Remember, we try to have minimum downtime, so I don’t want something to happen to the current setup before changing the A records]

    3. Can we generate and configure an SSL to the droplet even if the A records are not pointing to our droplet yet?

    4. Do I need to perform “Search and replace” in the imported Database to replace with http://XXX.XXX.XXX.XXX ?

    Thank you in advance!

Hello @osoisi,

This is quite easy to do, You can move your website on Digitalocean with any 1ms downtime. The first thing you have to do, Create a Droplet and Install either LEMP or LAMP whatever you like.

You can go here and collect the information about LAMP:

Follow all the steps according to guide, but one thing you have to change is Virtual host configuration if you want to run a WordPress website.

You can make the configuration like this:

Replace with your own domain.

<VirtualHost *:80>
  # Admin email, Server Name (domain name), and any aliases

  # Index file and Document Root (where the public files are located)
  DirectoryIndex index.html index.php
  DocumentRoot /var/www/html/
  <Directory /var/www/html/>
      Options Indexes FollowSymLinks
      AllowOverride All
      Require all granted

  # Log file locations
  LogLevel warn
  ErrorLog  /var/www/html/
  CustomLog /var/www/html/ combined

Next, take a back up of your Database and Publichtml directory. Upload publichtml directory here: /var/www/html/

To manage the Database you can use Phpmyadmin:

Upload your Database and connect with your website, Now you’re ready to live your website on digital ocean server.

Point your Domain to Droplet public IP.

If you’ll set up digital ocean DNS, then it may take some time to live.

by Brennen Bearnes
by Mark Drake
phpMyAdmin is an application that allows users to interact with MySQL databases through a web interface. This tutorial covers the process of installing and securing phpMyAdmin on an Ubuntu 18.04 server.