and click "Run". It will create all databases you will require.
2. Once databases are created, and backups are uploaded to /var/opt/mssql/backup, right-click on database and follow these steps: Step 1: "Account" database -> "Tasks" -> "Restore" -> "Database..."
Step 2: Select "Device" -> Click on 3 dots (in image marked as 2) -> Select "Add" -> Once window opens, click on "backup" and select Account.bak file -> Click "Ok"
[outcome will be like picture]
Step 3: Select "Options" (1) -> Tick "Overwrite the existing database (WITH REPLACE) (2). If you have "Take tail-log backup before restore" -> DESELECT IT. It has to be as show in the image below -> Click "Ok" and wait till database restores.
Now repeat the STEPS ABOVE for all databases until they are fully restored.
Old method for 2017 MSSQL - reported problems - NOT ADVISED TO USE IT:
Spoiler:
Once you have done all points in Database Installation part, follow these simple to restore your database using PuTTy Terminal, which is simple copy-paste + enter.
4. Using the following line in PuTTy terminal, you will create a database and restore it at the same time, without the need to login to SSMS Management and create everything there, as show in this sample:
Code:
sqlcmd -S localhost -U SA -Q "RESTORE DATABASE [Account] FROM DISK = N'/var/opt/mssql/backup/Account.bak' WITH FILE = 1, NOUNLOAD, REPLACE, STATS = 5"
Copy paste the following lines in the spoiler below to restore full database.
*Important: after each line, you will be prompted to input database password.
Spoiler:
Code:
sqlcmd -S localhost -U SA -Q "RESTORE DATABASE [Account] FROM DISK = N'/var/opt/mssql/backup/Account.bak' WITH FILE = 1, NOUNLOAD, REPLACE, STATS = 5"
Click Enter -> Input your database password -> Click Enter -> Done!
Code:
sqlcmd -S localhost -U SA -Q "RESTORE DATABASE [Authentication] FROM DISK = N'/var/opt/mssql/backup/Authentication.bak' WITH FILE = 1, NOUNLOAD, REPLACE, STATS = 5"
Click Enter -> Input your database password -> Click Enter -> Done!
Code:
sqlcmd -S localhost -U SA -Q "RESTORE DATABASE [CabalCash] FROM DISK = N'/var/opt/mssql/backup/CabalCash.bak' WITH FILE = 1, NOUNLOAD, REPLACE, STATS = 5"
Click Enter -> Input your database password -> Click Enter -> Done!
Code:
sqlcmd -S localhost -U SA -Q "RESTORE DATABASE [CabalGuild] FROM DISK = N'/var/opt/mssql/backup/CabalGuild.bak' WITH FILE = 1, NOUNLOAD, REPLACE, STATS = 5"
Click Enter -> Input your database password -> Click Enter -> Done!
Code:
sqlcmd -S localhost -U SA -Q "RESTORE DATABASE [EventData] FROM DISK = N'/var/opt/mssql/backup/EventData.bak' WITH FILE = 1, NOUNLOAD, REPLACE, STATS = 5"
Click Enter -> Input your database password -> Click Enter -> Done!
Code:
sqlcmd -S localhost -U SA -Q "RESTORE DATABASE [NetCafeBilling] FROM DISK = N'/var/opt/mssql/backup/NetCafeBilling.bak' WITH FILE = 1, NOUNLOAD, REPLACE, STATS = 5"
Click Enter -> Input your database password -> Click Enter -> Done!
Code:
sqlcmd -S localhost -U SA -Q "RESTORE DATABASE [Server01] FROM DISK = N'/var/opt/mssql/backup/Server01.bak' WITH FILE = 1, NOUNLOAD, REPLACE, STATS = 5"
Click Enter -> Input your database password -> Click Enter -> Done!
Database Location and Commands:
Location: /var/opt/mssql Backups: /var/opt/mssql/backup
Command to restart database:
Code:
systemctl restart mssql-server
P.S. SQL has its own cmd, but it is not adviseable for novice user to use it, as SSMS does everything you need.
# Useful Tips #
- How to change default database username to my own?
Answer: Login to your Database -> Select "Security" (below "Databases") -> right-click user "sa" -> click "Rename" -> change it to whatever you like and hit "Enter" on your keyboard -> Done!
- How to change MSSQL default port (1433) into my custom one?
Answer:
- Firstly, add it into your firewall zone. If you will not add it before hand, you will block yourself out of the database.
- Then, run the following command in SSH terminal:
Code:
/opt/mssql/bin/mssql-conf set network.tcpport YOUR_PORT_HERE
- After that you will be prompted to restart MSSQL Server, so use the following:
Code:
systemctl restart mssql-server.service
[/SPOILER]
[/CENTER]
L.P.: "God save us everyone, When we burn inside the fires of a thousand suns, For the sins of our hand, the sins of our tongue,.. The sins of our father, the sins of our young."
SARCASM: Because Beating The SHIT! Out People Is Illegal...
You can always restore db's from commands, but indeed it's easier with SSMS.
I have already installed that on my local pc, I just don't know how? or what to use to log in on my SSMS have tried the IP and the root username and password of the VBOX machine, but it wont go through.
thank you so much for replying I am really lost here right now for I have not tried setting up a server like a very long time.
- - - Updated - - -
Originally Posted by Dens666
Hello,
not sure what exactly your problem is.
You cannot access SSMS, SSMS is a application that you have to install.
It's not part of the database usualy.
You can always restore db's from commands, but indeed it's easier with SSMS.
I have already installed that on my local pc, I just don't know how? or what to use to log in on my SSMS have tried the IP and the root username and password of the VBOX machine, but it wont go through.
thank you so much for replying I am really lost here right now for I have not tried setting up a server like a very long time.
L.P.: "God save us everyone, When we burn inside the fires of a thousand suns, For the sins of our hand, the sins of our tongue,.. The sins of our father, the sins of our young."
SARCASM: Because Beating The SHIT! Out People Is Illegal...
I have successfully, connected locally through the SSMS and now my adventure continues...
still gonna need your help guys...
Again thank you!
God Bless!
- - - Updated - - -
once again I am coming to you guys for some help.
thank you!
god bless!
- - - Updated - - -
you just have got to do everything on the tut...
done with this part.
on to the next one!
hopefully, the gods of knowledge will bless me more of their knowledge.
L.P.: "God save us everyone, When we burn inside the fires of a thousand suns, For the sins of our hand, the sins of our tongue,.. The sins of our father, the sins of our young."
SARCASM: Because Beating The SHIT! Out People Is Illegal...