Support Portal

Submit a ticket My Tickets
Welcome
Login

How do I convert a Strapi Cloud Backup to local usage

If you were provided a manual backup from your Strapi Cloud project and intend to use it on your local machine or are leaving Strapi Cloud you will need to run a few SQL commands to properly convert the media assets for use with the @strapi/provider-upload-local instead of the Strapi Cloud Upload provider.


Note that the Strapi Support team cannot provide you with assistance beyond what is located in this document including but not limited to:


  • Assistance with restoring the backup to a PostgreSQL server
  • Converting the export to another database type
  • Issues resulting from using this export
  • Converting to a different provider


The only things the Strapi support team can assist with are strictly the following:


  • Provide you with either the database export or the database + media assets export
  • Provide you with the handful of command to convert the contents of the file table and replacing the Strapi Cloud URLs to the correct local format for the url and format columns


Anything beyond this is considered out of scope.



Special Note


All instance of "your-app" in the context of these commands refer to your Strapi Cloud Debug name, NOT your user defined name of your project.



Command to convert the "url" column values from Strapi Cloud to @strapi/provider-upload-local


update files set url = replace (url, 'https://your-app.media.strapiapp.com', '/uploads') where url is not null;


Command to convert the "formats" column values from Strapi Cloud to @strapi/provider-upload-local


update files set formats = replace (formats::TEXT, 'https://your-app.media.strapiapp.com', '/uploads')::jsonb where formats is not null;


Command to convert the "provider" column values from Strapi Cloud to @strapi/provider-upload-local


update files set provider = replace (provider, 'strapi-provider-upload-strapi-cloud', 'local') where provider is not null;
D
Derrick is the author of this solution article.

Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.