Can't migrate my local postgree db on strapi
facufaia
TRIALOP

a year ago

I developed my strapi ecommerce on strapi (locally) and inserted many data, have it deployed and connected to an instance of postgres but I don't know where I can use the command:
"npm run strapi import -- -f" In order to get the migration, exported data is already on the github repo.
I also developed this config as code with claude 3.5 sonnet on copilot but didn't work:

[build]
builder = "nixpacks"
buildCommand = "npm run build"

[deploy]
startCommand = "npm run start"
healthcheckPath = "/"
healthcheckTimeout = 100
restartPolicyType = "on-failure"

[phases]
setup = { cmds = ["npm run strapi import -- -f export_postgres.tar.gz.enc"] }
build = { dependsOn = ["setup"] }
deploy = { dependsOn = ["build"] }

I read an older post that sent to an inexistence guide to re-migrate.

Anyone have been through this problem?
The unique thing that I don't try yet is to use a docker container an import the data before the deployment.

View Deploy details

ⓘ Deployment information is only viewable by project members and Railway employees.

3 Replies

a year ago

Hello,

May I ask the file size of that .enc file?


facufaia
TRIALOP

a year ago

Hello brody, it's 832kb. I also read about Railway Local Shellhttps://railway.com/changelog/2022-04-22 so I'm gonna try to do something like this on my project today, hope it work slightly_smiling_face emojislightly_smiling_face emoji

# Login and connect
railway login
railway link

# Upload and import
railway up export_postgres.tar.gz.enc
railway connect
railway run npm run strapi import -- -f export_postgres.tar.gz.enc

a year ago

Yeah that was gonna be my next recommendation, since its so small just import it from a command running locally.

If you get errors about the internal address, make sure you use the public host and port of the database to run this import, and then make sure your app uses the internal network to connect to the database once running on Railway.


Loading...