Tag Archives: MuseumDocumentation

Let’s talk about data security: Restoring a TMS database

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…”

Screenshot showing the tree structure from SQL Server Management Studio with the right-click menu enhanced on "Databases" and the menu item "Restore Database..." selected.

Step 3: Chose your backup file

Up comes a rather bleak screen:

Restore Database menu from SQL Server Management Studio with no file selected.

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

Same menu as in previous screenshots but with the radio button "Device" selected and an arrow pointing to the three dots menu.

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

hot with a menu showing Backup type "File" and the option "Add..." to which an arrow points.

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?

Screenshot showing the menu with the file system. The folder "M:\Backups" is open and within it the file "AfterCI2025.bak" is selected

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

Same screen like the one before the last screenshot but now you see the file "M:\Backup\AfterCI2025.bak" in the window.

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:

Same screen as the first screen in step 3 but now the backup file shows up.

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”:

Same screen as previously but this time there is "TMSTEST" instead of "LEER" in the Destination Database: line.

Then I clicked “OK”.

Same screen as before but now there is a line saying "Restoring M:\Backup\AfterCI2025.bak" at the top and a progress bar.

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:

Same screen as before with a pop-up window "Database "TMSTEST" restored successfully".

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):

Screenshot showing the tree structure from SQL Server Management Studio showing an additional Database "TMSTEST" now.

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”.

SQL query "Select * from Objects" run on TMSTEST giving back 67 rows with 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:

Screenshot showing the tree structure from SQL Server Management Studio with TMSTEST selected and the right-click menu enhanced with the item "Delete" highlighted.
Screen showing the "Delete object" menu, the checkbox "Delete backup and restore history information for databases" checked.

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”.

Screenshot from the Windows explorer with the right-click menu open showing highlighted "7-Zip" and, following that "Add to "AfterCI2025.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).

Screenshot showing the progress bar with some data like the size, speed, and compression rate while the file is being compressed.

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

AfterCI2025.7z with 770.696 KB and AfterCI2025.bak with 8.195.192 KB

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