Question

Moving a project from Droplet to Apps (with existing db and uploaded image files)

Posted May 20, 2021 86 views
Ruby on RailsPostgreSQLRubyDigitalOcean 1-Click Apps MarketplaceDigitalOcean DropletsGitHub Actions

Hi, I have a RubyonRails website running on Droplet for a few years now. I have a vast poster db and image files. It is deployed from Github via mina deploy.

I’m not very technical person when it comes to server setups but coding and design. My friend set the droplet for me, now I can’t access him. I can’t deploy my code updates as I get various errors.

I like the simplicity of Apps, I released 1 small website using that. Now I’m thinking to migrate my existing projects from Droplet to Apps, so I can manage myself.

I can deploy latest codes from Github as fresh project, but how can I transfer database and thousands of image files? Is there any guide or service?

Thank you stay safe

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.

×
Submit an Answer
1 answer

Hi there,

Regarding your database, you would need to do the following:

  • First create a new Managed Database Cluster:

https://docs.digitalocean.com/products/databases/postgresql/how-to/create/

  • Then once you have the new cluster in place, you can follow the steps here on how to export your existing database from your Droplet and then import it to the new Managed Cluster:

https://docs.digitalocean.com/products/databases/postgresql/how-to/import-databases/

  • Regarding your images, if they are currently stored on your Droplet directly, what I could suggest is setting up DigitalOcean Spaces and copying your images over.

The Spaces would be required as you would need persistent storage with the App platform.

To setup Spaces by following the steps here:

https://docs.digitalocean.com/products/spaces/how-to/create/

Once you have the object storage ready, you could copy your images directory from your Droplet to the object storage with the s3cmd command-line tool as explain here:

https://docs.digitalocean.com/products/spaces/resources/s3cmd-usage/

Then once you have your database cluster and Spaces ready, you could proceed with the deployment to the App platform.

Hope that this helps.
Regards,
Bobby