Migrating digital ocean wordpress droplet to another domain

Posted July 14, 2020 918 views

Hi all,

I am trying to just transfer a Wordpress site that I have configured to another domain name. I am not trying to setup a new droplet as the other domain name that I am trying to transfer to is a live business site.

I currently have the DNS setup done in Cloudflare. So I was wondering what was the easiest way with the least downtime to go ahead with this.

Any help is much appreciated.

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
1 answer

Hi, @fundlee

If you want to change the domain name associated with the WordPress installation (site) you need to update the references for the old/current domain name to match the new domain name. This is usually only in the database, but sometimes there are some hardcoded references in the files as well, so this is something to keep in mind.

The process is not that complicated and you can also use plugins in order to complete the task.

Note:Please before you proceed take a snapshot of the droplet and also create a backup of the site (both files and database). This will ensure that if something goes wrong you can easily restore your site or droplet if needed

There are a few ways to update the references in your database and it’s totally up to you which one you’ll choose. You can either change them manually if they’re not many or use an automation tool like a plugin or an external app.

One of the external apps that I’ve used and I know for sure that it’s working okay is:

You need to upload the script in your public_html folder and access it in your browser, then you’ll need to fill in your database details and enter the old name (IP address) and the domain name you want to use. Then you can first use the dry-run option and if there are references that need to be updated you can then run the script and update them.

Also, an alternative way is to use a plugin called “Duplicator” it will update all of the paths and references from the current domain to the new domain. You can also use a plugin called: Duplicator. The plugin will generate a backup for your website’s files and database. Then when you import the files to the new domain, all of the references for the old domain name will be updated properly with the correct ones.

Another option is to use the All-in-One WP Migration plugin. The plugin will do the replacement for you during import. You do not need to use any additional database search and replace

Once this is done you can check the site for any errors as there might be some hardcoded references for the IP address in the files like paths to directories, files and etc.

Hope this helps!


  • Hi @alexdo,

    Thank you very much for such a comprehensive reply! Really appreciate it! I would have to test some of the methods first before I mark it as resolved.

    Am currently trying with the all-in-one WP migration plugin now. Seemed to have hit a roadblock with it currently.


  • Hi @alexdo,

    An additional question to ask, would that be any changes required any of the server files[those that require your to change using command prompt]? or just the hardcoded references on the Wordpress level[those that can be changed via a plugin]?

    Apologies, but I am not very familiar with the jargons. Hope that you understand my question.


    • Hi,

      If there are some hardcoded references in the files you will need to adjust them to match the correct domain. In order to find them you can use grep and search for the string (in this case that will be the domain) in the WordPress install directory. Then you can simply edit the file in your favourite text editor, but you can also edit the files in any GUI (for example if you’re using cPanel or Plesk you can later the files using the File Manager or via SFTP as well)

      Hope that helps!