"Unarchive" a deleted project from CCA/Supervisor

"Unarchive" a deleted project from CCA/Supervisor

Summary This is how you "unarchive" (aka: undelete or re-add) a project that has been deleted from CCA/Supervisor
Applies to askiafield ; Cca ; SQL
Written for Askia Staff ; Database Administrator ; Project Leads
Keywords undelete ; deleted ; delete ; unarchive ; archived ; archive ; cca ; sql ; supervisor ; surveys


1) You will need access to the [Cca].[dbo].[Surveys] SQL database.
2) You will need access to the CCA machine (or at least the Window's Services.msc process)
3) You will need to be aware that unarchiving a task requires a CCA Restart, so there will be some downtime.
4) This document assumes that all of the original files from the project are still in the original working directory on the CCA machine.

What happens when a project is deleted using Supervisor?

The cool thing about most of Askia's software is that we typically don't really "delete" anything. When you delete a project from Supervisor, the project is visibly removed from the Tasks list and a "Deleted" flag is changed from "0" to "1" in a SQL database. All QEX/QES/Resource files are still in the original working directory on the CCA machine (unless the someone manually removed them -- if that is the case, then this article will not be of help).


In this document, learn how to "unarchive" a project from an instance of CCA which has been deleted using Supervisor.

Step 1:

Gather all of the project details.

CCA Server: 

Step 2:

Launch Microsoft SQL Server Management Studio and login to the SQL instance.

Browse to the "Cca" database, find the "Tables" directory, and then find the "Surveys" table:

Right-click on the "Surveys" table and choose "Select Top 1000 Rows", which will open a new query with a default "Select" command:

Next, you'll want to filter the results to only show the survey you're interested in unarchiving. You should be able to achieve this by using the following query:

FROM [Cca].[dbo].[Surveys]
WHERE SurveyID = 2

Substitute "2" for whatever SurveyID your task is associated to.

You should then get a single result from your query:


Step 3:

Once you have your single result, next you'll want to scroll to the right until you find a column titled "Deleted":


0 = False
1 = True

As you can see from the above screenshot, SQL is showing that my project has been deleted. If I go back into Supervisor, I can confirm this, as I do not see it in my "Tasks" list.

Step 4:

Next, we'll want to change that "Deleted" flag from "1" to "0", effectively unarchiving the project via SQL.

To do this, you'll need to run a "UPDATE" SQL query:

UPDATE [Cca].[dbo].[Surveys]
SET Deleted = 0
WHERE SurveyID = 2

You should then see a result stating that "one row has been effected", meaning the change was a success:


Now if we go back to run a new "Select" query:

FROM [Cca].[dbo].[Surveys]
WHERE SurveyID = 2

We should see that our "Deleted" column was changed from "1" to a "0":

Step 5:

Now that you've successfully reverted the "Deleted" flag change in the SQL database, the last thing you need to do before the task shows back up in Supervisor is to Restart CCA:

NOTE: This process assumes the instance of CCA is running as a Service. If the instance of CCA is running as an application, all you need to do is close the application, wait a few seconds, and then reopen the application and let it complete the restart process.

Step 6:

Once the restart of CCA has completed, re-login to Supervisor, and you should now see your previously-deleted task back in the "Tasks" list.

Have more questions? Submit a request