Skip to main content

Practice Management: Backup and restore APS databases in SQL Server

Updated this week

The steps below detail how to backup and restore your SQL database using SQL Server Management Studio.

📌Note:

  • The tasks below are usually done by IT or an experienced system administrator.

  • All screenshots below are taken from SQL Server Management Studio 2017. Your version might vary slightly.



Backup a Database in SQL Server Management Studio

  1. Open SQL Management studio.

  2. Enter your Server Name.

    image.png
  3. Login using Windows or SQL authentication.

  4. Expand on the Databases folder.

  5. Right click the aps_dsql database.

  6. Select Tasks, Back Up.

    image.png
  7. Ensure that the source database is aps_dsql (your APS database).

  8. Ensure the Back up to field value is Disk.

  9. Click Add.

    image.png
  10. Click Ellipsis to select a backup location.

    image.png
  11. Find the location you wish to save the backup file.

    image.png
  12. Click OK.

    image.png
  13. The backup will execute.

    image.png
  14. Click Ok on the success message. Your backup has completed successfully and can be found in the folder location you specified during your backup.

    image.png

Restore a Database in SQL Server Management Studio

Step 1 - Restore the database

  1. Open SQL Management studio.

  2. Enter your Server name.

  3. Login using Windows or SQL authentication.

  4. Select the Databases folder and click the + sign.

  5. Find your APS database (usually called aps_dsql) then right-click on it and select Delete. 📌Note:

    • make sure you have a reliable backup before doing this.

    • Confirm that no-one is logged into APS.

  6. ​Tick both boxes at the bottom of the Delete Object dialogue box then press OK.

    image.png
  7. Click New database.

    image.png
  8. Enter the new database name eg: aps_dsql.

  9. Click OK.

    image.png
  10. Right click on the new database.

  11. Select Tasks, Restore, database.

    image.png
  12. Select the source as Device.

  13. Click the Ellipsis.

    image.png
  14. Click Add.

    image.png
  15. Browse to the backup of the database.

  16. Select the backup.

  17. Click OK.

    image.png
  18. Click OK.

    image.png
  19. In the Backup sets to restore table, tick the item to restore, then select Options.

    image.png
  20. Tick to Overwrite the existing database (WITH REPLACE), and click OK.

    image.png
  21. Select Files, ensure the file paths are correct, then click OK.

    image.png
  22. The restore will commence and you can follow the progress of the restore.

    image.png
  23. Click OK when the restore successfully completes.


Step 2 - Security settings (Optional)

Once the database is restored check that the admin user exists in the server security.
Below steps take you through how to setup the admin user.

  1. Go to Security, Logins.

    image.png
  2. Right-click and select New login.

    image.png
  3. Enter the details for the Admin user.

  4. Select Server Roles.

    image.png
  5. Tick the Sysadmin role and click OK.

    image.png
  6. The Admin user is now set up correctly.

    image.png


Once the user ‘admin’ has been created, you can now assign the restored database to the user admin of the server.

  1. Click New Query.

    image.png
  2. Type in SP_ChangeDBOwner admin into the query window. Ensure that you are running the script against the aps_dsql .

  3. Click the ! to execute the query.

    image.png
Did this answer your question?