Author Topic: Configuration backup  (Read 58197 times)

fabos

  • Newbie
  • *
  • Posts: 2
Configuration backup
« on: November 27, 2011, 02:09:08 am »
hi,

I've created restaurant menus, inserted items, inventory, departments and recipes and make a lot of tests.
the problem now is that I nees to start up a fresh installation with all the configuration made but without the testing data of ticket and bills 

How can I copy only the configuration data to a fresh installation? how can I make separated backups of configuration and data?


thanks for your support

fabio

emre

  • SambaPOS Developer
  • Samba Team
  • Hero Member
  • *****
  • Posts: 1564
Re: Configuration backup
« Reply #1 on: November 28, 2011, 09:54:26 am »
Hello fabos.
If you didn't take a backup before adding test data you won't be able to rollback to the previous state.
Backing up or clearing transaction data is not supported in current release.

If you are familiar with SQL databases you can try clearing transaction tables (Tickets,TicketItems,Payments) manually with SQL Management Studio.

balitaly

  • Newbie
  • *
  • Posts: 2
Re: Configuration backup
« Reply #2 on: December 07, 2011, 10:23:56 am »
hi to all,
i've the same problem, during the settings i've made many simulations of bills and purchase ingredients. now if i want start to use the software in my restaurant how can i have a clean version without lose all the settings? i could instal again the software, but make again all the settings is a very long process and also i can not remind all the settings that i did before.... i tried also to clean the data base with sql management studio, but i can not open the file.... any suggestion?

emre

  • SambaPOS Developer
  • Samba Team
  • Hero Member
  • *****
  • Posts: 1564
Re: Configuration backup
« Reply #3 on: December 08, 2011, 11:05:40 am »
Hello balitaly,
Normally we create backups before entering trial data and restore it before real usage.

I attached a SQL Script for you to clear all transaction data from database. If you run this script it will keep your settings but clear all tickets, work periods etc.

USE IT AT YOUR OWN RISK...
Take your backups before running this script. It will not generate backups. It will clear data without confirmation.

For SQL Server Express you can easily create backups and execute it with SQL Management Console.

If you are using SQL Compact Edition (CE) you can download a handy Management Tool from http://sqlcetoolbox.codeplex.com/ website.

The SQL CE database file stored under MyDocuments\SambaPOS2 folder. Create a copy of SambaData2.sdf file to create a backup

After running SQL CE Toolbox application:
  • Right click on "No SQL Connections found .... etc" title on the right and click "Add .. Connection" (First item). A popup window will appear.
  • Click [Browse] button, locate SambaData2.sdf file.
  • Click [Close] button at the bottom of the screen.
  • Popup window should disappear and you should see your database file listed under connections list.
  • Right click on the file name and click "Open SQL Editor". This will display an editor screen on the right.
  • Click "Open" from toolbar and locate script file (dtran.sqlce).
  • Click Execute...

For security reasons we didn't implemented that feature inside sambapos application but we'll implement "Training Mode" on further releases so you'll be able to enable training mode when needed.
« Last Edit: December 08, 2011, 11:17:16 am by emre »

JohnS

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 677
Re: Configuration backup
« Reply #4 on: January 28, 2012, 10:58:19 pm »
Emre,

Would it be possible to setup a training mode by

- Set an option in Local Settings to Copy Live Database to Training Database - with an 'Are You Sure' prompt.
- Setting a Live/Training toggle on the login screen
- When Training is selected, the Local Settings get changed to the Training Database settings.
- You login with your pin number and use the system as normal - Training Mode is either watermarked across the screen or at the top/bottom of the screen.
- When you log out, and select Live, the system changes Local Settings back to the Live database.

This means that you overwrite the Training Database as required, not automatically. Gives better control for experiments and customization. Also means that this would be a terminal by terminal setting, so you would not impact other uses on a production system while testing.
SambaPOS - POS'n the World, one Terminal at a time.

jenem

  • Full Member
  • ***
  • Posts: 154
Re: Configuration backup
« Reply #5 on: January 29, 2012, 01:50:36 am »
Hi John,

Good idea!!

Edgar

emre

  • SambaPOS Developer
  • Samba Team
  • Hero Member
  • *****
  • Posts: 1564
Re: Configuration backup
« Reply #6 on: January 29, 2012, 09:01:46 am »
I liked the local training idea. It will be fine for training new users on a production environment with real data. My idea was starting a "Training Work Period" from management and reverting everything back when that work period ends. What do you think about that?

jenem

  • Full Member
  • ***
  • Posts: 154
Re: Configuration backup
« Reply #7 on: January 29, 2012, 09:41:40 am »
Hi Emre,

Could a default user called trainer be created that once logged in worked on a read only copy of the data base and not the actual one?

ie real database
 training data base copy

That way the copy database would show everything that is on the main database but not write ticket or stock values to original data base

Just a thought  :)

Edgar


JohnS

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 677
Re: Configuration backup
« Reply #8 on: January 29, 2012, 02:24:07 pm »
"Training Work Period"

I like that. But can you keep stock consumption, and tickets info separate from the live data? Wouldn't all users then be in training mode if using "Training Work Period" since you can only have one work period running?

Duplicating the database gives you full run of all data to experiment with, not only for training but development of promos, and other features. Having a single terminal logging into training mode means you can train during working hours.
SambaPOS - POS'n the World, one Terminal at a time.

chrismint

  • Business Group
  • Newbie
  • *****
  • Posts: 9
Re: Configuration backup
« Reply #9 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

emre

  • SambaPOS Developer
  • Samba Team
  • Hero Member
  • *****
  • Posts: 1564
Re: Configuration backup
« Reply #10 on: January 30, 2012, 04:25:14 am »
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

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

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 677
Re: Configuration backup
« Reply #11 on: January 30, 2012, 06:25:24 am »
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.
SambaPOS - POS'n the World, one Terminal at a time.

emre

  • SambaPOS Developer
  • Samba Team
  • Hero Member
  • *****
  • Posts: 1564
Re: Configuration backup
« Reply #12 on: January 30, 2012, 12:50:23 pm »
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

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 677
Re: Configuration backup
« Reply #13 on: January 30, 2012, 09:47:44 pm »
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.


SambaPOS - POS'n the World, one Terminal at a time.

JohnS

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 677
Re: Configuration backup
« Reply #14 on: January 31, 2012, 06:16:24 am »
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.
« Last Edit: February 01, 2012, 06:34:48 am by JohnSCS »
SambaPOS - POS'n the World, one Terminal at a time.