nvdweem / intellij-sqlserver-backup-restore

Plugin for Intellij that allows backing up and restoring databases in SQL Server
MIT License
14 stars 3 forks source link

Backup always adds backslash "\" prefix to file name #18

Closed nhatminhbui closed 2 years ago

nhatminhbui commented 2 years ago

Backup always adds backlash \ to file name that makes the file path become incorrect on Linux machine. For example: /home/nhatbui/projects\backup.bak.

nvdweem commented 2 years ago

@nhatminhbui I think I see this happening but for me it doesn't seem to be a problem. Is the backup command failing for you?

I'm expecting that the BACKUP DATABASE [name] TO DISK = N'/some/folder\test.bak' WITH ... command fails for you but it doesn't for me. I tested this on a Windows and Linux machine with mcr.microsoft.com/mssql/server docker images. Both the 2017-latest and 2019-latest seem to work just fine (the 2017 won't start on my Linux machine so was unable to test that combination).

If it's that one command that doesn't work I should be able to make a quick and dirty fix to just replace the backslashes with forward slashes but I'd like to know whether that's actually your issue.

nhatminhbui commented 2 years ago

The BACKUP DATABASE command works fine with backlashes!

I forgot to give the SQL-Server permissions to write on my disk, so the backup didn't work. My bad.

nvdweem commented 2 years ago

Good to hear that it does actually work :) When I have time to spend some more time on the plugin I'll see if I'm able to pick up on the error message from SQLServer. I'd expect it shows something that might be informative enough to have pointed you in the correct direction for a fix :).