Skip to main content
All CollectionsHow To
Reinstalling SQL Server 2012 Express
Reinstalling SQL Server 2012 Express
Angel Horowitz avatar
Written by Angel Horowitz
Updated over a week ago

Sometimes a problem occurs during the installation or operation of SQL Server and it needs to be completely reinstalled. These instructions will help you reinstall SQL Server while preventing any data loss.

Create a Backup of Your Database
You must make a backup of your information before making any changes to the system to prevent data loss1. Removing SQL Server always deletes your database. To retain your database information you will be required to restore a backup once you reinstall SQL Server. To backup your database:

  1. Open the software if possible and go to File > Backup and Restore > Backup Database.

  2. Follow the prompts to create a backup either on your computer's hard drive or on a USB flash drive. The particular location of the backup does not matter as long as it is a location you can remember and find later when the database needs to be restored.

​Copying Your Database Directly2
If you cannot make a backup of your database and the software has not been making automatic backups, then you can copy the database file directly from the SQL Server data. If you already have a backup, then skip to the Uninstall SQL Server 2012 Express section.

  1. Go to Start Menu > All Programs > Microsoft SQL Server 2012 > Configuration Tools > SQL Server Configuration Manager.

  2. Click on SQL Server Services on the left side.

  3. Stop the SQL instance in the right hand pane that you were running your database on by right-clicking on the instance name and then selecting Stop.

  4. Navigate to the location of your database files. Typically, the database files are found in Local Disk (C:) > Program Files (x86) > Microsoft SQL Server > MSSQL.1 > MSSQL > DATA.

  5. Locate the files 123Pet.mdf and 123Pet_Log.ldf. Highlight these two files, right-click, then select Copy.

  6. Find a location that is appropriate (like your Desktop), right-click, and select Paste to make a copy of your database files.

Uninstall SQL Server 2012 Express

  1. ​​​Close 123Pet if it's open.

  2. Go to Windows Start > Control Panel.

  3. Choose Program & Features or Uninstall a program from the Programs category.

  4. Look for items listed under Microsoft SQL Server.There should be at least four items listed. Two of these need to be removed: Note: removing these will also delete your database. Make sure you have made or found a recent backup file of your database to prevent data loss.

    • Microsoft SQL Server 2012

    • Microsoft SQL Server Native Client

  5. Remove Microsoft SQL Server Native Client​.

  6. Select Microsoft SQL Server Native Client from the list of programs and select Remove or Uninstall.

  7. The Native Client should be uninstalled automatically.

  8. Remove Microsoft SQL Server 2012.

    1. Select Microsoft SQL Server 2012 in the list of programs and choose Remove or Uninstall.

    2. You will be prompted to click OK a couple times. Select which instance to remove. Eventually, you need to remove all instances. If there is only one choice, then select it in the drop-down. If there are multiple instances, then pick the first one and you will need to come back to this step later to remove the other(s).

    3. On the next screen, click the Select All button to remove all features of the instance.

    4. Click Next.

    5. Select Remove on the following screen. This will begin the process of removing SQL Server. This process should take several minutes to finish.

    6. If you originally had two or more instances of SQL Server, then repeat Steps A-E of this section for each remaining instance. Common SQL instances that you encounter will be CMJ and SQLEXPRESS​.

  9. Check your program list for a program called Microsoft SQL Server Desktop Engine. If you see this program, then you should uninstall it the same way you uninstalled the Native Client. If you do not have this program installed, then skip to the next section.

Reinstall SQL Server 2012 Express

  1. Download the installation file here.

  2. Run the installation file.

  3. Follow any prompts given by the installer. It may take several minutes to install.

  4. Open 123Pet again when it's finished.

  5. The program will begin to search for SQL Server with a dialog box stating 123Pet is trying to start SQL Server. It's not likely to find it without your help. Click the Cancel button once it becomes available.

  6. Click OK on the error message. The No Database Open screen will open.

  7. Choose Select Server and click Auto Setup. This will locate and connect with SQL Server automatically. The next sections will help you to restore your backup.

​Restore the Database from a Backup File
Since reinstalling SQL Server deletes your previously created database, you will need to restore that database from the backup created earlier.

  1. Choose Restore a Backup.

  2. Choose Restore a database from a specific location.

  3. Click Next.

  4. Browse to the location of your database backup and double-click it.

  5. If you originally set a database password, then you will be prompted to enter it at this time.

  6. Your database will be restored.

Restore from a Copy of a Database from MDF & LDF Files
If you could not make a backup file or had no automatic backup files, then you can use your copied database files to restore your previously created database.

  1. Open the software and when prompted create a Blank Database.

  2. Once it's created, close the software.

  3. Go to Start Menu > All Programs > Microsoft SQL Server 2012 > Configuration Tools > SQL Server Configuration Manager.

  4. Click on SQL Server Services on the left side.

  5. Stop the SQL instance in the right pane by right-clicking on the name (SQL Server (DSI)) and selecting Stop. Minimize this window to your taskbar. You will come back to it later.

  6. Locate the files 123Pet.mdf and 123Pet_Log.ldf from the location that you copied them to earlier. Highlight these two files, right-click, then select Copy.

  7. Typically, the database files need to be pasted to Local Disk (C:) > Program Files (x86) > Microsoft SQL Server > MSSQL.11.DSI > MSSQL > DATA.

  8. Paste the files in the DATA folder.

  9. Choose Replace, or Replace and Copy for both files. Close this window.

  10. Open the SQL Server Configuration Manager window again from the taskbar.

  11. Start the SQL instance by right-clicking on the name again (SQL Server (DSI)) and selecting Start. Close the window.

  12. Open 123Pet and your database will be restored!

​1If you cannot open your software to create a database, check for your most recent automatic backup file. If you have not been making automatic backups, then you can make copies of your database files directly.

2We recommend making copies of your database files as a last resort. DaySmart Software, Inc. is not responsible for data lost from customer manipulation of the SQL database files.

Did this answer your question?