By fzl
How to migrate the Live project from AWS to DigitalOcean’s new droplet?
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!
Hey there! 👋
To transfer your website over to a DigitalOcean Droplet, the exact steps can vary depending on your setup. Are you using Docker, or is your project deployed directly on the server? Let me know more about your setup so I can give you specific guidance.
Overall, the process typically looks like this:
Create a new Droplet in your DigitalOcean account and install the necessary software stack (LAMP, LEMP, etc.) that your project needs.
rsync
You can use rsync
to transfer your project files from your AWS server to the Droplet:
rsync -avz /path/to/your/project/ user@your_droplet_ip:/path/to/destination/
-a
: Archive mode (preserves permissions).-v
: Verbose output.-z
: Compress data during transfer.For more details, check out this rsync guide.
On the AWS server, export your database:
mysqldump -u username -p database_name > db_backup.sql
Transfer the dump file to your Droplet:
rsync -avz db_backup.sql user@your_droplet_ip:/path/to/destination/
On the Droplet, import the database:
mysql -u username -p new_database_name < /path/to/destination/db_backup.sql
Update your application’s configuration files with the new database credentials, server paths, and any other settings specific to the new environment.
/etc/hosts
Before updating DNS, you can test your site by editing your local /etc/hosts
file. This file allows you to map a domain name to a specific IP address for your machine only.
Steps to update /etc/hosts
on your local machine:
Open the file with a text editor (you need admin/sudo permissions):
sudo nano /etc/hosts
Add a line mapping your domain to the new Droplet’s IP:
your_droplet_ip yourdomain.com
Save and exit the file (CTRL + O
to save, CTRL + X
to exit).
Now when you visit yourdomain.com
in your browser, it will point to the new Droplet for testing purposes.
To revert the change, simply remove the line or comment it out.
Once you’ve tested everything and it works, update your DNS records to point to the new Droplet’s IP. This makes your site live on the new server.
Let me know how it goes! 🚀
Feel free to share more details about your current project and the setup that you have and I will be happy to give you more details on how you could transfer everything over.
- Bobby
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.