Skip to content

Commit

Permalink
add docs regarding running a local DB from production/staging DB data (
Browse files Browse the repository at this point in the history
  • Loading branch information
OriHoch authored and amotenko committed Mar 4, 2018
1 parent 81bdd47 commit b7c0f0e
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions docs/development/database.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,25 @@ npm run seed
```

You can then login into the system with the user `[email protected]` and password `admin`.

### Running a local DB from production/staging DB data

This procedure requires you to have permissions to `midbarrn` project on google cloud. You will also need to install the [Google Cloud SDK](https://cloud.google.com/sdk/downloads)

Delete the existing environment and start a new fresh DB

```
docker-compose down -v; docker-compose up -d db
```

Get a url to existing DB backup, the URL should look like this -

`gs://midburn-k8s-backups/sparkdb-staging-dump-2018-03-02-00-00.sql`

Import the URL directly to the DB

```
! gsutil cat gs://midburn-k8s-backups/sparkdb-staging-dump-2018-03-02-00-00.sql | \
mysql --host=localhost --port=3306 --protocol=tcp --user=root --password=123456 \
&& echo failed to import data
```

0 comments on commit b7c0f0e

Please sign in to comment.