In the previous video we installed PI data archive on PISRV01 and PI AF server and PI
analysis service on PISRV02. So we see our current configuration on the screen now so in this video
we're going to start on our post install tasks. So first off we're going to look at backups
so first up the PI data archive has archives on it all of these archives store the time series data
coming from sensors. So I don't think I need to lecture you about how important it is to backup
these files but this is all of the data coming from all of the sensors in your plant if it's lost
really the golden rule of being an administrator you don't lose data you've lost data.
So backing these up is incredibly important and the PI data archive has quite a few
configuration files in there so not only backing up the archives is important but
also the PI data archives configuration. So how we do this is we set up a scheduled task here.
So we set up a task to execute at 3.15 a.m. by default it can be changed
and what this scheduled task does is it performs an incremental backup of all the
important files on that data archive. So every archive file that has changed
anything containing any of the time series data coming from our sensors that's changed and
all of the configuration that's changed since the last backup. What it does is we
choose a folder to backup to. So this is just a folder on the machine so it'll be PI backup.
In this PI backup folder it will copy out all of these configuration files
and all of the archives after it's run the first time it'll run again at 3 15 a.m. tomorrow
any files that are changed so say we change this one and maybe we've added another archive file
since then more data has come in from sensors it will copy those files over. So the file that
changed it'll change that one it'll copy over the new archive. So this is all well and good
but you're probably thinking right now this isn't really a backup this is just a file
on the same machine as the PI data archive and you're right it's not a backup well not yet.
So the next step would be to move this off to somewhere else
so usually we'd have a SAN or a NAS network share
we have a SAN and then we'd move the PI backup folder we'll make a copy of the PI backup folder
over here. So we could do that you can do that with a script of your choosing you can
do that in any way you want but that is a really important step because it's
not a backup until it's actually moved off the machine. Now the script that we run at 3.15 a.m.
you can add in another line here we call it a PI site backup. So the extra file copy afterwards
but you can also use other software to do that if you want to.
Now with the current state of cyber security in the world a lot of the time this isn't
everything that needs to happen as well because the machine still has access to this backup folder
and if there's any malicious software on this machine if your network is targeted somehow
then everything's still online. Usually the very last step that really needs to happen
especially nowadays is moving this data off onto a tape, onto some kind of offline media.
We're on PISRV01 here and we're going to start by looking at what backups have been made already.
So go to the bottom left hand corner and click on start and then up to PI System management tools
so it should be in the recently added if it's not there you'll find out under the letter p.
The servers we can connect to is right up here PISRV01
let's check that server. So now we're going to navigate down through operation and into backups.
Here we go, now we're going to implement that backup script that we were talking about before.
So click on command prompt. We're going to go to the drive where we've installed
PI so that is d drive, d colon now we need to navigate to the PI directory
the easiest way to navigate there is to use cd and then a little shorthand percent PI server
percent. So that navigates us into our installation directory
for PI. If you're interested the folders we have in here there's a bunch of them adm,
bin, dat, log, setup we're going to go into a few of these throughout the class but right
now we're going to go into the adm folder. Adm folder contains administrative tools so cd adm.
Now we're going to run our backup script in install mode so PI backup and then give it a
target so a target folder we'd like to back up to in our case I'm just going to back it up to
e-drive PI backup. With the install flag set, this will create a windows scheduled task
at 3.15 a.m. to do an incremental backup into the e drive PI backup folder.
Let's do that. Okay success! Let's take a look, so go back down to the start menu again
and let's take a look at scheduled tasks. So I'm just going to start typing schedule
and tasks scheduler comes up so let's navigate into there.
Once it's open we can click on task scheduler library and we see we have
PI server backup 3.15 a.m. every day. We can change this if we want we can go in and go to
the properties of this and change the time if we wanted to 3.15 is pretty good for us though.
So if we go up to our system management tools we've still got no backups. It's
because we haven't actually run this yet we've just created the task to do, so
let's just right click and run it now. So its status is changed to running,
so while that's running let's take a look at e-drive PI backup.
So I've opened up windows file explorer here going into e-drive, PI backup is there now
and looks like we've got some folders already created in there.
So these weren't here before this is all being done by our script
now we can watch these files change over the next few minutes while the backup happens and it looks
like we've finished that pre-commit folder is gone and we only have a single log file here.
So inside our backup folder we've got an adm, arc, dat and log so
it's copied over all of the configurable files from our PI installation directory and also
all of the archives since the last time it was backed up. So in archive we've got one
archive with an annotation file we're going to take a closer look at that in future videos.
So we're pretty happy with this, let's go back to system administration tools
and refresh. So it looks like we've done an incremental backup right now
and it's successful. There's one very last thing we need to discuss about backup
which is asset framework server backup. So down in the bottom right hand corner here
we have asset framework server and it uses Microsoft SQL server as a back end. So we've got
a SQL server database here it's called PIFD. This PIFD database needs to be backed up copied off
at a frequency of your choosing.
In this video we discussed PI backups
and really the first thing you should do after installing a PI data archive set up this local
copy backup and decide what strategy you're going to use to copy this local copy off.