Is there a way to restore a droplet from another droplet's snapshot (different disk sizes)?

Basically I have droplet A which hosts a wordpress site, and droplet B which was once upon a time a development server for droplet A, but which has fallen into disrepair. I’d like to start fresh and convert droplet B into a copy of droplet A, but when I create a snapshot of droplet A and try to select it from the restore menu of droplet B it doesn’t show up. I suspect this may be because droplet A has 8GB memory and 40GB disk, whereas droplet B has 1GB memory and 30GB disk, but enlighten me if I am wrong.

Is there a (free) way to accomplish what I am after?

Submit an answer

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!

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Hey friend,

Great question. I’m afraid there isn’t a way to deploy a snapshot onto a smaller (disk) droplet at this time. The partitioning is all part of the snapshot and we do not currently have any logic to override it.

With that said, copying Wordpress over isn’t actually that bad, so let’s think about doing the same (or equivalent result) thing just a different way. This is what I’d do:

First I’m going to make two assumptions:

  • Droplet A’s Wordpress database is named “wordpress”
  • Droplet A’s Wordpress installation exists in /var/www/html

So this is what I’m going to do then:

  1. Re-image Droplet B with our Wordpress one-click image.
  2. From Droplet B run: ssh-keygen and hit Enter until it stops prompting you.
  3. Copy /root/.ssh/ from Droplet B to Droplet A’s /root/.ssh/authorized_keys file. Can do this by hand, copy/paste contents.
  4. SSH into Droplet A and run: mysqldump wordpress > wordpress.sql
  5. SSH in to Droplet B, let it run the initialization script for Wordpress.
  6. From Droplet B, run: cd /var/www/html && rsync -avz root@Droplet_A_IP:/var/www/html/ .
  7. From Droplet B run: cd /root && rsync -avz root@Droplet_A_IP:/root/wordpress.sql . && mysql wordpress < wordpress.sql

Boom, done. Droplet B is running an exact copy of Wordpress from Droplet A.