Hello,
I created a wordpress droplet using DigitalOcean’s One-click apps. I installed the droplet on a staging subdomain (let’s say staging.domain.com). Now that I’ve completed the site, I’d like to migrate the site from the subdomain to the root domain (i.e. staging.domain.com to domain.com). I’d also like to update all the urls to now use the root domain. I’ve seen guides to do this using cpanel for other hosting providers but not a cohesive one for DigitalOcean. Has anyone done this and/or can guide me in the right direction?
Thanks ahead of time!
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Accepted Answer
Generally, the only requirement would be that you change the URL’s associated with the installation. This could be done from ./wp-admin or by using define() constructs which would be added to the ./wp-config.php file.
For example:
define('WP_HOME','http://example.com');
define('WP_SITEURL','http://example.com');
You’d change example.com to your domain on both.
You may need to modify your Apache VirtualHost as well if it was setup with a sub-domain, though if you’ve not touched the VirtualHost files, then you should only need to use the above to swap out the URL’s.
Before making the change, and so you have something to fall back on, I’d take a snapshot of the Droplet. That way if something goes wrong and you’re not able to fix it, you can restore from a snapshot.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.