{"action":"created","issue":{"url":"https://api.github.com/repos/uoft-tapp/tapp/issues/148","repository_url":"https://api.github.com/repos/uoft-tapp/tapp","labels_url":"https://api.github.com/repos/uoft-tapp/tapp/issues/148/labels{/name}","comments_url":"https://api.github.com/repos/uoft-tapp/tapp/issues/148/comments","events_url":"https://api.github.com/repos/uoft-tapp/tapp/issues/148/events","html_url":"https://github.com/uoft-tapp/tapp/issues/148","id":249161784,"number":148,"title":"don't know how to restore from pg_dumpall of databases","user":{"login":"jmzaleski","id":9355220,"avatar_url":"https://avatars0.githubusercontent.com/u/9355220?v=4","gravatar_id":"","url":"https://api.github.com/users/jmzaleski","html_url":"https://github.com/jmzaleski","followers_url":"https://api.github.com/users/jmzaleski/followers","following_url":"https://api.github.com/users/jmzaleski/following{/other_user}","gists_url":"https://api.github.com/users/jmzaleski/gists{/gist_id}","starred_url":"https://api.github.com/users/jmzaleski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmzaleski/subscriptions","organizations_url":"https://api.github.com/users/jmzaleski/orgs","repos_url":"https://api.github.com/users/jmzaleski/repos","events_url":"https://api.github.com/users/jmzaleski/events{/privacy}","received_events_url":"https://api.github.com/users/jmzaleski/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"freeatnet","id":138289,"avatar_url":"https://avatars0.githubusercontent.com/u/138289?v=4","gravatar_id":"","url":"https://api.github.com/users/freeatnet","html_url":"https://github.com/freeatnet","followers_url":"https://api.github.com/users/freeatnet/followers","following_url":"https://api.github.com/users/freeatnet/following{/other_user}","gists_url":"https://api.github.com/users/freeatnet/gists{/gist_id}","starred_url":"https://api.github.com/users/freeatnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/freeatnet/subscriptions","organizations_url":"https://api.github.com/users/freeatnet/orgs","repos_url":"https://api.github.com/users/freeatnet/repos","events_url":"https://api.github.com/users/freeatnet/events{/privacy}","received_events_url":"https://api.github.com/users/freeatnet/received_events","type":"User","site_admin":false},"assignees":[{"login":"freeatnet","id":138289,"avatar_url":"https://avatars0.githubusercontent.com/u/138289?v=4","gravatar_id":"","url":"https://api.github.com/users/freeatnet","html_url":"https://github.com/freeatnet","followers_url":"https://api.github.com/users/freeatnet/followers","following_url":"https://api.github.com/users/freeatnet/following{/other_user}","gists_url":"https://api.github.com/users/freeatnet/gists{/gist_id}","starred_url":"https://api.github.com/users/freeatnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/freeatnet/subscriptions","organizations_url":"https://api.github.com/users/freeatnet/orgs","repos_url":"https://api.github.com/users/freeatnet/repos","events_url":"https://api.github.com/users/freeatnet/events{/privacy}","received_events_url":"https://api.github.com/users/freeatnet/received_events","type":"User","site_admin":false},{"login":"michellemtchai","id":22383586,"avatar_url":"https://avatars0.githubusercontent.com/u/22383586?v=4","gravatar_id":"","url":"https://api.github.com/users/michellemtchai","html_url":"https://github.com/michellemtchai","followers_url":"https://api.github.com/users/michellemtchai/followers","following_url":"https://api.github.com/users/michellemtchai/following{/other_user}","gists_url":"https://api.github.com/users/michellemtchai/gists{/gist_id}","starred_url":"https://api.github.com/users/michellemtchai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michellemtchai/subscriptions","organizations_url":"https://api.github.com/users/michellemtchai/orgs","repos_url":"https://api.github.com/users/michellemtchai/repos","events_url":"https://api.github.com/users/michellemtchai/events{/privacy}","received_events_url":"https://api.github.com/users/michellemtchai/received_events","type":"User","site_admin":false},{"login":"lloyd-uot-cs","id":30847073,"avatar_url":"https://avatars1.githubusercontent.com/u/30847073?v=4","gravatar_id":"","url":"https://api.github.com/users/lloyd-uot-cs","html_url":"https://github.com/lloyd-uot-cs","followers_url":"https://api.github.com/users/lloyd-uot-cs/followers","following_url":"https://api.github.com/users/lloyd-uot-cs/following{/other_user}","gists_url":"https://api.github.com/users/lloyd-uot-cs/gists{/gist_id}","starred_url":"https://api.github.com/users/lloyd-uot-cs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lloyd-uot-cs/subscriptions","organizations_url":"https://api.github.com/users/lloyd-uot-cs/orgs","repos_url":"https://api.github.com/users/lloyd-uot-cs/repos","events_url":"https://api.github.com/users/lloyd-uot-cs/events{/privacy}","received_events_url":"https://api.github.com/users/lloyd-uot-cs/received_events","type":"User","site_admin":false}],"milestone":null,"comments":5,"created_at":"2017-08-09T21:06:06Z","updated_at":"2017-08-10T14:22:43Z","closed_at":null,"body":"\r\n\r\nby way of coming up with a backup/restore recipe..\r\n\r\nWith a running system, execute:\r\n`docker exec -it tapp_postgres_1 psql -c -U postgress -f /tmp/pg_dumpall.sql\r\n`\r\nNow shut down system and blow away database (-v eliminates all volumes from all containers, which at the moment blows away the postgress volume)\r\n\r\n`docker-compose down -v\r\n`\r\nNow, fire up system again, with no database:\r\n`docker-compose up\r\n`\r\nCopy pg_dump into postgress container:\r\n`docker cp  /tmp/pg_dumpall.sql  tapp_postgres_1:/tmp\r\n`\r\nNow ssh into postgress container:\r\n`docker exec -it tapp_postgres_1 bash\r\n`\r\nsu to postgress user (i'm guessing at this point)\r\n# su - postgres\r\n\r\nand restore the db\r\n`psql < /tmp/pg_dumpall.sql\r\n`\r\nshut down everything (`docker-compose down` ###NO -v!!!\r\nstart up everything: `docker-compose up`\r\n\r\nwhen visit http://tapp.cs.toronto.edu/index.html now see on console:\r\n```\r\nrails-app_1  | Use Ctrl-C to stop\r\npostgres_1   | ERROR:  relation \"assignments\" does not exist at character 29\r\npostgres_1   | STATEMENT:  SELECT \"assignments\".* FROM \"assignments\"\r\npostgres_1   | ERROR:  relation \"applications\" does not exist at character 30\r\npostgres_1   | STATEMENT:  SELECT \"applications\".* FROM \"applications\"\r\npostgres_1   | ERROR:  relation \"positions\" does not exist at character 27\r\npostgres_1   | STATEMENT:  SELECT \"positions\".* FROM \"positions\"\r\npostgres_1   | ERROR:  relation \"applicants\" does not exist at character 28\r\npostgres_1   | STATEMENT:  SELECT \"applicants\".* FROM \"applicants\"\r\npostgres_1   | ERROR:  relation \"instructors\" does not exist at character 29\r\npostgres_1   | STATEMENT:  SELECT \"instructors\".* FROM \"instructors\"\r\n```\r\nwhat is wrong with this recipe??\r\n\r\nFinally, a link to the output of pg_dumpall. To my untrained eye it appears to have everything, including one assignment:\r\n\r\n```\r\nCOPY assignments (id, applicant_id, position_id, export_date, created_at, updated_at, hours) FROM stdin;\r\n1\t199\t1\t\\N\t2017-08-09 19:09:16.906444\t2017-08-09 19:09:16.906444\t14\r\n\\.\r\n```\r\n[pg_dumpall-aug9-1510-one-assignee.sql](https://u89646020.dl.dropboxusercontent.com/u/89646020/pg_dumpall-aug9-1510-one-assignee.sql)\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/uoft-tapp/tapp/issues/comments/321566157","html_url":"https://github.com/uoft-tapp/tapp/issues/148#issuecomment-321566157","issue_url":"https://api.github.com/repos/uoft-tapp/tapp/issues/148","id":321566157,"user":{"login":"reidka","id":420794,"avatar_url":"https://avatars1.githubusercontent.com/u/420794?v=4","gravatar_id":"","url":"https://api.github.com/users/reidka","html_url":"https://github.com/reidka","followers_url":"https://api.github.com/users/reidka/followers","following_url":"https://api.github.com/users/reidka/following{/other_user}","gists_url":"https://api.github.com/users/reidka/gists{/gist_id}","starred_url":"https://api.github.com/users/reidka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reidka/subscriptions","organizations_url":"https://api.github.com/users/reidka/orgs","repos_url":"https://api.github.com/users/reidka/repos","events_url":"https://api.github.com/users/reidka/events{/privacy}","received_events_url":"https://api.github.com/users/reidka/received_events","type":"User","site_admin":false},"created_at":"2017-08-10T14:22:43Z","updated_at":"2017-08-10T14:22:43Z","body":"@freeatnet I think the error you are seeing is more about stdin/stdout problems between docker and the host.  I don't see that sort of problem when I copy the file to the container.\r\n\r\nI thought I had it working before, but I'm now having trouble getting the database into the right state to accept the restore.  It needs to be created but not populated.\r\n"}}
{"actor":{"display_login":"reidka"}}