Remote upgrade (Linux)
This article describes the steps needed to upgrade from ElectroServer 4.0.x to the latest version of ElectroServer, with a Linux operating system, remotely from a Windows operating system. Yes, very specific situation, but those who are used to Windows and find themselves trying to administer a remote Linux installation will find it useful.
Gather needed information
- IP address of the server
- valid username and password for logging on to the Linux box
- root password for the Linux box
- admin username and password for the web based administrator for the current installation
Use your browser to log in to the web based administrator for the current installation. The url will look like this, with the ??? replaced by the IP address of the server. The port might be 8080, but it might be a different port:
Check the different tabs, and note any non-standard values. Specific values to note:
- License details
- Listeners on each gateway
- Custom filters
- Persistent rooms
- Extensions installed
- Details on server level components of extensions
Find your license file if you purchased one for ES4.
Finally, visit ElectroServer downloads page and make a note of the specific url for downloading the latest Linux version of ElectroServer. For example:
On the Windows machine, download PuTTY. It does not have to be installed; just execute it. Enter the IP address, optionally clicking the Save button to have PuTTY remember that address, then click Open.
The PuTTY window will now allow you to work on the Linux machine (command line only) as if you were at its keyboard. Log on using the username and password you found, then type su to switch to superuser mode, and enter the root password. Optionally you may be able to just type sudo to award superuser privileges to the username you logged in with.
To download the RPM file, use wget. For example:
Basic installation is easy. Using our example file above:
rpm -i ElectroServer_4_0_4_linux.rpm
This will install ElectroServer in /opt/ElectroServer_4_0_4.
Copy custom files from previous installation
Navigate to the previous installation of ElectroServer. For example, if the previous version was ES 4.0.2, you would type:
Note: If the previous version was ElectroServer 3 or earlier, do not simply copy these files. Edit them and record details, then edit the corresponding files in the new installation.
Type ls to get a listing of the files. Look for a file that has the extension .sh. This is the file that has been used to start ElectroServer. Copy this file to the new installation. For example, if the file is named Start.sh:
cp Start.sh /opt/ElectroServer_4_0_4
Navigate to the server/config folder of the previous installation. Assuming that you wish to use the exact same port for the web admin, just copy this file as well:
cd server/config cp ES4Configuration.xml /opt/ElectroServer_4_0_4/server/config
If logging has been customized, you will want to also copy the log4j.properties file.
Assuming that you are currently in /opt/ElectroServer_4_0_2/server/config, here is an easy way to install copies of all the current extensions:
cd - cp -a server/extensions /opt/ElectroServer_4_0_4/server/extensions
Customize new ElectroServer version
Navigate to the new installation folder. For example:
Optional: edit ES4Configuration.xml
If you want minimal downtime on a working server, you will want to change the ES4Configuration.xml file to use a different port for web admin. To edit a file in Linux, navigate to the folder where it is, type "vi filename", then i to start Insert mode. Make the changes, then press the Escape key to leave Insert mode, and finally type ":wq" to save the changes and quit. Typing ":q!" will quit without saving changes.
Optional: stop current ElectroServer
If you are using the same port for web admin, now is the time to stop the previous version server. You can do this from the web admin, or you do it from the command line. From the command line, type:
ps -fu root
Look in the righthand column for the previous version of ElectroServer, and the shell script that started it. Record the PID numbers (second column). Let's assume that the shell script's number is 86577 and the ElectroServer's number is 86578. Kill both of them:
kill 86577 kill 86578
Start new ElectroServer
Execute the shell script that you copied:
Web admin customization
Now, from Windows, open the web admin in a browser, using the port for the new installation. Find your notes on the customization details.
- Change the administrator password.
- From the General tab, Manage licenses, upload the license if you bought one, then click the Activate link.
- Reboot the server from the General tab.
- Pause a moment, then log in again. Verify that there were no startup errors.
- Do all other customization except the gateway listeners, in any order.
- Customize the gateway listeners.
- If the previous version is still running, stop it now.
- Reboot the (new version) server from the General tab.
- Verify that all server level components show correctly, and that clients can connect to the server correctly.
If the new version is using a different port for the web admin, at this point you may choose to just keep that new port, or you can edit ES4Configuration.xml to use port 8080, then reboot using the web admin on the new port, then verify by logging in to the web admin on port 8080.
If something goes wrong and you want to wipe and start fresh, you can uninstall with this command (or something similar):
rpm -e ElectroServer-4.0.4
Note that the name is not the same as the filename of the RPM you installed.
Your system may require this uninstall command instead:
dpkg -r electroserver