By shivansh02
I exported data from my strapi app hosted on DigitalOcean App platform to a .tar. how do I download it to my local system?
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!
As the DigitalOcean App Platform does not offer SSH access, you can use alternative methods such as using the Strapi admin panel, creating a temporary download link, or using an API endpoint.
Strapi Admin Panel (if your file is accessible there):
Creating a Temporary Download Link:
curl to download the .tar file.Using an API Endpoint:
curl or any HTTP client to make a request to this endpoint and download the file.For steps 2 and 3, here’s a basic example of how you might set up a route in Strapi to serve a static file (assuming you’re using Strapi v4):
// In your Strapi controller or a custom route handler
module.exports = {
async download(ctx) {
const file = 'path/to/your/file.tar'; // Path to your .tar file
ctx.body = fs.createReadStream(file);
ctx.set('Content-disposition', 'attachment; filename=file.tar');
ctx.set('Content-Type', 'application/x-tar');
}
};
But in general, you should not really store any important files on the local App Platform storage as it is ephemeral, meaning that all of the information on the local storage gets lost after a deployment.
For permanent storage, you should either store your data in a database on an S3 storage like the DigitalOcean Spaces.
Best,
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.