Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

For further details, please contact Support

Restoring from Backup

How to restore from a failed upgrade

All opModule installers create a backup of /usr/local/omk prior to the installer running PROVIDED you answered the following question early in the installation procedure in the affirmative:

  • Do you want to perform a backup of your installation directory?
    • Default answer for automated install is 'Yes'.

This is the process to use if you need to roll back from the installer using this backup:

# send email to optek@ompantek.com with advance warning before restoring from backup
service opeventsd stop
service opconfigd stop
service opchartsd stop
service omkd stop
 
# confirm that the required Opmantek services have stopped (Applicable to NMIS 8 compatible apps only):
/usr/local/omk/bin/checkomkdaemons.sh status

# confirm that the required Opmantek services have stopped (NMIS 9 compatible apps):

service opeventsd status
service opconfigd status
service opchartsd status
service omkd status

cd ~
mkdir temp
tar -xvf omk-backup-YYYY-MM-DD.tgz -C ~/temp
unalias cp
cp -R ~/temp/*/usr/local/omk
 
# at this point this error may occur:
#   cp: cannot create regular file '/usr/local/omk/bin/opchartsd.exe': Text file busy
#   cp: cannot create regular file '/usr/local/omk/bin/opflowd.exe': Text file busy
# if this happens: do
#       mv /usr/local/omk/bin/opchartsd.exe /usr/local/omk/bin/opchartsd.exe.old
#       mv /usr/local/omk/bin/opflowd.exe /usr/local/omk/bin/opflowd.exe.old
# and then: do
# cp -R ~/temp/* /usr/local/omk

#FOR NNIS 8 compatible apps only:
service opeventsd start

service opconfigd start
service opchartsd start
service omkd start
 
IMPORTANT STEP FOR NMIS 9 compatible applications:

You also need to run the installer for each previously application that was installed (reinstall)  in order to downgrade properly and have the initd and systemd services restored too.

Ref: Restore Backup after Install

A couple things to remember -

  1. Each run of an opModule installer creates a new backup file. However, since they all use the same name only the most recent will be maintained. If you are installing several packages you should rename each backup before running the next.
  2. This process overlays the backup into the /usr/local/omk directory and DOES NOT replace it.

In case of failed upgrade

If something goes wrong throughout during the upgrade process the installer will attempt to roll back automatically, however, if you are experiencing any issues after a failed upgrade we recommend the doing the following.

...

Copy all all directories back in place. Ignore any "No such file or directory" error as this is a list of all directories that could have been modified during the upgrade process.

Code Block
# Replace "abi2" for the abi number found in the step above
cp -rfT /usr/local/omk/install/install-abi2 /usr/local/omk/install
cp -rfT /usr/local/omk/public/public-abi2 /usr/local/omk/public
cp -rfT /usr/local/omk/models/models-abi2 /usr/local/omk/models
cp -rfT /usr/local/omk/templates/templates-abi2 /usr/local/omk/templates
cp -rfT /usr/local/omk/schema/schema-abi2 /usr/local/omk/schema

follow these steps to roll back to your previous state.

  1. Restore from backup

  2. Download and install all previous Opmantek applications

...

Licences

...

  1. .