SQL script to create SambaPOS5 database from scratch

Hello everyone,

I am planning to update my SambaPOS system, and I’ll take that opportunity to rationalize the ressources, better for my electricity bill and easier for my UPS - we experience almost daily power failure.

Right now I have max 4 waitresses working together and 4 computers.

  • Compu 1: Server (DB) + client <-wifi-> RDP on tablet
  • Compu 2: client <-wifi-> RDP on tablet
  • Compu 3: client <-wifi-> RDP on tablet
  • Compu 4: client <-wifi-> RDP on tablet

New system, 1 computer (i7700 + 16 GB) runnig proxmox:

  • 1 LXC container - debian 11 running mssql 2019.
  • 4 Windows 7 Virtual Machines running client.
    that configuration works well and is really low on ressources.

Now, the next step is to install the last SambaPOS5 database onto the mssql 2019 server.
Is there such a sql script available?

Thanks

Marc

1 Like

When properly configured, the SambaPOS desktop application will automatically create the database and populate it with default data. From there you can restore a backup.

yes, that was my idea if not script exists.
Installing win10, sql server 2019, installing sambapos, and … finally “copy/paste” SambaPOS5" to mssql 2019 on debian.

Gotcha. What version of SambaPOS are you using? I should be able to generate the create scripts for you.

The last one, the one of today.
Does sambapos “ask” the location of mssql server during installation? I don’t remember, I don’t think so.

5.5.4 then. Give me a few minutes I’ll let you know if I can come up with anything.

Actually it’s sambapos setup 556 (don’t know if using same database version as 554)

I don’t see 5.5.6 in the releases

image

But I’ll get you the 5.5.4 schema and default data and SambaPOS can update the db if needed.

here you go

5.5.4_default_db_scripts.zip (64.3 KB)

trying now!
OK, I created a new database SambaPOS5 on mssql on debian and run your script:

The database update succeeded

I’ll now install the latest version of samba pos and try to connect to that database, I’ll let you know, thanks a lot.

Latest sambapos is 5.5.6 we released yesterday. No release notes yet.

Ok, it turned out that my question was irrelevant.

I don’t need the SambaPOS5 database creation script at all.

Like on a full-windows install, I just need to install Sambapos on one fresh windows, enter and configure the connection string (for the first time), and the next time I start SambaPOS, it will create SambaPOS5 database if it does not exist.
The fact that mssql runs on debian has no impact.

I’ll now dig message server and backup path.

2 Likes

I just need to install Sambapos on one fresh windows,

I had kind of thought so, but who knows lol

Message server can run on any of your windows clients. I’m not sure if it’ll run under WINE. The backups may be more of a sticky wicket.

When I enter /path/to/somthing in the application it is converted to a full path string. The same happens if I modify the settings file directly:
image

The path is passed to the db engine so it’ll need to be a relative path on the db server.

would be great if you can share hows your experience on installing sambapos on Linux based mssql server, and how well sambapos works during operation, any odd behaviour ?

for backup path, are you using samba to share the path as windows drive?

Works well and fast, no odd behavior

1 Like

Backup does not work by default.

sql server is on debian and the backup will be done there, not on the windows client.
You cannot change the backup directory with sambaPOS as it will add automatically "C:"

You can modify manually C:\ProgramData\SAMBAPOS\SambaPOS5\DatabaseToolsSettings to setup the linux directory where backup will be done, eg. /tmp:

{"AllowRecovery":false,"AllowReplace":true,"AutoCreateBackups":true,"AutoCreateBackupsOnImport":true,"AutoCreateBackupsOnMigrate":true,"BackupLocation":"/tmp","ConnectionString":"",

And you’ll find your backup on the linux machine under /tmp

root@mssql:/tmp# ls -lh
total 13M
-rw-rw---- 1 mssql mssql  13M Feb 24 11:20 SambaPOS5_Full.bak

So in order to restore a backup - I guess that you would have to:

  1. copy that file on your windows machine
  2. zip it with a new name
  3. move that zip file to the default SambaPOS5 backup directory
  4. Restore the backup directory to its default value in SambaPOS (database backup>settings)
  5. And finally restore you backup

I did not try yet.

the backup path should be understood by both linux and windows and as the path refers to one setting and that’s not possible, even with samba.
instead of /tmp, you could use /mnt/windows_share but you will end up with the same issue to restore your backup: zipping the file and changing backup path in SambaPOS.

1 Like