Configuring NEOSYS Generally: Difference between revisions

From NEOSYS Technical Support Wiki
Jump to navigationJump to search
Line 213: Line 213:


Follow the instructions on the screen VERY carefully.
Follow the instructions on the screen VERY carefully.
==== Checking if autologin is configured correctly and working or not ====
On the source system, in cygwin console, type something like the following, changing port number, administrator and clientname to suit the case.
ssh –p 19580 administrator@clientname.neosys.com
After a few seconds, if it is working properly, it should give you a command prompt on the target system. This indicates that autologin was successful. You may exit using the command:
exit
Otherwise, if it gives some error and in particular if it asks you anything at all, for example “confirm fingerprint?” or “password?” then autologin is not working.
You can then type in the following command in cygwin to configure or reconfigure autologin:
./autologin.sh


=== The edit step ===
=== The edit step ===

Revision as of 06:17, 1 March 2012

Clearing files in database

This is to be done if you want to clean an old database or clean a training database so that a client can enter fresh data.

These commands DO NOT reset the data to "factory settings" so for new installations you need to download a fresh BACKUP.ZIP file from the NEOSYS website.

  • Clear transactions F5 CLEAROP (only clears transactions not reference files)
  • Clear all F5 CLEARALL (rather nasty command because it clears all reference files as well)

Clearing selected files in database

This can be done if you want to reimport selected files. The flush index command MUST be performed after doing any clearing.

WARNING This procedure must not be used if there are any transaction in the system that might use the files being cleared.

WARNING Clearing individual files is error prone because other files might refer to the records you are clearing (referential integrity is not applied so dangling references may be created). For example, clearing suppliers without clearing vehicles in advance results in vehicles which have supplier codes that do not exist. Even if you reimport the suppliers, some supplier codes in the vehicles file may not be reimported leaving vehicles with problems.

WARNING The opportunity to create problems that have no solution and that may only surface when the system is in operation is endless unless you think through the implications very very very carefully.

  • Flush Index F5 FLUSH.INDEX (this command MUST be performed immediately after any data clearing)
  • Clear suppliers F5 CLEARFILE SUPPLIERS
  • Clear vehicles F5 CLEARFILE VEHICLES
  • Clear Payment Instruction F5 CLEARFIELD CLIENTS PAYMENT_INSTRUCTIONS (only clears the payment instruction from the client and brand file)

Mass updating database without data entry

Warning: It is advisable that you take the approval of NEOSYS DBA or programmers before doing any of the following procedures. There is no protection whatsoever from damaging the database if you do not appreciate all the implications of any particular update. Common sense and caution must be used. If you damage a database then it may be, or with operation become, irretrievably damaged and require reconstruction from a backup causing possibly extreme finance damages to the owner of the data and consequences for yourself. You have been warned.

There are many commands in maintenance mode that allow you to amend the database directly and without any record and without any ability to reverse changes.

Normally, no record of the changes is made. All changes will appear to have been done by the last user at the time and date of the last normal user interface amendments.

Available fields to clear or set

  1. Client & Brand File: CLIENTS MARKET_CODE
  2. Client & Brand File: BRANDS MARKET_CODE

How to clear a database field

Assuming that a particular database field may be blank (i.e. not required for data entry) then you may clear a field as follows.

Warning: There is nothing to stop you clearing a field that is mandatory and doing this may cause irrecoverable damage to the database.

In the following example we wish to change all clients with market code “UAE to have market code blank.

First, if you don’t want to clear all records, “select” the required records.

SELECT CLIENTS WITH MARKET_CODE “UAE”

After a period of time, depending on the number of records in the file, it should briefly state the number of records selected and then return to the command prompt.

WARNING: If no records have been selected then ALL records will be updated by the following command!

CLEARFIELD CLIENTS MARKET_CODE

How to set a database field

In the following example we change all the clients where the market code is blank (has not been entered) to become “UAE”.

Warning: You can set the market code to a market code that does not exist. This will cause various problems in the operation of the system but is probably not irrecoverable.

First, if you don’t want to set all records, “select” the required records.

SELECT CLIENTS WITH MARKET_CODE “”

After a period of time, depending on the number of records in the file, it should briefly state the number of records selected and then return to the command prompt.

WARNING: If no records have been selected then ALL records will be updated by the following command!

CLEARFIELD CLIENTS MARKET_CODE/UAE

Configuring backup procedures

See the System Configuration File on the NEOSYS Support Menu. More explanation is at Configuring_NEOSYS_automated_backup

Non-Liability for Backup

If a NEOSYS client has not signed the standard NEOSYS contract which excludes liability then NEOSYS needs a specific agreement to the following:

Dear xxxxxxxx, 

NEOSYS has offered to setup a nightly backup of your NEOSYS data. 

We can only do this on condition that you will not hold NEOSYS liable for damages of any kind in the case that our backup procedure fails to 

meet its essential purpose in an emergency. 

You may make your own alternate parallel arrangements to ensure that the whole of the contents of the NEOSYS server are backed up sometime 

between 3am and 6am at night when NEOSYS system is shutdown. 

Please confirm your agreement. 

Best Regards, 
xxxx xxxx 
NEOSYS

Backing up the Images folder

The Images folder under the NEOSYS installation is used to upload images/artworks/files from the Job File section and hence needs to be backed up. NEOSYS will automatically backup this Images folder to the USB drive or other location (specified for the usual data backup) once a week. To configure this backup, RSYNC needs to have been installed during the initial installation.

In case we need to configure the Images folder backup at another location other than the usual daily backup location than we need to edit:

line 12 - and specify the Drive of the location to be backed up to. eg. E or F

Backup to other media (i.e. not to USB)

If the backup is going to non-removable media (even if it is a shared folder on another computer) then the NEOSYS user/client/licensee (NOT the NEOSYS support team) can, at their own responsibility, arrange to move (NOT COPY) the NEOSYS backup files from that location to a backup location of their choice and avoid the WARNING message : "Backup media not changed. Overwriting last weeks backup"

Sample alternative response to client requests for additional backups

The existing NEOSYS backup must continue to take place for safety because it is the only well understood standard, controlled and checked procedure in use for all NEOSYS clients.

You are free to setup and operate any additional backup procedure you like but NEOSYS cannot take any responsibility in setting up, monitoring or approving your additional backup procedure because it is beyond our sphere of control, expertise and trust.

What you can backup is the NEOSYS backups on the USB drive. These are readily available online at all times on the NEOSYS server for you to access and copy as you choose.

You can backup the usb anytime using anything you like, but you must not backup anything on any hard disk eg: C or D at any time.

Copying a single record from one database to another

You need to know the file name and record key of the record to be copied.

In this case the file is DEFINITIONS and the key is AGENCY.PARAMS

You can invent any old style 8.3 filename instead of C:\AGP.DAT in the following example

On the source computer:

F5
COPY DEFINITIONS AGENCY.PARAMS TO: (DOS C:\AGP.DAT)

On the target computer:

F5
COPY DOS C:\AGP.DAT (ON) TO: (DEFINITIONS AGENCY.PARAMS)

The (O) option is required to force overwrite of the existing

The (N) option means only copy if the target already exists. It is advisable to use it when you know that the target already exists to avoid misspellings in the command. It must be omitted if the target doesnt exist.

Allowing users temporary login as NEOSYS in maintenance mode

  1. Get them to login with any name even NEOSYS
  2. Get the to enter "?" for the pass without the quotes
  3. NEOSYS will give them a lock like "NEOSYS 123456" which they must give you. You should not log out until the next step is completed
  4. Follow the NEOSYS lock/key procedure using the full contents of the lock including the user name

(to allow access EXCEPT access to authorisation screen use a special number (not documented here) as the last number of the initial command)

  1. Give them the key and get them to enter and proceed

Configuring upload of photoshop "cs2" jpg files

Photoshop version "cs2" produces jpg files that cannot be viewed in Internet Explorer.

A solution is to rename the files extension from .jpg to .psjpg before uploading.

"psjpg" files are an invention of NEOSYS and IIS must be configured to handle .psjpg files as follows:

Windows Server 2003 (doesnt work on XP)

  1. Computer Management, Internet Information Server, Properties
  2. Click MIME Types
  3. Click New
  4. Extension: psjpg
  5. MIME Type: application/photoshop
  6. Click OK,OK,OK
  7. Restart IIS (Right click, All Tasks, Restart)

Enabling backup servers to access backed-up servers

This relates to a common procedure used by NEOSYS to provide automatic nightly synchronisation/backups between servers for multi-office configurations. For more information see http://itwiki.neosys.com/index.php/Setting_up_remote_backup

Αccording to this procedure, backup processes are actually initiated and run on a "backup server" using a "pull" concept. The "backed-up server" serves the data (usually using an rsync service) to the backup server on request. They do not use a "push" concept.

This means that backup servers need to be able to automatically login to the backed-up servers. On most backup servers a NEOSYS cygwin script called autologin.sh has been installed. This helps you configure the backup server and backed-up server.

Normally you only need to run autologin.sh once per pair of backup and backed-up servers but sometimes the configuration is lost (particularly when NEOSYS is upgraded) and it must be repeated.

Using autologin.sh

  1. Asks you for the username and hostname
  2. Copies an identity file from the backup server to the backed up server.
    This requires you to enter the administrator or root password.
  3. Logs you in to the backed up server's cygwin/bash command line.
    This requires you to enter the password again.
  4. YOU then type a series of commands to install the identity file and finally exit the command console.
    The series of commands that you must type are shown on screen by autologin.sh
  5. Logs you in to the backed up server's cygwin/bash command line.
    This time, you should NOT be required to enter a password.
  6. YOU type "exit" to quit the backed up server's command line.

Running ./autologin.sh

In cygwin on the backup server, you can use any of the following syntax depending on your configuration:

Syntax

./autologin.sh targethostname targetusername sshport
  • host and user will be prompted for if omitted
  • port will be 19580 if omitted

Example using prompting for parameters

./autologin.sh

Example using default user and port (administrator/19580)

./autologin.sh examplehost.neosys.com

Example with different user (port will be 19580)

./autologin.sh examplehost.neosys.com Administrator

Example with different user and port

./autologin.sh examplehost.neosys.com Administrator 19580

Follow instructions on screen.

The system will ask you once the password to the target server to transfer an identity file and once again to access the command line of the target server from where you must follow a set of instructions in order to load the identity file properly.

The username is usually administrator for windows server targets.

The hostname can be found in backup email logs or in the CONFIG.CMD file in the backup server.

There are often two alternative hostnames. Try the first one first. If you succeed with the first then there is no need to try the second.

Sometimes one of the host names is based on alternative network access methods like hamachi which uses ip addresses starting with "5." and requires hamachi service to be running in both servers and this sometimes is dependent on being logged in and correct setup of hamachi. You can ping the host names to discover the ip numbers of course.

Follow the instructions on the screen VERY carefully.

Checking if autologin is configured correctly and working or not

On the source system, in cygwin console, type something like the following, changing port number, administrator and clientname to suit the case.

ssh –p 19580 administrator@clientname.neosys.com

After a few seconds, if it is working properly, it should give you a command prompt on the target system. This indicates that autologin was successful. You may exit using the command:

exit

Otherwise, if it gives some error and in particular if it asks you anything at all, for example “confirm fingerprint?” or “password?” then autologin is not working.

You can then type in the following command in cygwin to configure or reconfigure autologin:

./autologin.sh

The edit step

The last step will enter the nano editor where you should do the following:

If present, delete the word neosys near the end of the last line of the file. The last bit of the last line will refer to some user and host that you are enabling access FROM

BE CAREFUL NOT TO TRIGGER THE AUTOMATIC LINE BREAKING IN NANO because line breaking into two or more lines is automatically triggered when you add characters to long lines. it is not triggered if you just delete characters. If you do cause a line break then quit the editor WITHOUT saving and try again or then use the editor to rejoin the two lines. Note that pressing Alt+L will turn long line breaking off and on which avoids the problem in the first place.

Press Ctrl+X to exit the editor

Creating/Upgrading autologin.sh if it doesn’t exist or is out of date

nano autologin.sh
chmod +x autologin.sh
#!/bin/bash

set -e

REMOTEHOST=$1
REMOTEUSER=$2
PORT=$3

test $REMOTEUSER || REMOTEUSER=administrator
test $PORT || PORT=19580

if [ ! $REMOTEUSER ]; then
echo -n "Remote User (blank=administrator)/root?"
read REMOTEUSER
if [ "$REMOTEUSER" == "" ] ; then REMOTEUSER=administrator ; fi
fi

if [ ! REMOTEHOST ]; then
echo -n "Remote Host? "
read REMOTEHOST
if [ "$REMOTEHOST" == "" ] ; then exit; fi
fi

echo PASSPHRASE MUST BE BLANK IF YOU GET ASKED FOR IT!
#Generate priv/pub keys in .ssh if not already done
#Priv key mustnt be accessible except to owner otherwise wont work.
test -f ~/.ssh/id_dsa || \
ssh-keygen -t dsa -b 1024 && \
chmod 600 ~/.ssh/id_dsa

echo
echo "Logging in to the remote server (enter the pass again)"
sed 's/neosys//' ~/.ssh/id_dsa.pub | \
ssh -p $PORT $REMOTEUSER@$REMOTEHOST \
"mkdir -p .ssh ; chmod 700 .ssh ;\
cat >> .ssh/authorized_keys ;\
chmod 644 .ssh/authorized_keys"

echo
echo "Test automatic login to the remote server"
echo " SHOULD NO LONGER ASK FOR PASSWORD."
echo " IF SUCCESSFULL, TYPE exit"
ssh -p $PORT $REMOTEUSER@$REMOTEHOST

System Configuration File

Scope

  • All Installations
  • Current Installation (default)
  • Current Database

You can configure most items at the above “scopes”. Any item configured on higher/broader scope has priority over the same item on a lower/narrower scope.

Assigning higher priority to higher/broader scopes allows us to override any and all individual installations/databases configurations with a particular configuration of our choosing. However it does not allow us to set a default configuration for all installations/databases and then separately configure each one where desired. That would require NEOSYS to assign priority to lower/narrower scopes – which it doesn’t do.