Does Strapi delete tables when I install it with a database that already contains other data?

Hello everyone,

Yesterday we installed Strapi and connected it to our Supabase database. Now, all other data in the Supabase database is gone. Can anyone confirm whether Strapi always deletes the entire database to create its own tables? Or does Strapi handle existing tables differently? I think this should be documented somewhere in the installation scripts, specifying whether existing tables are deleted or ignored.

Thank you and best regards.

This topic has been created from a Discord post (1256203296901955596) to give it more visibility.
It will be on Read-Only mode here.
Join the conversation on Discord

Must admit I would also like to know that answer. If we are using database providers like planetscale, use Strapi and a custom website we basically need two databases ?

Strapi does not handle existing tables

It would just delete them

If you need extra tables use separate database

Yes. Strapi is the data schema related app and it recreates tables up to schema’s changes. So if you have smth in your db - it will be rewritten. And yes, i would like this would be to mentioned somewhere in the docs

To be fair, this is already mentioned in the docs, on the top of the “database configuration” page:

Strapi applications are not meant to be connected to a pre-existing database […] Attempting to connect to an unsupported database may, and most likely will, result in lost data.

It looks like a clear warning in the right spot?

Yes, fair. There said “what” but didn’t explain “why” )