So, yesterday we took a backup of our TMS database. Today, we learn how to restore it. This is also a check you should be doing after having taken your first backup and also regularly after you have taken backups because like I have mentioned here otherwise you can’t be sure you have backed up anything. Or, like a friend of mine who deals with a lot of IT messes put it:
“I bought a book!”
“Are there words inside it?”
“Huh? Of course. I didn’t check, but there are always words inside a book, right?”
Before you haven’t checked, you just assume, you aren’t sure. And if there is one rule every collections professional knows by heart it is this: Never assume, always make sure!
Step 1: Again, log into the server you want the database to restore to and open Microsoft SQL Server Management Studio
You already know how to do that by now. If not, re-read step 1 in this article.
Step 2: Navigate to the Restore menu
Go to the folder “Databases”, right-click on it and select “Restore Database…”

Step 3: Chose your backup file
Up comes a rather bleak screen:

Go to “Device” and click on the three dots …

You get another rather bleak screen from which you choose “Add…”

You are getting a look at your file system from which you select the backup file you want to restore from. You might remember I cautioned you to store it in a place you can easily find it in Step 6 in in the previous article, right?

When you have found the right file, you click “OK”.

On the next screen you also click “OK”.
Step 4: Restore your database
Now you are on this screen again, but now it is populated with your chosen backup, including the date and time it would restore to:

You can see how my database “Leer” (yours might be called “TMS” or something else) is showing up both as the source and as the destination. If you really want to overwrite your current database this is fine, for example because something went horribly wrong with your current database and you want to restore it to an older version.
But if you just want to test if our backup file is okay, you don’t want to do that! Imagine something went wrong with the backup. We would be overwriting our totally fine current database with a corrupted backup! Big mistake!
So, for testing, instead of the “Leer” as destination I simply typed another name. I chose “TMSTEST”:

Then I clicked “OK”.

The database will now be restored to a new destination. If the backup file is okay and you have enough storage space you will get this screen after a while:

You can now click “OK”.
Step 5: Test your database
You should now see an additional database in your databases folder (mine shows up, of course, as “TMSTEST” because I called it that way):

If that worked fine, your backup file is okay. But just because I am a bit anal about my data, just to check, just to make sure, I run the mother of all TMS queries: “Select * From Objects”.

Only when it runs smoothly and the number of objects I get back matches my expectations, I am satisfied.
Housekeeping
Backup files are rather large. Which is logical, because they contain all your valuable data, right? So, after testing to make sure my backup is okay, I deleted that new database again by right-clicking on TMSTEST and choosing “Delete” so it doesn’t clog my server:


Also, because the backup files are so large, I tend to compress them before I move them to a different server. I use the software 7-Zip for it since it proved to be rather reliable (https://www.7-zip.org/). If you don’t have it on your server, you need to install it, first.
Go to your Windows Explorer and find your backup file. Right-click on it, choose “7-Zip” and select the option “Add to [whatever your backup is called].7z”.

You can now see how the backup is compressed. Wait until it is done (fetch a coffee or a tea, this might take a while, depending on the size of your database).

After it is finished, you will see a second file on your file system:

You will notice how much smaller the compressed file is. This is much easier to move to another server, unpack, and restore there, right?
Because I am paranoid I will move the .7z file to a cloud storage that I trust now and try if I can unpack it there without issues. If that is the case I can go back and delete the .bak file and just retain the smaller .7z file.
Take your backups, take them to a safe location, and take good care!
Angela