You are using an unsupported browser. Please update your browser to the latest version on or before July 31, 2020.
You are viewing the article in preview mode. It is not live at the moment.
IMPORTANT: Upcoming Changes in CAREWare > Learn More
Home > Installing, Upgrading, and Migrating CAREWare 6 > Migrating CAREWare 6 > Restoring Attachments After Migrating the Database
Restoring Attachments After Migrating the Database

 

Purpose

Restore the cw_attachments database and its database connection string.

Who should do this

IT staff who manage CAREWare and SQL Server.

Use this guide when you need to

Restore attachments after moving the CAREWare database to a new server.

Main warning

The attachmentDBCreated setting must match whether the cw_attachments database exists.

 

Quick path
Back up cw_attachments → Verify attachmentDBCreated → Create the database if needed → Restore cw_attachments → Start Server

 

Important: The CAREWare 6 SQL Server database instance must have permission to read and write to the folder containing the backup file.

Overview

In some cases, users are unable to view attachments or add new attachments after upgrading from CAREWare 5 to CAREWare 6. This can happen if the CAREWare database was moved to a new server. 

To fix these issues, restore the cw_attachments database and create the database connection string for cw_attachments by following these instructions:

Prepare and Verify the Attachments Database

Step 1. Create a backup of the cw_attachments database from the CAREWare 5 database instance.

Step 2. Move the backup file to the SQL Server Restore from Directory or any file folder to which the CAREWare 6 SQL Server database instance has permission to read and write.

Step 3. Verify if the cw_attachments database has already been created by checking the database instance databases.

 

Step 4. Verify that the setting in CAREWare matches the current state by checking to see if attachmentDBCreated is one or zero.

 

If there is no cw_attachments database listed under databases and the setting for attachmentDBCreated = 1, then change that setting to 0. If there is a cw_attachments database and the attachmentDBCreated setting is 0, then change that setting to 1.

Change the attachmentDBCreated Setting

To change the attachmentDBCreated settings:

Step 1. Click Server Settings.

Step 2. Click Stop Server.

Step 3. Click Common Storage Settings.

Step 4. Click cmm_st_pk to set the list in alphabetical order.

Step 5. Go to attachmentDBCreated.

Step 6. Change the cmm_st_number to the needed setting: 0 or 1.

Step 7. Click Server Settings.

Step 8. Click Start Server.

 

If there was no cw_attachments database and the setting has been changed to zero, create the attachments database by adding an attachment record and then deleting that record. Once the attachment has been added to a client, the cw_attachments database should be created, the attachmentDCCreated setting should be set to 1, and the database connection string for cw_attachments should be created. Now the cw_attachments database can be restored.

Restore the cw_attachments Database

To restore the cw_attachments database:

Step 1. Click Server Settings.

Step 2. Click Stop Server.

Step 3. Connect to the CAREWare 6 database instance.

Step 4. Right-click the database instance.

Step 5. Click Restart.

Step 6. Expand databases.

Step 7. Right-click cw_attachments.

Step 8. Restore the cw_attachments database under tasks.

Step 9. Run this query: use cw_attachments Exec sp_changedbowner 'cwbt'

Step 10. Go back to the CW Admin.

Step 11. Click Start Server.

How to confirm it worked

Verify users can view and add attachments in CAREWare.

Related References

Document

Use it for

Managing CAREWare Data

Locate the SQL Server restore directory.

Managing CAREWare Data (original wiki link)

Original wiki link included in the source article.

Database Connection String

Review the database connection string and attachmentDBCreated setting.

Database Connection String (original wiki link)

Original wiki link included in the source article.

Restore a Backup from a Device (SQL Server)

Restore the cw_attachments database backup.

 

Feedback
0 out of 0 found this helpful

Attachments

CAREWare_User_Guide__Restoring_Attachments_After_Migrating_the_Database.pdf