All right, so setting up your environment now, we're getting ready to import our databases into our
Posterous server, and as we just saw, we installed the postcrisis server on Windows.
And so now we have to import all of these databases.
And so how are we going to do that?
Well, we're going to be loading a backup.
All right, so let's get into that, it's simpler than it sounds, so if we go over here into our Vallentine
DB, what we can see here is that we have a server already connected.
But let's just say this wasn't here, let's delete this.
Well, what we would do is we would go to add a bookmark and if we go to PostgreSQL, what we can see
here is, oh, it's defaulting itself to localhost.
It's defaulting the data to postcrisis and the user to PostgreSQL, and it's defaulting the port to
the port that we set it to.
So all we need to fill in is the password, which was route and free press.
OK, well, we can see here is we're connecting to our database that we just installed, but there are
no databases in here.
So let's start by loading one back up.
Let's create a database called Employees.
And now we have a database employees, but it has no tables, it has no data, and so if you remember
when we did our installation, we had all of these files in the PostgreSQL bin folder and there was
this one file called up.
Well, let's take this path.
And let's open our command line.
So if we open our command line, this command line is basically our way to talk to Windows through text,
through commands.
Now oftentimes you'll remember this from The Matrix.
It's a black screen and a bunch of text and you see everything happening.
Well, this is kind of the same thing.
And so what we want to do is we want to do the command code, which is change directory, and we want
to go to the directory that we just copied.
And if we do that now, we can run well and it's going to ask the password for Mo.
But Mo wasn't a user of the database, was he?
Well, let's fill in root and see what happens.
Oh, we get an error, cannot connect the server password authentication field for user mode.
But what wasn't our user?
So how do we add a user?
Well, if we do Dasch, you and we do PostgreSQL, because that was our user.
Now we can say route.
Oh, something's changed, we entered the PostgreSQL server.
Now, in here, you can do things like look at the databases and if you fill in hell, you can see that
we have the employees database.
So we wanted to restore a backup, but we don't have to be in here to restore a backup because our backup
files are somewhere else.
So let's argue and that'll make us exit.
Now, there are a bunch of database scripts that we've added for you to be able to use France world
store employee, and so in order to run the employee script, we want to go to the employee folder.
So let's go there.
Let's change directory again.
OK, so now that we're in this directory, we can't run the actual command the way we did because it's
not known.
So how are we going to do that?
Well.
If we go back to our computer and we go back to the C Drive program files and we go back to PostgreSQL
12.
Ben, and we go down to the bottom, what we can see over here is that you can drag Pascual into here
and it will reference the path.
And here we go, it's working again, it's asking the password for MO, which we don't want.
We wanted it for Posterous.
So we're going to run it for PostgreSQL and we are going to target the database employees.
And what we want to do is we want to run the file.
Employees, so if we do employees.
Thought Eskew will, what you'll see happen here is a backup will be restored to the database.
Excuse me, it's actually Vashti.
And then it will ask for the password route, so just note that these are case sensitive, uppercase
and lowercase d mean very different things.
This is targeting a database.
So we filled in root.
And if we execute now.
What you'll see is it's creating tables and it's inserting data and we just got to let it insert data
for a while.
And that will allow us to have a database that has all of the records that it needs to run queries against.
And we'll be doing this for another three database's.
Group starts hanging, which I can just press control C to kick start it, to continue it.
As this may happen and so once it's done running, what we can see here is that we have data available
in our public now.
We have departments, we have department managers, we have employees.
So let's go into employees.
And what we can see here is that we have a ton of employees.
And so now we just restored a backup for our employee database.
Now let's do the same for the world database.
So let's create a database called World.
And as you can see here, no data.
And so over here in our folder, if we go back one, we can see that we have a world file, so let's
go and let's do data, which will go one directory up to scripts and let's run the same command we did.
But let's target world now.
So let's target the database world and let's say world thought skua.
And let's fill in route.
And there we go, database imported, so the employees database is one of the biggest ones, and that's
why it can hang because it's inserting so many records.
So if it hangs, just press control and will kick started again, otherwise cancelled the script, rerun
it and it should continue on until it finishes.
It will just say that data has already been inserted.
And so with the world database now we can see that we have tables, city, country, country, language.
If you don't see them immediately, just press this little refresh icon.
Let's create another database and let's call it France.
And here we go, here's France again, no data, no tables, and if we go inside our folder here, what
we can see is that we have a France file, so let's run the same exact script.
But let's target France and let's say France, Fortescue, and then let's fill in route again and there
we go, everything's inserted.
So if we go inside France now, oh, nothing's there yet.
Press the refresh icon.
We have departments, regions and towns.
And so now for our final database, let's add a database called Store.
And again, nothing in here, but if you go look at our files, we have a store file, so let's go here
and let's run this in command.
And by pressing the up key, you can do the exact same thing.
Store and let's target store a school.
It's press root and there we go.
Everything's inserted.
So if we go into a store, you can see that these queries ran much, much faster than employees.
Employees takes a little while because it has so much data.
You can kick started if it starts hanging in a certain point by just pressing control.
See if you press control, see twice you may exit the script.
If you press it once, it may kick start it.
There's just some lag there.
So if we go inside a store, you'll see here we don't see any of the tables.
If we refresh now, we have customers, inventories, products.
So let's go inside customers.
And here we can see we have a bunch of customers.
What a bunch of information, so awesome, we set up our environment and the exact same thing can be
done on the 32 bit with PostgreSQL.
There is no difference.
It will work just the same.
It will work just fine.
And so now that you're all set up and you have all of this ready to go, you are ready to kick start
your school journey with more in-depth data.