Question

Want to move site to another domain

Posted February 8, 2020 91 views
DigitalOcean Accounts

Recently i got new project and old developer has use digitalocean server for my client website. Now my client wants to move that web to new domain on same server. Actually i am new with Digital Ocean and i have zero knowledge of digital ocen. So i dont know what process has done by past developer and what to do move same website to one digital ocean server to another digial ocean server. Only Domain name will be changed. Kindly guide me every step as i am damm new for your server and Zero knowledge of it.

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.

×
1 answer

Hi @itechgrow,

It would be more of a server-side change rather than a DigitalOcean specific change. What you would need to do is the following:

  • First point your new domain name A DNS records to your Droplet’s IP address. The change would need to be made under the active DNS zone for the domain name in question, for example if you are using DigitalOcean’s Nameservers then you would need to make that DNS change via your DigitalOcean Control Panel. Here’s a step by step guide on how to manage your DNS zone via DigitalOcean:

https://www.digitalocean.com/docs/networking/dns/how-to/manage-records/

  • Once your Domain name is pointing to your Droplet, you would need to SSH to your Droplet and update your Virtual Host or Server Block from the old domain name to the new domain name, this would depend on what web server you are using. One way to find out what web server you are using is to first SSH to your Droplet and run the following command:
sudo netstat -plant | grep 80

On an Ubuntu Droplet, if you are using Nginx, you could find your Nginx server block at:

/etc/nginx/sites-enabled/your_domain_com.conf

For Apache this would be:

/etc/apache2/sites-enabled/your_domain_com.conf

Make the change and then restart your web server:

For Nginx:

systemctl restart nginx

For Apache:

systemctl restart apache2
  • Also if you are using a CMS like Wordpress you would need to update your Site and Home URLs to your new domain name, or if you are using a framework like Laravel, then you need to change your APP_URL in your .env file to the new domain

  • Finally, you could also rename your Droplet so that when you access your DigitalOcean control panel you could easily figure out what’s hosted on that Droplet. To do that you need to go to your DigitalOcean control panel at: https://cloud.digitalocean.com/ > then click on your Droplet > then click on the name of the Droplet and just edit the name

Hope that this helps!

Let me know if you have any other questions.
Regards,
Bobby

Submit an Answer