Migrate from v3 to v4 - database content gets deleted

System Information
  • Strapi Version: 3.6.8
  • Operating System: Ubuntu 18.04.5 on Azure
  • Database: MariaDB
  • Node Version: 16.3.2
  • NPM Version: 8.1.2
  • Yarn Version:


i’m trying to migrate my v3 to v4 and am struggling.

What I did:

  • cleared .cache/, node_modules, .package-json.lock and yarn .lock
  • changed strapi dependencies to new dependencies with namespaces
  • changed the database connection
    module.exports = () => ({
    connection: {
    client: ‘mysql’,
    connector: ‘bookshelf’,
    server: SERVER,
    port: PORT
    database: DATABASE_NAME,
    password: DATABASE_PASSWORD,
  • ran npm install → no problem
  • ran npm run build → no problem
  • ran npm run dev → strapi fires up and deletes my database! Login is not possible due to missing private keys.

Any ideas anybody? Thanks a lot in advance.

That would then be because it’s not migrated. It creates an empty database for v4. Which the structure etc is also different.

There is currently as of time of writing any guides on migrating data only plugins.

1 Like

I see. But getting the data to the new structure would fix it?

You would still need to transfer the data. Having 2 separate databases and transfer data could be an option. Or wait until the official documentation comes out.

then i will wait for a documentation…