Update documentation on importing a database

This commit is contained in:
Ramon Wenger 2023-08-30 14:49:56 +02:00
parent 3fdebdc977
commit b26a603e2f
1 changed files with 15 additions and 1 deletions

View File

@ -1,4 +1,18 @@
Download latest backup from Heroku
```
heroku pg:backups:download --app appname
```
Load backup locally
```
# assumes your POSTGRES env variables are set correctly
./bin/restore-database.sh -f <dumpfile> -d <database>
```
Remove all users that are not admin users, also their created contents Remove all users that are not admin users, also their created contents
``` ```
Objective.objects.exclude(owner=None).delete() Objective.objects.exclude(owner=None).delete()
Comment.objects.all().delete() Comment.objects.all().delete()
@ -22,7 +36,7 @@ aws s3 cp local.dump s3://skillbox-developer-bucket/
Get a presigned url from S3 for the dump (supposedly works from the command line, I had to use the S3 web UI) Get a presigned url from S3 for the dump (supposedly works from the command line, I had to use the S3 web UI)
``` ```
aws s3 presign s3://bucket-name/dump.name aws s3 presign s3://skillbox-developer-bucket/local.dump
``` ```
Load backup in heroku Load backup in heroku