So I am migrating my samba DB from one machine to another. I have the Database Backups Module from the market. I have made a backup on the original machine, and now I am trying to restore it on the new machine. However, an error occurs during the process.
I added the Everyone group to the permission settings for the backup file, but no luck. I don’t know if I need to change some permission/log-on settings for the SQL server or samba? I don’t fully understand the Windows permission model.
Move the backup file from a user account folder to just a generic folder. And then try it. Maybe move it to something like c:\sambabackups\
When you deal with user folders they have inherent permissions that can get tricky if your trying to access it from a program.
Do not set it to backup into a user folder. Create a specific folder for this. Preferably read the PS below.
PS: Kind of off topic but related - You really should avoid messing with permissions in User folders… you can cause all sorts of havoc. I recommend saving backups to an external drive like a Jump drive or external hard drive you can attach and detach. You can encrypt the entire drive for data integrity and security when you are live if that’s important to you.
Oh, of course. I’m sorry, I somehow did not see that.
Unfortunately, I have hit another snag
I assume this is referring to the SambaPOS4 database. I guess I could create a new DB via the management studio, change the DB name setting in samba, delete the SambaPOS4 DB via the management studio, then do a restore. And I think then that means there would be a new DB named SambaPOS4.
Is this how I should go about resolving the issue?
Yes it is a great solution. Also it won’t restore it as SambaPOS4. It will restore it to new database that have new name. Allow overwriting... setting does that. However as it have to restore it as SambaPOS4 before renaming, it creates an error as SambaPOS4 is already active.
Ok, that works great. I didn’t see the restore option in management studio. So I created a new blank DB in management studio, changed the name of the DB in the Database Backups module. Reloaded samba, did a restore, removed the DB name, then deleted the temporary DB in management studio.
looking for a solution to a similar problem as @kimbokasteniv
I’ve tried restoring within management studio with overwrite with no success. also, tried restoring within samba with added backup tool with similar error message and failed. what could be causing the problem? I will try creating a new database in management studio as the OP has done, restoring, and then renaming manually.
Looked great as far as getting the ‘successful restore’ message within samba database backup module. But when I checked the products and entities that I had changed and backed up, none were restored to the back up. now I’m a bit panicked because I think there may be no way to restore to the previous database.
yes i am certain. i backed up with database backup module just before data connection string change to sql server. just to be certain ive restored to another backup file I had created few days ago which had some changes made to the default Samba POS. that did not restore the backed up changes i had made to that point.
Unless there are different types of backup that i specify before i create a backup file, i believe i properly backed up.
additionally, i tried the following:
1.create a new DB ‘SambaPOS4_1’ using SQL server studio
2.changed database name within database backup module setting to ‘SambaPOS4_1’ then closed the program.
3.deleted the original DB ‘SambaPOS4’ using SQL server studio
4. Still in sql server studio, i tried restoring (w/ overwrite) to the .bak file with no success got error message
oddly, i can run sambaPOS backup module and get ‘successful restore’ message restoring to the same .bak file, but with no data actually restored.
suggest trying anything else (short of rebuilding the product, the entity, the user, and everything else)
I’ve lost all data for good if i cant recover the .bak file.
when you say all databases, do I include ‘system databases’ also? or do i leave that be?
just attempted the suggested:
1.with mssms, deleted ‘SambaPOS4’ database
2. right clicked on ‘Databases’ and restored database
3. selected overwrite option and chose the .bak file i need to restore to
4. encountered error
no leave that. Just the ones under that the samba databases. If it succeeds in restore after this but you still do not have your data then that means you did not backup your data like you thought you did. I can not explain what might have happened but sql backup is pretty straight forward it would not miss parts of a database.
Maybe start MSSMS as admin. It does not have permission to your users dir. Looks like your main file was stored there on your other instance. This one does not have access to write there.
try this. Load sambapos. set your connection string the same except tell it Database=sambatest
Logout close samba… open mssms delete all databases again. Then start sambapos and then try restore with overwrite
Try what i said in previous post… honestly though i have feeling you never backed up lke you thought you did. If the backup file said success in sambapos then that means it loaded and if it did not have the config you thought you had… then that backup file simply does not contain it. Means you backed up to a different file or somehow you were mistaken with the point you backed up.
Windows starting with windows 7 does not give you true admin even if you set it as admin. YOu must right click the program and run as admin. It may not make a difference in this case though. Windows locks users dir down pretty tight. But definitely try what i said here: