/
open_large_snapshot.txt
31 lines (18 loc) · 1.07 KB
/
open_large_snapshot.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
Determining cores:
Run this at your terminal to get the number of logical cores on your machine:
sysctl -n hw.ncpu
I had 4 cores in my machine. So I ended up claiming 2 for this process since I didn't want to redline my cpu. You can add the parameter `-j 2` to your restore command to claim the number of cores you desire.
-----
Restoring snapshot
1) Open terminal
2) Ensure the postgresapp command line tools are installed:
https://postgresapp.com/documentation/cli-tools.html
3) Change directory to you downloads folder.
(ie: cd /Users/abrahamhuie/Desktop/Downloads)
4) Create Schema (can also be done in pgadmin)
psql -U nbuild -d nbuild -h localhost -p 5432 -c 'CREATE SCHEMA nbuild_[slug];'
5) Restore Schema --- run the following command in your existing terminal window
pg_restore -U nbuild -d nbuild -h localhost -p 5432 -j 2 --schema nbuild_[slug] --verbose [backupfilename]
Make sure you're running restore on the directory that your backup is in for the above to work.
5) Let restore run. Mine took about an hour.
6) Visit schema as you normally would on pgadmin :)