Skip to content

SnowHana/toelo

Repository files navigation

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.


Data and DB

Data set

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/

DB

Creating a dump / sql file

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_name

Replace your_db_name to football

Create a database based on above file

  1. Create a database
createdb -U your_username new_db_name

OR

CREATE DATABASE new_db_name;
  1. 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.gz

Unzip

gunzip -c football.sql.gz | psql -U postgres -d football

Make 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.

Setting up postgresql

# 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...

About

Football individual player's ELO analyse

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors