Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to backup/export & import Strapi data

So I am at the place where I lost all of my Strapi data after moving from local to remote host and deploying my Strapi through herokuapp.com

I am using Strapi in my personal NEXT.JS project.

Luckily my Strapi database wasn't so huge and all content-types were kept so I was able to recreate the database quite quick. Also this was just a personal project.

I am wondering though, if I decide to push Strapi to use in in more professional context and in real project – how do I move from local development to deployment without loosing all data?

Is there a way to export everything before deployment and then import it into the deployed CMS or how does this work?

Also – what if I want to do it the other way around? I will keep working on my app using my Strapi on Heroku but at some point I will want to replicate the CMS locally. Where is the data stored and how do it get access to it?

like image 545
Adam Schwarcz Avatar asked Nov 14 '22 21:11

Adam Schwarcz


1 Answers

From docs: "Strapi does not currently provide any tools for migrating or deploying your data changes between different environments (ie. from development to production). With the exception being the Content-Manager settings"

And there is no export/import content for now.

To export your data for example from the local environment to the production you have to handle:

  • content-types - Strapi store this stuff at files so version control will help
  • database data - you have to make database backup manually and then import data at the production server
  • static files - if you use Srapi to handle the static files you probably will have to copy them manually and import them to the production server or use version control for it (bad option). They are stored at app/public/uploads

I didn't tried this myself but it looks like a pretty tough task.

Conclusion: if it's OK for you to migrate only your content types, just put a git on your Strapi folder

like image 141
Eugene Avatar answered Dec 21 '22 07:12

Eugene