Comprehensive backups and the ability to effectively restore them are crucial to minimizing downtime when a computer disaster occurs. Additionally, when developing a new project in FactoryPMI/SQL, it is common for users to perform the bulk of the work on a development computer, and then transfer the project to the production machine at startup or when the project is nearly complete. The process of backing up, transferring, and restoring a FactorySQL/PMI system can seem complex given the number of elements involved (usually 4: FactoryPMI, FactorySQL, the OPC server, and the database). Therefore we have written this document as a guide to the overall procedure. Due to variances in the third party software used by customers (the OPC server and database), we cannot provide specific instructions for those products, though we have attempted to provide as detailed an overview as possible. Overview
A standard project consists of the 4 components outlined above: FactoryPMI, FactorySQL, the OPC Server, and the Database. Which components are critical to backup/transfer will depend on the project configuration and the third-party software used, but it is almost always necessary to transfer data from all 4 components.
Roughly the procedure is as simple as backing up each component's configuration, installing the software on the new machine, and restoring from the backup. Finally, you'll have to ensure that each component is licensed and activated. With Inductive Automation's software, and virtually all third party components, there is no difference in the project files between activated and unactivated software. Therefore, a system backup made with an unactivated FactorySQL may be restored to an activated copy, and vice-versa. FactoryPMI
In FactoryPMI, a system backup is created from the gateway configuration portal. From the gateway homepage, click on "Configuration". After logging in, select "Backup/Restore" from the side menu under "System".
After selecting "Download Server Backup", you'll end up with a *.fpgb file that contains the following data:
- Defined Projects, including all windows
- All gateway settings
- All images added through the designer
- All plugins and custom palettes
The backup file will not
contain the following:
- Defined SQLTags - these are in the database
- FactorySQL groups - these are only in FactorySQL
Restoring is essentially the opposite of backing up, under the same "Backup/Restore" section of the gateway configuration portal, simply select the "restore" tab. Select the correct file, and click "Restore". Notes
After restoring, especially to a different machine, it is important to check that datasource configurations are still valid and can connect to the databases, and that the authentication systems are also working (particularly if using datasource or active desktop authentication). FactorySQL
FactorySQL provides 2 different backup options under its Backup/Restore menu (found in the Frontend under File): Project backup and System backup. The difference is that Project backup includes only
the group files, whereas the system backup includes all settings, data connections, etc. In general, it is advisable to always perform system backups.
To perform a system backup, simply select the option from the menu, and choose the location at which to store the backup file (*.fdb). Restore
To restore, simply choose the "Restore System" option from the File>Backup/Restore menu. Then, select the correct file, and hit OK. The frontend should be connected to the service before performing this step. Notes
1) To perform a backup and restore, the frontend
should be connected to the service
. When you are connected to a service, the frontend will say so in the upper right corner of the application:
2) The system backup is actually simply copying the system_database.fdb file located in the program's install directory. It is perfectly OK to copy this file manually in Windows in order to backup the system. It is not
OK, however, to simply copy the file back into the folder in order to restore. To restore in this manner, you must first stop the FactorySQL service. Then, after copying the file into the directory and renaming it "system_database" (replacing the old one), you may restart the service. Activation and Transferring FactorySQL/PMI Licenses
As mentioned previously, it is the applications themselves, not the project files, that are activated. Therefore, transferring licenses is only necessary when you want to move from a previously activated system.
Both products have the ability to Unactivate, either over the internet or by telephone. After unactivating, you will now have another activation available to use. To transfer a license, you simply need to unactivate on the first machine, and activate on the second.
If you're using a hardware based license key this does not apply, and you only need to move the key from the first to second machine. OPC Server
The procedure for backing up and restoring the OPC server will vary significantly based on which server you are using. Consult your OPC server's documentation for more information. As long as the server is restored with the same device names, topics, etc. FactorySQL should not have problems connecting to the tags. Remember, however, that often times transferring between machines will result in different network configurations, which in turn could cause a simple restore to fail, as the configured IP addresses would no longer be valid. Therefore, you'll want to verify that the target PC is able to communicate with all configured devices. Database
Inductive Automation software can work with a wide variety of database servers. Therefore, as with the OPC server, the procedures for backing up and restoring can vary greatly. The documentation for your database system should be very clear on how to backup and restore. Here are some general tips that apply for most databases:
Example with MySQL
- Schema vs. Data: It's not always necessary to store all of the data in a table, when all you need to get back up and running is the table structure. For example, the data contained in most history tables isn't crucial for the operation of the system. Therefore, it can be more efficient to backup only the "table schemas" (structure) in these cases, and leave the data out. Of course, it would be wise to periodically back up the data as well, as part of a separate backup scheme, because while not crucial, it is usually important data. Most database backup routines will allow you to choose which tables include data, and which include only the schema.
- Database Name: Most of the time database backups do not include the actual name of the database, or if they do, allow it to be changed on restore. This can cause problems with FactorySQL & FactoryPMI data connections, which store the name. It is therefore important to make note of the name (perhaps naming the backup file according to it) and to then be careful to restore it to the same name. When restoring, you may have to manually create a database with that name, and then specify it as the target of the restore.
- Permissions: User names and passwords are often stored in an different schema in the database. Care should be taken in how these are backed up and restored. If not restored properly, configured data connections in FactorySQL and FactoryPMI will not be able to connect.
- DSN connections: If FactorySQL or FactoryPMI use data connections based on ODBC DSNs, you will need to backup the DSNs separately, as they will not be included in any of the backup files.
MySQL has various facilities for backing up and restoring. The easiest option is to use the MySQL Administrator tool.
On the left hand side of the tool, there are tabs for Backup and Restore.
The following image illustrates the procedure for a quick backup:
- Click the Backup tab
- Create a "New Project"
- Select which databases you'd like to backup
- Add the selected databases to the "Backup Content" pane
- Execute the backup
From here you can go on to schedule the backup, or play around with the more advanced options available.
Restoring is similar:
- Select "Restore"
- Open the appropriate backup file
- Make sure it's writing to the original schema- unless you know for a fact that it should go to a different one.
- Start Restore
After following these procedures and verifying that the necessary user names are present and have the correct permissions, everything should be back up and running correctly. Conclusion
The process of transferring a system or backing up/recovering for disaster purposes is not necessarily difficult, but can be complicated by the number of components involved. An organized game plan including this document and any other relevant information (name and locations of backups, etc.) can make recovery much easier. It is also a good idea to perform a "dry run" from time to time in order to stay familiar with the procedures and to verify that all required components are accounted for. Inductive Automation
Inductive Automation pioneered the first full-featured web-launched HMI/SCADA system in the world. Its standards based, database-centric architecture receives accolades from plant managers, IT managers, and system integrators worldwide. With a commitment to software quality and technical support second to none, Inductive Automation is at the forefront of industrial software.