English Boards > Tutorials

Configuration backup

<< < (3/5) > >>

emre:

--- Quote from: chrismint on January 29, 2012, 03:24:59 pm ---Hi,

From a usability point of view either a training user that would allow you to play around without affecting trading figures, or a toggle to put a terminal in training mode temporarily would be best.

I think as there are two situations were you'd need this - training new staff and testing a system - the best solution would be as follows.
- an option to set a particular user as a training user, in which case anything they do doesn't get logged on final sales stats and any print outs are highlighted as being training only.  This would allow you to train new servers without affecting sales figures
- an option to set a terminal as being a dummy terminal.  Ideally this would allow you to test everything including opening and closing periods.  Again without affecting sales figures.  Maybe just adding a flag to each entry whilst in this mode and an option to delete any entries flagged with this?

Chris

--- End quote ---

I agree doing it locally is a great benefit. So the best solution seems doing it like John suggested. I noted that. I have to think about if we'll need enabling it for the entire network.

JohnS:
Quick update.

I have created two batch scripts to replicate the live database to a training database, and enable and disable 'Training Mode'

Replicatedb.bat - copies the SambaPOS SQL files to a new SQL Instance called SambaPOSTrain
Sambatrain.bat - changes the SQL database settings in SambaSettings.txt to SambaPOSTrain and runs SambaPOS. When you exit, the script changes SambaSettings.txt back to SambaPOS live database.

Its means now you have three icons as follows

1. SambaPOS Production (normal SambaPOS)
2. Replicate Production Database to Training Database
3. SambaPOS Training

This is easy when its all on the same machine. I haven't tried it yet with a network server, but I can't see any reason why it will not work.

This way you can train a user on an exact copy of the live database without interrupting any other users, without any impact to the Live data, and with all restrictions (User Roles) in place for that user.


Emre,

Firstly I am not a MSSQL DB expert, but I do know MYSQL, so here's my suggestion for a solution from your side.

With SQL Express, the Table Data is located in Databases/SambaData2/Schemas/dbo/Tables.
Could we create create another 'Tables' group under 'dbo' and call it 'Tables2'. Then under Local Settings in Manage have another tab for 'Training DB' with the option to replicate the data from 'Tables' to 'Tables2' (Live to Training) to update the training database with the latest live data.
Then on the login screen have a 'Training Mode Toggle' that when a user selects training and logs in it uses the 'Tables2' data.
When finished training, Log out and log back in for the live system.

Could that work? Because we are not changing databases like my example above, it should be seamless, fast and almost fool proof.
It allows for a single terminal to be in training mode while the other terminals are trading, and it allows testing of configuration changes before you make the changes to the live system.

emre:
John AFAIK with SQL server we can't add another tables group. I can think three options. We can create additional database, a new schema or duplicate all tables with a prefixed name. 

In fact I have a problem with directly modifying SQL databases. On SambaPOS all tables are auto generated and I really don't know what tables we have or any detail about them. I have to do it without knowing it because on further releases I want to support more databases or different kinds of data transferring solutions. For this reason I need a solution that will work with any database. I'll try to find a solution for duplicating data to a local SDF file. I can't remember if we talked about it or not but I have plans about hosted online database solutions. We'll need something similar there but it will work in reverse direction :)

JohnS:
Ok, while you investigate what options may be available from a coding point, I will document how to create a training mode setup for MSSQL using batch files to manipulate the databases.

Is there an easy way to add command line options to SambaPOS ? For example add a '/t' to tell SambaPOS that this is a training session and it displays 'Training' at the top of the screen.
Or better still '/t [terminal name]' to assign a terminal name like 'Restaurant Bar' to the top of the POS screen? Have it read the terminal name from settings and if we don't define a name when launching SambaPOS then it displays the terminal name.


JohnS:
Drum roll please.........

Welcome to SambaTrain.

This has been moved to its own post in the forum.
http://forum2.sambapos.org/index.php/topic,184.0.html

What I have created is a tool to enable a Training Mode on SambaPOS.
What the tool actually does is to copy the SambaPOS Microsoft SQL Express 2005/2008 Server instance to a Microsoft Compact SQL Server database file, and change the SambaPOS data source settings automatically with the click of a single icon and once you exit SambaPOS, the data source settings are returned to the live settings.

You only need to edit two files to set your SQL Express Server name and SambaPOS database instance name (and User Id & Password if required) which you can get from SambaPOS -> Manage - > Local Settings -> Data Connection String. ie, localhost\SQLEXPRESS

You can have the database refresh each time you run Training Mode, or to refresh on-demand if you are developing new features, or expanding the POS system.


Consult the Read Me file for more info.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version