Data Archiving
On this page
An archiving job removes closed tickets that have not been modified for a set period from the Alloy Navigator database. Depending on its action, the job first copies them into a separate SQL Server database, the archive database, or only deletes them. Archiving jobs are Automation Server jobs and run on a schedule. Use archiving to keep the Alloy Navigator database smaller by moving out the closed tickets that you rarely need.
You configure archiving in the Settings App, under Services > Archiving. The Admin Center has no archiving configuration; outside Alloy Navigator Cloud, it shows the Archiving log. In Alloy Navigator Cloud and on a database hosted in Azure SQL, the Settings App does not show Services > Archiving or its three pages (see Administering Alloy Navigator Cloud).
What an archiving job archives
A job holds one rule per ticket class: Work Order, Incident, Problem, Change Request, and Service Request (see Tickets). Each rule can be enabled or disabled and has a period, a number of Days, Months, or Years. The rule list shows each rule as "All closed <class> not modified within the last N <period>s". An enabled rule selects the tickets that are in the closed status and were last modified more than the period ago. An open ticket is not archived, however long it has been unchanged.
A job does one of two things with the tickets its rules select:
- Archive unused objects and purge copies each ticket into the archive database, then deletes it from the Alloy Navigator database.
- Only remove unused objects deletes the tickets without writing them anywhere.
IMPORTANT: Tickets deleted by Only remove unused objects cannot be restored: a ticket can be restored only from an archive database. Removing tickets without archiving them is not recommended.
The action applies to every rule of the job, while each rule has its own period. To archive some ticket classes and only remove others, create one job for each action. For example, to archive closed Change Requests not modified for two years and closed Service Requests not modified for one year, and to delete closed Work Orders and Incidents not modified for six months, create two jobs:
- A job with Archive unused objects and purge, with the Change Request rule enabled and set to 2 Years, the Service Request rule enabled and set to 1 Year, and the other rules disabled.
- A job with Only remove unused objects, with the Work Order and Incident rules enabled and set to 6 Months, and the other rules disabled.
An archive-and-purge run copies three things per ticket: the ticket record, its activities, and its attachments. It does not copy the ticket's History or its related objects. A file attached to several archived tickets is stored in the archive once and listed against each ticket.
NOTE: An archive database is not a backup of the Alloy Navigator database. It holds only the ticket records, activities, and attachments, without History or related objects, and restoring an archived ticket creates a new ticket with a new number instead of bringing back the original one. To back up the database, use the Database Backup/Restore Wizard. See Back Up and Restore the Database.
An archive-and-purge run creates the archive database and registers it; a name that already exists is refused (see Check the results).
Before you begin
- The Automation Server must be set up and running for an archiving job to run.
- For an archive-and-purge job, the SQL Server account used to create the archive database must be a member of the SQL Server "dbcreator" and "securityadmin" fixed server roles. See Grant the server roles in SQL Server Management Studio.
- The archive database is created on the SQL Server instance that hosts the Alloy Navigator database, so that account must be a login on that instance. The job offers no choice of server.
Grant the server roles in SQL Server Management Studio
The account can be an existing SQL Server login or a new one, for example an account dedicated to archiving or the account of the person who maintains the archives. If the account has no login on the instance yet, create one first (see Microsoft's Create a login).
- Start SQL Server Management Studio and connect to the SQL Server instance that hosts the Alloy Navigator database.
- In Object Explorer, expand the server, then expand Security > Logins.
- Right-click the account's login and select Properties.
- In the Login Properties dialog box, select the Server Roles page.
- Select dbcreator and securityadmin, and click OK.
For what each role allows, see Microsoft's Server-level roles. To check the account from the archiving job, use Test Account Settings... (see Choose the account that creates the archive database).
Archiving in the Settings App
Services > Archiving has three pages:
- Archiving lists the archiving jobs.
- Archive Databases shows the archive databases and the tickets archived in them.
- Logs is the Archiving log.
Create or edit an archiving job
- Go to Services > Archiving > Archiving.
- Click New, or select a job and click Open, or double-click the job. The Archiving window opens with the tabs Settings, Processing, and Sessions. Its caption is "Archiving" for a new job and "Archiving [<job name>]" for a saved one.
- On Settings, enter the Name, up to 120 characters, and select or clear Enabled. A new job is named "Archiving", or "Archiving (1)", "Archiving (2)", and so on when that name is taken, and is enabled.
- Under Schedule, click Change... and set the schedule: the days the job runs (daily, weekly, monthly, or yearly), whether it runs once on those days or repeatedly within a time window, and the first and last date. A new job runs on the first day of every month at midnight, starting today. The Schedule box then shows the schedule in words.
- On Processing, choose Archive unused objects and purge or Only remove unused objects.
- In the rule list, enable the rules you need: click a rule's Enabled column, or press Space on the focused rule. Double-click a rule to run Edit..., which opens the rule editor, Archive Object. A new job lists the five rules, each set to 30 Days and disabled.
- For an archive-and-purge job, enter the name of the archive database under
Archive database. A new job proposes
<main database>_Archive_%YYYYMMDDHHNN%. To add a date or time part to the name, click Insert Placeholder... and pick one of the eight placeholders. The chosen placeholder replaces the selected text in the name box. A run fails if a database with the computed name already exists, so keep a date placeholder precise enough that a later run computes a new name. - Set the account that creates the archive database. See Choose the account that creates the archive database.
- Click OK.
If the Automation Server is not running when the window opens, the Settings tab shows "Warning. For this job to be executed, the Automation Server must be set up and running."
OK refuses an empty name or an empty schedule with 'The "Name" field is mandatory, it can't be left blank.' (or the same sentence for "Schedule"), and puts the cursor on that field. For an archive-and-purge job, it then checks the archive database and the account. The job is saved only when these checks pass.
The Insert Placeholder... menu offers:
| Placeholder | Sample |
|---|---|
%YYYYMMDDHHNN% |
201209260325 |
%YYMMDD% |
120926 |
%YYYY% |
2012 |
%YY% |
12 |
%MM% |
09 |
%DD% |
26 |
%HH% |
03 |
%NN% |
25 |
Insert Placeholder... is unavailable while Only remove unused objects is chosen.
Choose the account that creates the archive database
The account settings are on the Processing tab, below Archive database, under "Create archive database under this account:". They are unavailable while Only remove unused objects is chosen.
- Under Connect As, choose one:
- The Automation Server access key account. A new job starts on this choice.
- This account:, then choose the Authentication, Windows Authentication or SQL Server Authentication, and enter the Username and Password. For Windows Authentication, Find... opens the Windows user picker.
- To check the account, click Test Account Settings....
When you open a saved job, This account: is selected if the job has a stored user name; otherwise The Automation Server access key account is.
OK on an archive-and-purge job, and Test Account Settings..., first check the account:
- A Windows account name without
\is refused with "'<name>' is not a valid Windows account." A SQL Server account name with\is refused too. - An account that is not a member of both server roles draws the roles sentence, a warning that the job will not be able to create the archive database, and "Do you want to continue?"
The test then needs the Automation Server running. The test creates an archive database under the account and drops it at once, and the window reports "Account test completed successfully." or "Account test failed." with the log of the test.
For a Windows account, the archive database is created by logging on as that account with the network logon type. If the account does not have that right, the log shows "This Windows account does not have the right to log on using the network logon type."
Run and manage archiving jobs
On the Archiving page:
- Run starts the one selected job, whether or not it is enabled. It is available only while the Settings App last read the Automation Server as running. If Run is unavailable after the Automation Server has started, click Refresh; it also returns by itself within a minute.
- Terminate stops the one selected job while its last status is Running, after "Are you sure you want to terminate this job?"
- Enable and Disable, on the right-click menu, act on every selected job. A disabled job does not run on its schedule.
- Delete deletes every selected job after "Are you sure you want to delete the selected item?"
- Refresh, also F5, reloads the job list, the Automation Server's job list, and the Automation Server's status. Between refreshes, the list reloads changed rows every ten seconds by default while its page is the active one.
- The right-click menu also has Copy Job ID (GUID) to Clipboard and Export Selected Settings....
The same Run is on the Automation Server's Job List page. The Automation Server starts a requested run at once, out of schedule, unless the Automation Server is not active, or the job is already running or locked.
When the Settings App cannot reach the Automation Server directly, Run and Terminate leave the request for the Automation Server to pick up and show "Since your Settings App and the Automation Server are installed on separate computers, it may take some time to test your settings. Please wait until the job has completed, and then check the session log to make sure that it runs as expected." or "Please wait, the job will be terminated soon. Since your Settings App and the Automation Server are installed on separate computers, it may take some time to complete." Any other failure shows "Cannot send request to the Automation Server. Make sure the Automation Server is configured and started."
Check the results
What a run did is shown in three places:
- The job window's Sessions tab lists the job's own runs.
- The Archiving log, under Services > Archiving > Logs or Logs > Archiving, lists the runs of all archiving jobs.
- Services > Archiving > Archive Databases shows the archived tickets.
For each run, the log shows the run date, the comments, the duration, the archive database, the number of objects, and the number of errors:
- The number of objects counts every ticket the run processed, including tickets whose archiving failed, which are also counted as errors.
- The archive database is empty for a job that only removes tickets.
- A run that finds nothing to remove logs "No objects for removing found." and reports 0 objects.
- Each run checks the account again. A blank account, an account that does not exist on the SQL Server, or one that lacks either server role ends the run. An existing database with the computed name ends it with "The database "<name>" already exists." and "Error creating database: ...". Each refusal is written to the job's log and the System Log.
The log offers View Log (also Enter or a double-click on a row), Delete, Clear All, Settings, and Refresh (F5):
- Delete asks "Are you sure you want to delete the selected record?" for one row or "Are you sure you want to delete <n> selected records?" for several, and then reports "<n> records have been deleted."
- Clear All empties the whole log after "You are about to delete all entries from the Service Log. Are you sure you want to proceed?"
The log loads the newest 1000 runs, says "Last <n> records are loaded", and reloads what changed every ten seconds by default while its page is the active one. If loading the log times out, it shows the number of rows in the log and Clear All stays available.
The Logs > Archiving node needs the permission to browse logs. Without the permission to manage logs, that node opens the log read-only, without Delete and Clear All. Settings needs the permission to manage logs; without it, Settings shows "You do not have enough permissions to use this function." See Logs.
The Sessions tab is the same log for one job. It has no Settings, its Clear All deletes only that job's runs, and it is unavailable until the job is saved.
Update an older archive database
An archive database is not converted when the Alloy Navigator database is upgraded. The Settings App converts it on demand, when you select it.
- Go to Services > Archiving > Archive Databases and select the archive database, or a ticket class under it.
- If the archive is in an older format, the Settings App asks "To view this archive database, you must update it to the latest format. The update process may take considerable time." and "Do you want to update the archive database now?". Click Yes. If you click No, the archive's contents are not shown.
The Upgrading Data... window shows the progress and stays on top until the update ends. To interrupt it, click Break and answer Yes to "Are you sure to interrupt the process of updating your archive database? You can resume it later." No resumes the update. An interrupted archive is offered for update again the next time you select it. If the update fails, the Settings App shows "Unable to convert this archive database." with the SQL Server's message.
View and restore an archived ticket
Restoring an archived ticket creates a new ticket in the Alloy Navigator database. The archived ticket stays in the archive database.
- Go to Services > Archiving > Archive Databases.
- Select the archive database and the ticket class in the tree. The archived tickets of that class are listed.
- To view a ticket, select it and click Open, press Enter, or
double-click it. The Archived object window opens. It has:
- General, the ticket's fields, read-only. Show Fields chooses which fields the page lays out.
- Activities, the archived activities, with their number in the tab caption.
- Attachments, with File Name, Description, File Size, and Created Date.
- To restore, click Restore Ticket in the window, or select one or more tickets on the page and choose Restore Ticket.
- Confirm "Do you want to create the <class> in current DB?" (or "Do you want to create <n> <class list> in current DB?" for several tickets). The Settings App reports "You have created the following <class list>:" with the new ticket numbers.
In the Activities and Attachments lists, press Ctrl+F or F3 to filter.
The restored ticket:
- Gets a new ticket number.
- Keeps its related CI, related problem, and service. A restored work order is linked to its parent ticket again if the parent is still in the Alloy Navigator database; otherwise the parent field is empty.
- Gets copies of the archived activities and attachments. The copied activities have no category, no published flag, no time spent, and no workflow item or action.
- Gets one more activity, "Ticket restored", by the technician who restored it, at the time of the restore. Its details read "Ticket was restored from archived ticket <old number>".
- Has no History and no related objects, because the archive holds none.
Lookup and classifier fields whose archived value does not match any existing data are left empty. The "Ticket restored" activity then adds "Some fields and/or classifiers appear empty because their values do not match any existing data." and can list the archived values it could not match.
Archiving in the Admin Center
The Admin Center has no archiving configuration.
- The Archiving log is available in the Admin Center's Logs section. In Alloy Navigator Cloud, the Admin Center hides it.
- The Automation Server's Job List lists archiving jobs, but opening one shows only a warning and Close. Archiving jobs are edited in the Settings App.
Related topics
- Administering Alloy Navigator Cloud - what is not available in Cloud.
- Logs - the logs of Alloy Navigator.