#✅ directus 9 backup - reinstall

41 messages · Page 1 of 1 (latest)

golden kiln
#

"dependencies": {
"directus": "^9.20.3",
"pg": "^8.8.0"
}

I installed directus with Postgresapp.com on macOS last year and everything was working great, I have over 700MB of files in the /upload folder and I took a backup of everything including the postgress folders.

However now that I’m coming back to the project I wish I documented how to restore because I can’t remember. When I type npx directus start it asks to install v10. I would like to get it running again with my Postgres database, perhaps test everything on v9, and then upgrade from there.

Would anyone know how to do that? Any help is greatly appreciated.

low raftBOT
#

Thanks for posting! This is a community powered server, so you may or may not get an answer based on available help and expertise. To increase your chances of somebody being able to help you, please help us help you making sure you:

  • Adding an explanation of exactly what you're trying to achieve.
  • Adding any and all related code or previous attempts.
  • Describing the exact issue or error you are facing.
  • Posting any screenshots if applicable.
  • Reading through https://stackoverflow.com/help/how-to-ask.

When you're done with this thread, please close it. Thanks! ✨

(If you have a support agreement and need help, please contact the core team via email.)

quiet copper
#

Run npm init -y

#

Add the directus package, with a lock on the version you want to the package json

#

Run npm i

#

And you should be set

#

(Dont forget the db driver)

golden kiln
quiet copper
golden kiln
# quiet copper for what?

Well, I ran the commands described above but when I try to use “npx directus start” nothing happens

quiet copper
#

Try init first

#

That way you have an env

#

and then it should run with start

golden kiln
#

However, when I try npx directus start I just get the following:

#

0 verbose cli /usr/local/bin/node /usr/local/lib/node_modules/npm/bin/npm-cli.js 1 info using [email protected] 2 info using [email protected] 3 timing npm:load:whichnode Completed in 0ms 4 timing config:load:defaults Completed in 1ms 5 timing config:load:file:/usr/local/lib/node_modules/npm/npmrc Completed in 0ms 6 timing config:load:builtin Completed in 0ms 7 timing config:load:cli Completed in 1ms 8 timing config:load:env Completed in 0ms 9 timing config:load:file:/Users/macOS/Sites/vref/.npmrc Completed in 0ms 10 timing config:load:project Completed in 1ms 11 timing config:load:file:/Users/macOS/.npmrc Completed in 0ms 12 timing config:load:user Completed in 0ms 13 timing config:load:file:/usr/local/etc/npmrc Completed in 0ms 14 timing config:load:global Completed in 0ms 15 timing config:load:setEnvs Completed in 0ms 16 timing config:load Completed in 5ms 17 timing npm:load:configload Completed in 5ms 18 timing npm:load:mkdirpcache Completed in 0ms 19 timing npm:load:mkdirplogs Completed in 0ms 20 verbose title npm exec directus start 21 verbose argv "exec" "--" "directus" "start" 22 timing npm:load:setTitle Completed in 13ms 23 timing config:load:flatten Completed in 2ms 24 timing npm:load:display Completed in 2ms 25 verbose logfile logs-max:10 dir:/Users/macOS/.npm/_logs/2023-05-15T20_31_23_876Z- 26 verbose logfile /Users/macOS/.npm/_logs/2023-05-15T20_31_23_876Z-debug-0.log 27 timing npm:load:logFile Completed in 7ms 28 timing npm:load:timers Completed in 0ms 29 timing npm:load:configScope Completed in 0ms 30 timing npm:load Completed in 29ms 31 silly logfile start cleaning logs, removing 1 files 32 silly logfile done cleaning log files 33 timing command:exec Completed in 1478ms 34 verbose exit 1 35 timing npm Completed in 1640ms 36 verbose code 1

#

as per /Users/macOS/.npm/_logs

quiet copper
#

Can you add a script to the package json?
"start":"directus start"

#

And see if npm start works after that?

golden kiln
quiet copper
#

not sure what could cause this 😅

golden kiln
#

i'm gonna try a fresh install in another folder, using the same version of directus "npm i [email protected]"

#

I think it's something to do with postgres

#

I'm able to install with sqlite

#

but my data is now in a "data.db" file

#

I don't think I can import my postgresql data into sqlite, can I?

#

this is the backup I took, using postgres.app as the macOS application to run postgres

golden kiln
#

ya

quiet copper
#

but Directus should throw an error when it cant connect to the DB

golden kiln
#

hmmmm

quiet copper
#

(you did add the pg package, did you?)

golden kiln
#

i believe so, it's already in the package.json so it should get installed with npm i

#

I think now the issue is just getting my postgres data

#

I think I will try to make a Docker container after this, to avoid problems in the future

#

I tested my setup before, on a new Directus install, and it was working fine

#

but that was back in November 2022, and I think something must have changed

low raftBOT
#

✅ directus 9 backup - reinstall