How to import a prebuilt database into sambapos

Hello, I’m new to samba POS and I was interested in using a prebuilt database specifically the one labeled “Quick Service/Tables: Food/Retail Setup - Advanced Refunds | Aborts | NonTax Functions” however this file downloads as a zipped file with a .BAK type file in it. I purchased the database tools and databasebackup modules in the hopes that I could use them to import the database but I believe the files need to be modified first. I am really very lost with all of this and would love to be able to use sambapos in a retail setting. Any help on the matter would be greatly appreciated.

They do not need to be modified but pay attention to the version of SambaPOS listed and the version of SQL server used both of those have to be the same as what your using. Once you import it and get it working you can upgrade to newer versions of Samba and it will auto update the database.

Yea I downloaded and installed the proper version. My issue is more with the method of importing the database. I copied the zipped file into the database backup folder but it wont let me restore from it. I tried using the import tool also but it just says it imported but no changes followed. Is there a proper way to put the files into the backup folder or am I looking at the whole thing in the wrong way?

@lambo1216 backup zip files should named properly to appear in the list. You can create a backup and you can rename zip file to replace that file.

For next version I’ll add Open Zip File function to backup module for easier solution. Thanks.


Ok so I created a backup file and replaced it with the downloaded zip folder renamed and all. But an error showed up and the system closed out. Upon restarting sambapos I get the error “An error occurred while initializing the database. See the innerexception for details.” I looked through all of the folders I could find for samba but cant find anything related to innerexception.

Copy and Paste the Error here in the Forum. The Inner Exception is part of the error report.

[General Info]

Application: SambaPOS
Version:     4.1.55
Region:      en
DB:          CE
Machine:     USER-PC
User:        user
Date:        10/28/2014
Time:        10:10 PM

User Explanation:

user said ""

[Exception Info 1]

Top-level Exception
Type:        System.Data.DataException
Message:     An exception occurred while initializing the database. See the InnerException for details.
Source:      EntityFramework
Stack Trace: at System.Data.Entity.Internal.InternalContext.PerformInitializationAction(Action action)
   at System.Data.Entity.Internal.InternalContext.PerformDatabaseInitialization()
   at System.Data.Entity.Internal.LazyInternalContext.<InitializeDatabase>b__4(InternalContext c)
   at System.Data.Entity.Internal.RetryAction`1.PerformAction(TInput input)
   at System.Data.Entity.Internal.LazyInternalContext.InitializeDatabaseAction(Action`1 action)
   at System.Data.Entity.Internal.LazyInternalContext.InitializeDatabase()
   at System.Data.Entity.Internal.InternalContext.ForceOSpaceLoadingForKnownEntityTypes()
   at System.Data.Entity.DbContext.System.Data.Entity.Infrastructure.IObjectContextAdapter.get_ObjectContext()
   at Samba.Infrastructure.Data.SqlData.EFWorkspace..ctor(CommonDbContext context)
   at Samba.Persistance.Data.WorkspaceFactory.Create()
   at Samba.Presentation.Bootstrapper.InitializeShell()

Inner Exception 1
Type:        System.Data.EntityException
Message:     The underlying provider failed on Open.
Source:      System.Data.Entity
Stack Trace: at System.Data.EntityClient.EntityConnection.OpenStoreConnectionIf(Boolean openCondition, DbConnection storeConnectionToOpen, DbConnection originalConnection, String exceptionCode, String attemptedOperation, Boolean& closeStoreConnectionOnFailure)
   at System.Data.EntityClient.EntityConnection.Open()
   at System.Data.Objects.ObjectContext.EnsureConnection()
   at System.Data.Objects.ObjectContext.ExecuteStoreQueryInternal[TElement](String commandText, String entitySetName, MergeOption mergeOption, Object[] parameters)
   at Samba.Persistance.Data.Initializer.InitializeDatabase(DataContext context)
   at System.Data.Entity.Database.<>c__DisplayClass2`1.<SetInitializerInternal>b__0(DbContext c)
   at System.Data.Entity.Internal.InternalContext.<>c__DisplayClass8.<PerformDatabaseInitialization>b__6()
   at System.Data.Entity.Internal.InternalContext.PerformInitializationAction(Action action)

Inner Exception 2
Type:        System.Data.SqlServerCe.SqlCeException
Message:     The database file may be corrupted. Run the repair utility to check the database file. [ Database name = C:\Users\user\Documents\SambaPOS4\SambaPOS4.sdf ]
Source:      SQL Server Compact ADO.NET Data Provider
Stack Trace: at System.Data.SqlServerCe.SqlCeConnection.ProcessResults(Int32 hr)
   at System.Data.SqlServerCe.SqlCeConnection.Open(Boolean silent)
   at System.Data.SqlServerCe.SqlCeConnection.Open()
   at System.Data.EntityClient.EntityConnection.OpenStoreConnectionIf(Boolean openCondition, DbConnection storeConnectionToOpen, DbConnection originalConnection, String exceptionCode, String attemptedOperation, Boolean& closeStoreConnectionOnFailure)


[Assembly Info]

PresentationFramework, Version=
System.Xaml, Version=
Microsoft.Practices.Prism.MefExtensions, Version=
mscorlib, Version=
System, Version=
WindowsBase, Version=
System.Configuration, Version=
Samba.Services, Version=
Samba.Presentation.Services, Version=
Samba.Presentation.Common, Version=
Samba.Domain, Version=
PresentationCore, Version=
DevExpress.Xpf.Core.v14.1, Version=
Microsoft.Practices.ServiceLocation, Version=
Samba.Infrastructure, Version=
Microsoft.Practices.Prism, Version=
System.ComponentModel.Composition, Version=
System.Core, Version=
Samba.Localization, Version=
FastButton, Version=


[System Info]

Operating System
-Microsoft Windows 7 Ultimate
--CodeSet = 1252
--CSDVersion = Service Pack 1
--CurrentTimeZone = -240
--FreePhysicalMemory = 235696
--OSArchitecture = 32-bit
--OSLanguage = 1033
--ServicePackMajorVersion = 1
--ServicePackMinorVersion = 0
--Version = 6.1.7601

--Manufacturer = Dell Inc.                
--Model = Precision WorkStation 380    
--TotalPhysicalMemory = 1071808512
--UserName = user-PC\user


######################### E N D #########################

I looked through the logs for the errors but I have no idea what it is I’m looking at.

I think you’ve renamed it backup to a sdf or for a reason it tries to open SambaPOS4.sdf.

Rename or Delete this file. Restart SambaPOS. Configure it to run with SQL Server and restore your backup. As that sample backup is an SQL Server backup you need to install SQL Server.

What I have been doing is using the latest samba just attach the prebuilt database in ms sql then I would run Samba to get an error. I would then just delete the samba setting files under the hidden program data folder under c:\ . Then It would work.

Sort of off topic but since my Database was brought up I thought I would share this. I will be finishing a package of Database Tools Import Files that will basically build that database in a cleaner easier to manage way. I am nearly done. This will give you the option to import everything and try it out or import just what you want to try. I think this approach is better for most people that are clueless to managing SQL server instances. I should be done in next few days with my compilation. This will also allow you to import it right into your own database or you can start a fresh one to play around with it.

I have already released pieces of it in This Thread The Time Clock is the first portion I have released already.

These are simple to import. All you need is to purchase the Database Tools module from Samba Market and then Import the Txt file that is inside the zip of the file you wish to import.


Wow that would be unbelievably helpful! I was just attempting to work through the SQL server stuff and i will continue and mess around with it until you are done. Thank you all so much for the help!

Was there any update on the Database Tools Import Files?

I have released 3 pieces of it so far. The part you probably want which deals with states etc I am working on accounting atm. I have been very busy lately so I have not had much time to really mess with it. Today hopefully I can finish it up.

The Autoprint is a critical function of it and I redid how it works so it is more dynamic and less specific. I released Autoprint already you can take a look. It may not make sense now but it is a crucial part to my Dine-in/Togo and returns system.

So far i have released these pieces of my system as Database Tools Files

  1. TimeClock
  2. AutoPrint
  3. Fast Cash Buttons

By end of today I should have my ToGo/DineIn package finished. The returns function might take little longer I am still working on its accounting.