Get a datafile...
This is a new repo. My old repo (footy) was abandoned cuz data file was too big, and it often lead to a lot of unexpected errors.
Download and place the data files from google drive link https://drive.google.com/drive/folders/1x_R1GlTMJKeo9CTACmffRorAjfjSmxy8?usp=drive_link
and place it to ~/data/
there is a postgre database file in ~/football.dump (or footall.sql)
pg_dump -U your_username -h localhost your_db_name > your_dump_file.sql
OR
pg_dump -U your_username -h localhost -F c -f your_dump_file.dump your_db_nameReplace your_db_name to football
- Create a database
createdb -U your_username new_db_name
OR
CREATE DATABASE new_db_name;- Restore the dump file
psql -U your_username -d new_db_name -f your_dump_file.sql
OR
pg_restore -U your_username -d new_db_name your_dump_file.dump
If this doesnt work do
sudo -u postgres pg_dump -d football -f /tmp/football.sql
AND
sudo mv /tmp/football.sql .
And zip it
gzip > football.sql.gzUnzip
gunzip -c football.sql.gz | psql -U postgres -d footballMake sure to 🔒 Don’t Forget:
You may need to allow trust or password login in pg_hba.conf or use --password if needed.
Use the same PostgreSQL version or a compatible one on both machines to avoid restore errors.
# Drop the existing database
dropdb -U postgres football
# Create a fresh new database
createdb football
# Import your database.sql into this database
psql -U postgres football < database.sql
DATABASE_CONFIG = {
"dbname": "football",
"user": "postgres",
"password": "1234",
"host": "localhost",
"port": "5432",
}You have to create a user and database accordingly...