By theindiman
I want to host two websites in a single droplet. I currently have two droplets through the wordpress installation by digitalocean set up already. I now want shut one droplet down, but move the contents of that droplet, so that it’s sharing a single droplet with the other.
I have read on how to set up new virtual hosts using Apache here: https://www.digitalocean.com/community/tutorials/how-to-set-up-apache-virtual-hosts-on-ubuntu-18-04
However, I have been unable to find resources that are about my case of moving the contents within an already setup droplet into another droplet. How do I move the files around?
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!
Hi there @theindiman,
There are two ways of migrating your website:
What you could do in this case is to use rsync to copy the files from the Droplet that you will be shutting down to the one that you would want to keep.
To get started, you have to set up SSH keys between the original and new Droplets. You can also follow a more comprehensive migration process:
https://www.digitalocean.com/docs/droplets/resources/downsize/
Here is a summary of what needs to happen:
SSH to your new Droplet
Use rsync to transfer the files from the old Droplet to the new one, the command will look like this:
- rsync -avz --progress 111.222.333.444:/var/www/site1 /var/www/
mysqldump command to do so:mysqldump -u database_user -p database_name > database_name.sql
And then again using the rsync command copy only the .sql file to your new Droplet.
.sql dump file on the new server, create a new MySQL database and username, and import the .sql file:- mysql -u database_user -p database_name < database_name.sql
As another option you could use a plugin like the Duplicator – WordPress Migration Plugin, this will allow you to generate a full backup of your website files and database. Then you will need to install a fresh new WordPress copy on the new Droplet and run the import script.
Hope that this helps! Regards, 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.