Author: Roman Savochenko
It is often needed to transfer configuration from one OpenSCADA project to another. And, more often, it is necessary to make a partial transfer, for example, the transfer of certain developments that could be useful in new project.
It should be noted that any developments with the slightest hint, and the prospect of re-use should be unified and stored in the separate-own libraries and databases. It is not recommended to change the default configurations and elements of the standard libraries, and save your own-new libraries and elements in the databases of standard libraries. This will subsequently allow you to unhindered update the standard libraries, as well as simply use the workings of your previous projects.
1 Simple transferring of database with libraries and configurations
If you took into account the above recommendations and all of your uniform workings are contained in a separate database, then the entire transferring process will consist in copying and connecting a database in a new project or in a simple connecting the database, for network DBMS.
The procedure of DB copying is different for types of databases and you should read about it in the DB documentation. For accompanying distribution, with OpenSCADA distributions, the SQLite database is usually used as separate files *.db. Copying of the SQLite database, respectively, is the simple copying of the the required database file from the database directory of the old project to the database directory of the new one.
Connection is made by creating a new database object in the module of the required DB type of the subsystem "DB" and its subsequent configuration, read more in (the details). After the DB creation, configuration and enabling you can immediately download the DB data from it by clicking the "Load the program from this DB" on the form of the database object. However, this only involves loading, without enabling-starting the downloaded objects, so it may be easier to restart OpenSCADA.
2 Separation of the desired configuration
If the desired configuration is contained in a common database or in the database of standard libraries, you need to move it to the separate database. You can move the configuration either to a separate database with your libraries or to the export database. The export database, unlike to the library one, only serves to transfer the configuration and will subsequently be deleted. In any case, you must create a new database for the desired database type, like the connection procedure above. To transfer you should use a database type that you plan to use in the new project. Usually, it is better to use the SQLite database type for the transfer, because of the simple copying procedure for it. However, if you use a network DBMS, the procedure may change to the simple connection of the library or export database to a new project.
Next, you must separate the configuration in unifying or export libraries, if it can not be directly stored in a database. Some parameter templates or controller parameters of data acquisition, visual elements of widget libraries, etc. can be separated by creating an export library or unifying the corresponding element. For the newly created library as a database should be specified the previously created unifying or export database. Further you should copy the necessary elements from the original library to unifying-export via the standard copy function. After copying the unifying-export library must be saved.
If necessary to transfer an object, with a separate field of DB or entire libraries, the operation of creating the intermediate library and subsequent copying can be omitted. It is enough in the DB field to specify the previously created a unifying or export DB and save the element.
Further actions, that is the simple transfer of the DB, are implemented in accordance with the previous section.
When you transfer the configuration by exporting it is necessary to perform the reverse process of copying from the export libraries to the local libraries of a new project and deleting of the export database.
3 Low-level copy of DB content
For transfer, you can use selective copy of the DB tables with configuration by: select table objects in the DB object, call the copy command, select the object of the new database and call the past command, read about it in (the details). However, it is necessary to know the structure of the DB, about which you can read by this link.