# Archiving phasor data to portgresql(pgAdmin 4) database from openPDC

**URL:** <http://discussions.gridprotectionalliance.org/t/archiving-phasor-data-to-portgresql-pgadmin-4-database-from-openpdc/1199>\
**Category:** openPDC\
**Created:** [September 22, 2023, 6:22am UTC](http://discussions.gridprotectionalliance.org/t/archiving-phasor-data-to-portgresql-pgadmin-4-database-from-openpdc/1199 "2023-09-22T06:22:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![BALAJI\_TS](http://discussions.gridprotectionalliance.org/user_avatar/discussions.gridprotectionalliance.org/balaji_ts/32/1277_2.png) [@BALAJI\_TS](http://discussions.gridprotectionalliance.org/u/BALAJI_TS)\
**Post date:** [September 22, 2023, 6:22am UTC](http://discussions.gridprotectionalliance.org/t/archiving-phasor-data-to-portgresql-pgadmin-4-database-from-openpdc/1199/1 "2023-09-22T06:22:10Z")

</div>

Greetings for the day,

I am new to openPDC and historian concepts, I am facing issues to understand data archiving from openPDC. I am having a PMU connected to openPDC and I can view the PMU measurements in openPDC. Now I want archive or send this phasor measurements to postgres(pgAdmin 4) database. Can some one tell me how to do this, help me with configuration steps to do this.

Thank You.

Regards,  
Balaji

---

<div class="post-metadata">

**Author:** ![ritchiecarroll](http://discussions.gridprotectionalliance.org/user_avatar/discussions.gridprotectionalliance.org/ritchiecarroll/32/2_2.png) [@ritchiecarroll](http://discussions.gridprotectionalliance.org/u/ritchiecarroll)\
**Post date:** [September 28, 2023, 6:02am UTC](http://discussions.gridprotectionalliance.org/t/archiving-phasor-data-to-portgresql-pgadmin-4-database-from-openpdc/1199/2 "2023-09-28T06:02:54Z")

</div>

You can certainly add a time-series library (TSL) adapter, e.g., the `AdoAdapters`, that will archive measurements to a database. Do be aware that this will be very limiting, especially for streaming synchrophasor data, on the volume of data that can be stored effectively - however, for just a few PMUs you should be fine.

For larger scale archiving, we recommend a system like the [openHistorian](https://github.com/GridProtectionAlliance/openHistorian) which was designed to archive large volumes of streaming measurement data at high speeds.

For guidance on setting up the `AdoAdapters` to archive data, I suggest starting here:  
[openHistorian Historian data to be saved into RDBMS (Oracle/Sql Server) using AdoAdapters - GPA Products / openHistorian - GPA Product Discussions (gridprotectionalliance.org)](https://discussions.gridprotectionalliance.org/t/openhistorian-historian-data-to-be-saved-into-rdbms-oracle-sql-server-using-adoadapters/565)

Then searching for other discussions related to `AdoAdapters` and/or `database archiving`.

Thanks,  
Ritchie

---

<div class="post-metadata">

**Author:** ![BALAJI\_TS](http://discussions.gridprotectionalliance.org/user_avatar/discussions.gridprotectionalliance.org/balaji_ts/32/1277_2.png) [@BALAJI\_TS](http://discussions.gridprotectionalliance.org/u/BALAJI_TS)\
**Post date:** [October 3, 2023, 12:19pm UTC](http://discussions.gridprotectionalliance.org/t/archiving-phasor-data-to-portgresql-pgadmin-4-database-from-openpdc/1199/3 "2023-10-03T12:19:21Z")

</div>

Thank You for the response Ritchie,

Currently I am trying to archive data to SQLite database by reffering the link provided by you and the below link.

> [@openPDC with external database](https://discussions.gridprotectionalliance.org/t/openpdc-with-external-database/764/11):
>
> Thank you so much for your answers and suggestions. These are very important points we need to test. The idea on our side it to have an external database of “pure” phasor data to be processed later (in a way that we don’t define yet, just want to store the data). Now we are at the proof-of-concept level and that is why we focus on SQLite. We will test your suggestions asap. Thanks again, Anna

I have configured my connection string as given in the above links. And this is my connection string.

BulkInsertLimit=500; DataProviderString={AssemblyName={System.Data.SQLite, Version=3.43.1,  
Culture=neutral, PublicKeyToken=db937bc2d44ff139};  
ConnectionType=System.Data.SQLite.SQLiteConnection;  
AdapterType=System.Data.SQLite.SQLiteDataAdapter}; DbConnectionString={Data  
Source=D:\OpenPDC\_database\MeasurmentDB.db}; InputMeasurementKeys=9f5526ee-5d8b-44f6-9fc1-c42540d82665;  
TableName=TimeSeriesMeasurement; IDFieldName=SignalID; TimestampFieldName=Timestamp;  
ValueFieldName=Value; SourceIDs=PPA

I am using SQLite Version 3.43.1 in my system and i have created MeasurementDB.db file D:\OpenPDC\_databse folder. And I have created a table named TimeSeriesMeasurement in SQLite database.

After all the configuration, when I click Initialize button I am getting the below error. What might be the reason for this error?

 ![Screenshot (82)](http://discussions.gridprotectionalliance.org/uploads/default/original/2X/8/88b134f9c9e9fada828401ea8a29f3b1cd75dd2a.jpeg)

And I have few doubts related to database and connection string.

1. Do we need to keep sqlite3 file in MeasuremntDB.db folder and create table in that place using sqlite command line? Or how it should be done?

2. In Connection string what does **SourceIDs=PPA** this element indicate?

3. And in openPDC-\> Historian Instances. Do we need to configure Primary Phasor Archive part also?

 ![historian](http://discussions.gridprotectionalliance.org/uploads/default/original/2X/4/4dca1d71d720f13d4dc0fc53b9b9f8b50ae4b8c1.png)

Thank You.

Regards,  
Balaji TS
