I want my data to be stored in 2 years. How can I change this? Where can I see how long time the data is being stored now or how much capacity I have?
There are two factors here - deleting of the archive files and unregistering the archive files. When archives have been made available to PI they are "registered" (via PISMT or cmd line). While they are registered, data is available to users and the file is locked. So moves or file delete are not possible.
So to delete a PI archive one would first unregister and then delete it via normal windows command. This could done via bat script:
drive :\bin\piartool -au path
But could I suggest another approach? If you are certain you only want to keep a specified amount of time, you could let the system handle "overwrite" of archives. Recent versions of PI server are set with "auto archive" creation. What happens here is new archive files are created when the current one is filled. This process continues until disk space is low.
see here for an explanation
OSIsoft: Automatic archive creation. v3.4.375 - YouTube
However, if you do not have auto archiving turned on, PI will use the set number of archives you have registered. Once all are full, a "shift" happens, meaning the oldest file will be emptied of all data and it will become the primary archive, receiving new data. If you were to create and register "about" the right size\number of archives to contain 2 years, then this is all that would be stored and no new files would be created. There would be no need to delete files. This is a bit inexact as you are estimating what file size\number to get 2 years. You would not be able to set it precisely.
This subject is covered in out PI Sys Admin class, I'd suggest you attend this class. It would be very helpful if you are a pi admin and new to PI.
Use PI-SMT and check your archives.
You can store data for as long as you have a PI Archive file that covers the time span you wish to store data for.
What is PI-SMT? Is it the Excel plugin? I have a list in Excel with all tags, but I don't know how that helps me?
Here is a description from the products page at the Techsupport website.
The PI System Management Tools installer installs several tools including PI System Management Tools (PI SMT), PI Tag Configurator, PI MDB Builder and the PI Interface Configuration utility. PI System Management Tools application includes dozens of plug-ins for managing the PI Server including plug-ins for managing archives, mapping and trusts, users and groups, firewall settings, and tuning parameters. For more details on the individual plug-ins, click here.
In a nutshell, PI System Management Tools (SMT) is a set of easy-to-use tools that allow you to perform all the basic PI Server administration tasks.
I have found the PI System Management Tools. And I go to "Archive".What should I do now to know how long my time series will be stored?
The oldest time stamp in the Start Time column usually indicates how far back you have data. You can create an empty archive with a specific start/end-time if you need to fill in data before your oldest archive. Just make sure that there are no gaps in time (I.e. if you create an older archive it needs to have end time 1 second before start time of the currently oldest archive).
Actually, there should not even be a 1 second time gap between archives. I am clarifying this to avoid confusion.
In General your Data is stored forever. Or as long as your PI-Server hat disk space avalible. With setup of your PI Server the first archive is generatet and there will come more and more archives over time (if so configured). Well, it is also possible to store "older" data (timestamps befor your PI Server was installed).
I don´t know any mechanism to delete data thich is older then a certain time (in your case two years). As far as I know it had to be deleted manually or via tools (which could be scripted).
But befor you start playing around I would recomend you to get intouch with an experianced PI Admin to get all the tasks done until you know by heart what to do in the PI System. I asume you are very new to PI if you don´t know the SMT.
I am the PI admin.
So there is a script that I can run that deletes old archives? I guess that it is not just a regular bat script?
Retrieving data ...