All right, importing your databases on a Mac where we left off previously is you've initiated your
postcrisis environment, you have the Posterous app, you have everything set up, but you don't have
our Swiss Re databases yet that we're going to do all of the exercises on.
So let's get into getting that set up for you.
So if we go over here, the main command that we will be using is equal.
And there is a command called equal minus U minus H.
So this is referring to the host and this is referring to the user.
And we're seeing for user PostgreSQL on the localhost instance.
Put in a backup, but we don't have a full backup, so we want to target certain databases now to target
certain databases, we need to create those databases.
So let's go into Vallentine of DB, first of all.
So let's open Vallentine a studio and let's connect to our local instance.
And as we can see here, we don't have any databases available.
So let's create a database and let's call it employees and then let's create a database and let's call
it world.
So we're going to create all our databases up front so that they're just ready to go for us.
And then let's go in and let's create a database called Store.
And then let's go in and let's create a database called France, all our databases are ready to roll.
Now all we have to do is get the backups.
And so as part of the documents that you should get with the course, you'll get a databases zip file
that will contain all of the scripts that you need to run.
So over here, you see the employee and then you see France store and world.
All right, so let's start by going to employee and first of all, we need to find it.
So right now we are in the core of our map.
And so this is command line.
This is terminal.
If you opened up the terminal over here, this is what you would get, so we want to open up our terminal,
which is just us talking with text to our computer, and we're going to get familiar with some of the
commands that we need to run.
So once you're familiar with opening up terminal.
Then what you want to do is you're going to be at the root of your system, so as you can see here,
you can see all of the folders that your system has.
So let's go into documents, because that's where I put it.
And over here, you could see that my folder was called Database's, so in my documents I should have
a folder called databases and over here you can see databases.
So let's go into databases.
And in there you can see the employee folder as well as France store and world.
So what do we want to do here?
Well, we want to run the actual command with minus you, Posterous.
And if I don't specify the host, that's just because it's automatically going to point to the local
host instance would put five, four, three, two.
So let me first go inside of the employees folder.
And then let me run the command so you will minus you, PostgreSQL, and then what we're going to do
here is we're going to target the database employees and we're going to say run the employee Esquibel.
And boom, it just started importing and because you are the user on the system, it won't ask you for
a password because you're already logged in.
So let this run for a while.
This is our biggest database.
It may have to run for quite a bit before it imports everything.
Don't be scared.
It could take up to five minutes.
It depends on the speed of your system, to be honest.
And so just remember, throughout the course, we're going to get more and more savvy with the command
line as we go along.
It's imperative for us to learn some commands here and there, get comfortable.
Now, you may think like, what is this command line thing?
Well, to be fair, like when you see the Matrix and you see all of the crazy numbers and stuff going
across the screen, that's what we're doing here right now.
And the reasoning for that is usually when you do school, you don't need to be as involved in importing
databases, backing up databases.
But we want to give you some insight into how it goes.
And the reasoning for this is because, sure, DB fiddle is great, but it can't handle big databases
and we want you to be able to handle big databases.
So we're giving you the tools in the set up here to be able to go and test on real data sets.
And so this is why we're doing this right now.
All right.
So once that's done, backing up and remember, you have to run it from the employee folder because
it's going to reference all of these other scripts, like lowed, departments, load department employee.
So make sure you run it from the folder itself.
And so once we're done with the employee database, what we want to do is we want to target a different
database, for instance, world, and we want to do the world that will.
And so now they're going to start going faster and once we're done with world, we want to do store.
So let's do store on Esquibel.
And then once we're done with that, all we need now is France, and so let's do France school.
And there you go.
Not all backup's take as long as the employee database.
It's just because we have so many records in there.
So if we go into Vallentine, a studio now, what you're going to see here is when you refresh inside
of France, you're going to see departments, regions and towns inside of employees.
You're going to see departments, department managers, employees salaries, titles and inside of store,
you're going to see customers and a history and order lines inside of world.
You're going to see all kinds of data.
And just remember, it doesn't matter what version of you all you're running, whether at 10 or above
everything is would be fine, whether you're running version 13, 14 or 15.
Just keep in mind that when you're recovering the databases, you start out the database folder like
we did.
And when you were starting the employee database, make sure that you changed directories.
CD stands for change directories directly into the employee folder because that will help you recover
the data from the employee because it references multiple Esquibel scripts.
Now that that is all said and done, you have all of your databases, your environment is fully set
up, and if we went into the postgresql, you can see you have all of these databases available now.
So you're ready to rock and roll and get it kick started.