#switching from postgres to mongodb issues

17 messages · Page 1 of 1 (latest)

crystal horizonBOT
visual salmon
grizzled star
#

Have you installed @payloadcms/db-mongodb?

visual salmon
#

by running npm install ....

#

what is strange to me is that i started it first with postgres, went to the admin page and made my first user, but then i decided to switch to mongodb and what i thought would be as simple as switching the config in the payload config and adding the mongo_url is not the case

#

or i am missing something (probably)

#

i use the following as well:

  • ddev
  • docker
#

that is my .env file

#

and i use mongo local instead of with atlas or cloud

#

i know the mongo works as i can go to the mongo admin page

#

by running ddev mongo-express

#

so i reckon i just need to point payload to the correct db, but have no clue how to do this

#

i might have found something:

You can use a variety of different database types, including MariaDB (5.5–10.8), MySQL (5.5–8.0), and PostgreSQL (9–17). If you want to change database type, you need to export your database, run ddev delete to remove the project (and its existing database), change to a new database type, run ddev start again, and import your data.

DDEV creates a default database named db and default permissions for the db user with password db, and it’s on the (inside Docker) hostname db.
visual salmon
#

nope didn't work, still can't reach the admin page

#

the switching database by deleting the old one seems to work fine as mongo-express is still reachable but i still cannot seem to reach the admin page to create my first user

#

also an error in the payload config still: