-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add docs regarding running a local DB from production/staging DB data (…
- Loading branch information
Showing
1 changed file
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
``` |