How to import database into postgreSQL via Valentina through CMD.
Published: 2022-05-26 17:53:19

Hello guys! I would be explaining step by step process of the above subject in 2 different pathways. 

PATHWAY 1

for your information (FYI): my database is saved inside my downloads folder. Anywhere you see "cd", it means change directory

1) open the database to view the folder and files to see the tables we are want to import.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q00wuk755bxjisb0t6ls.png)

2) load the command prompt. type "cd downloads" and press enter. type "cd databases" then press enter and type "cd employees" and press enter key, to have as seen below.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6o5pjdf1mj7essg3wxbc.png)

3) locate the file address by going to through "local disc" then "program files" then "postgreSQL" then "14" then "bin". and copy the address.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/owzly07alt0pfkurnni3.png)

4) paste the address on your command prompt and include "\psql.exe" and enclose all in a quote as shown below. then specify the user by typing "-U postgres" 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dvfg4kotvg1meon2mha9.png)

6) go to valentina and create the specific database you want 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/znmk4yy5ik3sebbnan3b.png)

7) go back to the command prompt and type your database created (-d Employees) . then space and type the database you want to import (< employees)

FYI: It is case sensitive.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cdhslf241af213cj7wex.png)

8) press enter. then input your password and press enter to import your database.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vhdzj6o3zmrv15teczj1.png)

9) To import another database e.g store, go back to previous directory by typing (cd..) without spacing.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4pcreycto6mssl3r58fq.png)

10) go to valentina to create the database "store"


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v30y6or38yt2mqkjutn4.png)

11) go back to command line and copy the address path. paste it and edit the places with "Employees" and "employees"as "store"and "store". press enter and input your password. press enter again to import the databases.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bdsh4zvpfh1k4yhxiwia.png)

12) the command says error because I created "stores" on valentina but I typed "store" on the command prompt.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2wws0c5v2npxwmph31qe.png)

fYI: YOU CAN REPEAT STEP 10 TO 12 TO CREATE THE OTHER 2 DATABASES NAMELY ; FRANCE AND WORLD.

PATHWAY 2; 

Instead of going through step (2) above, go to downloads then to databases then to employee and copy the address path. go to command prompt and typed "cd then paste what you copied". 


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5tx9uh4naysgmlmcd021.png)

then follow step (3) to step (12)