[RESOLVED] Restore backup - Access denied

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.

To get around this you could restore it in management studio and allow overwrite in options from within management studio when restoring.

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.

Thanks guys.

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.

I tried the below method.

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.

if its restoring it with success then the backup your restoring probably does not contain the data you thought you backed up. Are you certain thats the file?

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.

delete all the databases with mssms then right click on databases and restore it that way. Do not create a new one first. Just restore.

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

let me try it as admin; although, user ‘shomi’ is set as the admin.
i’ll log in with SQL server authentication

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:

1 Like

ok ran as admin with the same unsuccessful result. i’m going to try resetting the connection string as you suggest. thanks for all the prompt help. i’m amazed at how fast i’m getting these responses.

getting an error msg upon opening sambaPOS. erase settings and proceed?

What message are you getting? I didnt say erase anything in the connection string just add Database=sambatest to it. Show me the error please.

LOL sorry I was afraid you mght do that. Let me explain better. Your connection string should look exactly like it did before but you add Database=sambatest to end of it. Example in sec…

Data Source=mancow2\SambaPOS; Database=DairyCreme;

Where mine says Database=DairyCreme you would put Database=sambatest rest of connection string should be for your system.

mancow2 would be your computername SambaPOS is the instance name. Looks like your instance is SambaPOS3

Yours should look something like:

Data Source=Shomi-PC\SAMBAPOS3; Database=sambatest

hallelujah!
that did the trick
I’ve got the backup file successfully restored with the data intact.

1 Like

Great glad we could help you.

so in the future when i add more terminals, i should just string to the database name ‘sambatest’ specifically. now that the database name is sambatest. if i don’t will there be a conflict of databases?
Also, would i be understanding it correctly if i’m thinking that the problem i had was due to conflict of databases based on their names?

Your correct on both. you can change the name btw just rename it in mssms then set string to new name and restart

1 Like