SimpleHelp Community

How to restore SimpleHelp back after update


#1

Anyone know how to restore the SimpleHelp_backup? Or where the docs are. Our update failed an now server will not start. Need help ASAP.


#2

It depends on what version you are on and if we’re migrating between major versions.
https://simple-help.com/updating-guide.html#updating-simplehelp

Basically, save your configuration folder and serverkeys.dat file.
Re-install and copy your old configuration folder and serverkeys.dat file.
https://simple-help.com/administrator-guide#backups-and-restores

If you backed up from within the admin GUI, you would have a zip file. It will be the same deal. Unzip and move the files.


#3

Not upgrading to a major version just from 5.3.5 to 5.4.5.
After running the usual upgrade script getting this error.


  • FATAL ERROR: Failed to start server
  • REASON: SimpleSuite was unable to launch as another instance is already running.
  • SimpleSuite Server will exit in 5 seconds

java.lang.Throwable: DEBUGGER GENERATED STACKTRACE
at com.aem.utils.Debugger.getStackTrace(Debugger.java:421)
at com.aem.utils.Debugger.error(Debugger.java:373)
at com.aem.shelp.proxy.ProxyServerStartup.serverStartFailure(ProxyServerStartup.java:813)
at com.aem.shelp.proxy.ProxyServerStartup.serverStartFailure(ProxyServerStartup.java:803)
at com.aem.shelp.proxy.ProxyServerStartup.getLock(ProxyServerStartup.java:1046)
at com.aem.shelp.proxy.ProxyServerStartup.(ProxyServerStartup.java:258)
at com.aem.shelp.proxy.ProxyServerStartup.main(ProxyServerStartup.java:1069)


#4

Tried stopping the server, running the upgrade script and it says server launched successfully, but then nothing. So tried manually starting the server and nothing.


#5

That happened to me when my aws instance was out of space. I never cleared out the old backups and my instance was sized really small :stuck_out_tongue:

I would save my backup. check drive space. Stop the instance. Delete/uninstall.
Re-install. Stop instance. Copy over the backup config. Start instance.


#6

That would make sense because when trying to copy over backup folder it ran out of space. Finally figured out how to start the server from the back up last night :man_facepalming: Copied it over to directory opt/ (had it in a archive folder) and sudo sh startserver.sh from inside the backup folder Left the SimpleHelp folder alone and just ran it from the backup folder. (in case anyone comes across the same problem)
The original error when running the saying something about not finding jre/libjava or something Will try again next week, its Friday. Thanks for the advice, will keep you posted.


#7

I’m by no means a programmer, but this is what I hacked together to use for my updates. Feel free to use it at your own risk.

usage: ./sh_update https://download_url (typically https://simple-help.com/releases/SimpleHelp-linux-amd64.tar.gz)

This script will stop your running instance of Simple-Help, pull down the installer file, backup your install to the /opt directory, check to make sure it’s not the same as the last file you installed, and install the new version and restart Simple-Help.

USE AT YOUR OWN RISK

#!/bin/bash

# Prompt user until they type Y/y or N/n
# Calling:
# prompt_yesno
prompt_yesno() {
        local input=""

        while true; do
                printf "%s" "(Y/n): "
                read input

                if [ "$input" = "" ] || [ "$input" = "Y" ] || [ "$input" = "y" ]; then
                        return 0
                fi

                if [ "$input" = "N" ] || [ "$input" = "n" ]; then
                        return 1
                fi
        done
}

if [ "$BASH_VERSION" = "" ]; then
        echo Required bash scripting environment not detected. You are likely running with /bin/sh. Rerun with /bin/bash?
        if prompt_yesno; then /bin/bash "$0"; fi
        exit 0
fi

if [ $UID -ne 0 ]; then
        # Clear out any existing credentials so the user always gets a prompt
        sudo -K
        echo "Type your password below to give SimpleHelp permission to install: "
        echo "(You can also Ctrl-C to exit and re-run the script as root)"
        sudo "$0"
        exit 0
fi

echo ""
echo "Welcome to the SimpleHelp Installer"
echo ""
echo "The installer will do these things:"
echo "1) Prompt you for installation options"
echo "2) Display a list of actions to be taken"
echo "3) Prompt you for execution of the actions"
echo "4) Execute the actions"

# Prompt user for options
installation_directory="/opt/SimpleHelp"

if [ $installation_directory != $(echo "$installation_directory" | sed 's,/\([^/]\),/[\1],g') ]; then installation_directory="/opt/simplehelp"; fi

while true; do
        echo ""
        echo "Where would you like to install SimpleHelp?"
        printf "%s" "[$installation_directory] "
        read input

        if [ "$input" == "" ]; then
                break;
        elif [[ "$input" == "/"* ]]; then
                installation_directory=$input
                break;
        else
                echo ""
                echo "Invalid location"
        fi
done

installer="`cd "$(dirname $0)"; pwd`/$(basename $0)" # installer full path
if [[ $installer == $installation_directory/* ]]; then
        echo "The SimpleHelp installation directory cannot contain the installer ('$installer'). Please move the installer or choose a different location to install SimpleHelp and rerun this script."
        exit 1
fi

is_upgrade=0

if test -d "$installation_directory"; then is_upgrade=1; fi

if [ $is_upgrade -eq 1 ]; then
        echo ""
        echo "It appears that there is already an installation at $installation_directory ($old_version)"
        echo "Would you like to upgrade?"

        if ! prompt_yesno; then
                echo "Installation directory already exists, and you chose not to upgrade it. Please erase the existing installation to perform a fresh install in $installation_directory or rerun this script and choose to upgrade"
                exit 1
        fi
fi

if [ -z "$1" ]; then
	echo "ERROR: I don't know what to download need the url"
	exit 1
fi

# Generate a timestamp
now=$(date +"%Y%m%d_%H%M%S")

# Move to base installation folder
cd /opt

# Fetch the new version
if [ ! -f "/opt/SimpleHelp-linux-amd64.tar.gz" ]; then
	echo "Downloading the latest version"
	if [ `uname -m | grep "64"` ]; then
		wget $1
	fi
fi

# Test to see if we have already applied this update
if [ -f "/opt/.last_install_file_checksum" ]; then
	echo "Caculating Checksum and comparing to previous install..."

	chk1=`cat ".last_install_file_checksum"`
	chk2=`cksum SimpleHelp-linux-amd64.tar.gz | awk -F" " '{print $1}'`

	if [ $chk1 -eq $chk2 ]
	then
		echo "ERROR: This version is already installed..."
		rm -f SimpleHelp-linux-amd64.tar.gz
		exit 1
	else
		echo "New Version, Updating..."
	fi
else
	echo "I don't see a previous update.."
fi

# Stop the server & make a backup
if [ -d "/opt/SimpleHelp" ]; then
                cd SimpleHelp
		echo "attempting to stop SimpleHelp"
                sh serverstop.sh
                cd ..

                echo "Backing up the SimpleHelp installation to SimpleHelp_backup_$now"
                mv SimpleHelp "SimpleHelp_backup_$now"
fi

# Extract new installation
if [ -f "/opt/SimpleHelp-linux-amd64.tar.gz" ]; then
	tar -xzf SimpleHelp-linux-amd64.tar.gz
fi

# Copy across the old configuration folder
if [ -d "/opt/SimpleHelp_backup_$now" ]; then
	echo "Copying across configuration files"
	cp -R /opt/SimpleHelp_backup_$now/configuration/* /opt/SimpleHelp/configuration

	# Copy across a legacy license file
	if [ -f "/opt/SimpleHelp_backup_$now/shlicense.txt" ]; then
			cp /opt/SimpleHelp_backup_$now/shlicense.txt /opt/SimpleHelp/configuration
	fi
	
	# Copy across any keystore file
	if [ -f "/opt/SimpleHelp_backup_$now/keystore" ]; then
			cp /opt/SimpleHelp_backup_$now/keystore /opt/SimpleHelp
	fi
fi

# update checksum file
echo "$chk2" > .last_install_file_checksum
rm -f SimpleHelp-linux-amd64.tar.gz

# Start the new server
echo "Starting your new SimpleHelp server"
cd SimpleHelp
sh serverstart.sh
cd ..
exit 0

USE AT YOUR OWN RISK


#8

Just fyi, Simplehelp has an upgrade script to make things easier.
https://simple-help.com/install---linux#installing-simplehelp-on-linux

curl -fsSL https://simple-help.com/simplehelp-upgrade.sh -o simplehelp-upgrade.sh
sh simplehelp-upgrade.sh /opt/SimpleHelp

#9

They also have scripts so that simplehelp can run as a service.

https://simple-help.com/kb---installing-the-simplehelp-server-as-a-daemon-or-service-on-linux#installing-the-simplehelp-server-as-a-daemon-or-service-on-linux


#10

We have an update script that the guy before me made. It usually works without a hitch but this time it didn’t. Our backup kept disconnecting (could be another issue) so finally decided to tackle this.
Ended up killing the processes that were preventing original server directory to run. Copied over backup configuration and started server. Voila, 5.4.6 is now running. Wondering if it will happen again when we update to 5.4.7. Guess we’ll see. I appreciate all the feedback guys, thanks!


#11

There is a known problem with a locked files on the v5.4.7 update (see other thread). Ignoring the warning appears to allow it to install. I’ve not tried again on our system after it failed the out of hours attempt failed.


#12

It looks like that was happening if the SH server was on a Windows instance? Hm, think we will wait either way. Don’t want any issues for the moment.


#13

Yes Windows Server 2019.