4 Replies Latest reply on Jan 30, 2013 3:56 PM by mhamel

    Problem with restoring PI DB from archive

    VarbanVarbanov

      Hello everybody! I am trying to restore the data from Pi Server. I have already installed pi server and i have regular backup from completely different Pi Server with different pi points in it (which includes all folders from PI folder - adm, dat, bin, etc including archives).
      I tried to follow the procedures described here:

      http://www.youtube.com/watch?v=l3HZ4bzjVYc

       

      and in page 197 of  PI System Manager I: Essential Skills Version 3.4Q.

      I'm not sure whether  i can restore the data from the other server on my server directly from the archive file, but when i try to register an archive i'm recieving error that i'm trying to add second primary archive. I don't see option in the menus where I can delete the primary archive, if there is such, please tell me!! So i tried to stop the server, remove the archive and register new archive using cmd and the command pidiag -ar but i receive output "pidiag is not recognized command.

      The same problem occures when i try to follow the procedure with restore of whole pi system (but without installing new pi server).

      Any suggestions will be appreciated!!

       

      Thank you in advance! 

       


       

        • Re: Problem with restoring PI DB from archive
          mhamel

          @Varban: You need to bring more than just archive files to restore a PI Server, you need the configuration and security databases otherwise you will have pieces of different systems. So, the way you are describing that you would like to bring back the PI Server A on PI Server B using only the backup files of the archives is not possible. The error message you received is telling your that you are trying to register all archive files from PI Server A to PI Server B that still have is own primary archive file. Only one primary archive file can exist on a PI Server at a given time.

           

          Even if you succeed to register all the archives from PI Server A to PI Server B, they would be unusable because the point id, a unique identifier for your PI Points, would not correspond to the current definition stored within the PI Server B.

           

          I don't understand this part of your explanation where you say:

           

          Varban

          The same problem occurs when I try to follow the procedure with restore of whole pi system (but without installing new pi server).

           

          Are you trying to restore your backup files (complete set) on a machine where no installation ever of OSIsoft software was done? Also, restoring a PI Server A over a PI Server B following the right procedure would destroy the latter.

           

          Could you shed some light on your goals? Are you trying to merge both PI Servers?

            • Re: Problem with restoring PI DB from archive
              VarbanVarbanov

              Thank you Mathieu for your reply! I also thought it would be not possible to just restore the archive but anyway i thought i should give it a try.

               

              So I want to make clear the part you haven't understood.  I meant that there is procedure for restoring all system, described in the documantation as follows:

               

              ..............................

               

              1. Change the computer name of the new node to the name of the old PI Server node. Restart the

               

              computer.

               

              2. Restore the backup to a temporary directory, such as C:\TempRestoreDir. For example, if you

               

              have been backing up your backup directory with a third-party backup application, restore the

               

              desired backup to C:\TempRestoreDir. Alternatively, if you are restoring the latest backup, you

               

              can restore the PI Server directly from the latest backup directory. This procedure assumes that you

               

              have restored a previous backup to a folder of the name C:\TempRestoreDir.

               

              3. Copy the installation kit to the computer and then disconnect the computer from the network.

               

              Disconnecting from the network is important so that data is not lost from buffered interface nodes in

               

              4. Install the PI Server. The same PI Server version should be installed as on the old PI Server node,

               

              and the PI Server should be installed to the same drive letter and directory path as on the old PI

               

              Server node. If you are restoring an old backup, use the PI Server version that was installed at the

               

              time that the backup was taken. The PI Server version can typically be found in the backup log,

               

              which should have been restored to C:\TempRestoreDir.

               

              5. Verify that the PI Server is disconnected from the network before proceeding to the next step.

               

              6. Start PI, and then stop PI after proper startup is observed. This accomplishes the "run once"

               

              functions performed after an installation. Since the PI Server is disconnected from the network at this

               

              point, data will not be lost from buffered server nodes.

               

              7. Restore (using Windows Explorer or the copy command) all files from the

               

              C:\TempRestoreDir\dat\ directory to the new PI\dat\ directory.

               

              8. Restore all the message log files (pimsg_xxxxxxx.dat) from the C:\TempRestoreDir\log\ to

               

              the PI\log directory.

               

              9. Restore all files from the C:\TempRestoreDir\adm\ directory to the new PI\adm\ directory.

               

              10. Restore all files from the C:\TempRestoreDir\bin\ directory to the new PI\bin\ directory.

               

              11. Restore the archives from the C:\TempRestoreDir\arc\ to the same directory that they were

               

              installed on the old PI Server node. You can determine the directories from the archive list in the

               

              restored backup log. If you restore the archives to a different directory, then you will need to do the

               

              following additional steps:

               

              · Register the primary archive in the new location with the following command from the PI\adm

               

              directory: pidiag -ar. After this command completes, only the primary archive will be

               

              registered. If you are uncertain which of the backed up archives is the Primary Archive (archive

               

              0), use pidiag -ahd and examine the archive dates. The primary should have the latest start

               

              date and an end date of "Current time." The syntax of the command is: pidiag -ahd

               

              C:\TempRestoreDir\arc\piarch001.dat. After you start the PI Server in a later step,

               

              register additional archives with the piartool -ar command. For example, piartool -ar

               

              path_and_archive_file_name.

               

              12. If the backup was performed using PI Version 3.4.370 or greater, then skip this step because the

               

              snapshot is backed up as of 3.4.370. Otherwise, follow the steps:

               

              · Rename the PI\dat\piarcmem.dat to PI\dat\piarcmem.dat.old

               

              · Re-create the snapshot file with the command: \pi\bin\pibasess -snapfix

               

              13. Start the PI Server.

               

              14. If you had to run pidiag -ar earlier in the procedure, register additional archives with the

               

              piartool -ar command now.

               

              15. Use piartool -al and the client tools (PI ProcessBook and PI DataLink) to verify that all the data

               

              has been recovered. If the data is intact, you are done. Run the clients locally, since the PI Server

               

              should be isolated from the network. It is very important to confirm correct PI Server recovery

               

              before exposing the PI System to buffered data. Failing to do so may cause data loss.

               

              16. Connect the PI Server to the network. Verify the PI Server is reachable from clients on the network

               

              .............

               

              But i want to avoid the instalation of new Pi Server.  So i'm starting to follow the procedure after point 5. I replace the whole the dat, bin and log directories and in admin directory only the files that are in the archive - piservstar, piservstop, pisitestart. When I'm trying to execute pidiag -ar command an error message that this is unknown command appears.

               

              Should this procedure work anyway - without installing pi server.

               

              To your question about merging the servers - yes it will be good - is it possible? But it will be ok for me if the old server is destroyed.

               

              Best Regards!

                • Re: Problem with restoring PI DB from archive
                  VarbanVarbanov

                  Update: I'm still trying to restore Pi System. Now I'm trying to use this procedure:

                   

                  1. Isolate your PI Server from the network.

                   

                  2. Stop PI Server.

                   

                  \pi\adm\pisrvrstop.bat

                   

                  3. Delete the following file:

                   

                  \pi\dat\PIModuleUnitDb.dat

                   

                  This file is automatically regenerated when you restore from backup.

                   

                  4. Restore the backup to a temporary directory, such as C:\TempRestoreDir.

                   

                  For example, if you back up your backup directory with a third-party backup application,

                   

                  restore the desired backup to C:\TempRestoreDir. Alternatively, if you are restoring

                   

                  the latest backup, you can restore PI Server directly from the latest backup directory. This

                   

                  procedure assumes that you have restored the desired backup to a folder of the name

                   

                  C:\TempRestoreDir.

                   

                  5. Copy the files from C:\TempRestoreDir\dat to PI\dat.

                   

                  6. Copy the files from C:\TempRestoreDir\adm to PI\adm.

                   

                  7. Copy the files from C:\TempRestoreDir\bin to PI\bin.

                   

                  8. Copy the files from C:\TempRestoreDir\log to PI\log.

                   

                  9. Copy the archive files from the C:\TempRestoreDir\arc directory in your backup

                   

                  folder to their original location on PI Server.

                   

                  If you are not sure where your archive files were located on PI Server, look in the backup

                   

                  log file in C:\TempRestoreDir\. The log contains the archive list at the time of the

                   

                  backup.

                   

                  Since you are restoring to an existing server, you do not have to restore all archives. At a

                   

                  minimum you must restore the primary archive. Restore other archives as needed.

                   

                  10. If a site backup was performed (if, for example,

                   

                  C:\TempRestoreDir\sitebackup exists), then copy the files from the site

                   

                  backup directories to the corresponding 32-bit and 64-bit pipc directories.

                   

                  11. Restart PI Server.

                   

                  12. Restore PI Server's connection to the network.

                   

                  Restore a Server Backup to a New Computer

                   

                  PI Server 2010 System Management Guide 113

                   

                  13. Use the MDB to AF Synchronization tool in PI SMT to check the status of the

                   

                  synchronization between MDB and AF.

                   

                  14. If MDB and AF are out of sync, then use the MDB to AF Synchronization tool to reset

                   

                  MDB.

                   

                  Now i'm able to call the command pidiag -ar, although it is not mentioned in the procedure. Regardless whether i run that command or not when i have to start Pi Server, the start process is stopping and following message appears in cmd : "Continue after failure to register with License Manager. [-10727] PINET: RPC is NON-EXISTING

                   

                  Please help!

                    • Re: Problem with restoring PI DB from archive
                      mhamel

                      @Varban: Starting from step no 5 would work if you have your server B computer installed with the same PI Server version. Regarding the question on merging servers, it is possible and it is documented already. You can find the document PI Server 2010 System Management Guide here under the section Move and Merge PI Server.

                       

                      Regarding your attempt with the second procedure, the error message you get relates to PI License Manager not exposing its RPCs. Can you validate that the PI License Manager service is up and running? I would suggest you take the time to contact our technical support to get help with this. They will be able to remote to your system if necessary to explore the problem. Don't forget to use this thread as a reference to the issue.

                       

                      Let us know what the issue was.