Skip to main content
Cartegraph Campus

Notes for On-Premise Database Administrators

SQL

Your  local database administrator is responsible for maintaining the database and database server. We recommend you perform regular maintenance on your SQL database, such as full backup, transaction log backup, rebuild index, update statistics, maintenance cleanup, etc. (Shrinking should be used sparingly as it may fragment your database.)

For the Cartegraph database, you may wish to trim the error log as well. This can be done in the software but is more convenient to do in SQL. The script below is an example of how to remove error logs that are older than 90 days. Please review this before executing it on your Cartegraph database.

delete from ELMAH_Error where datediff(day, timeutc, GETUTCDATE()) >= 90

When you restore your database from prod to test, you will need to disable notifications, GIS connections, and automations, as well as set the project home. This can be done in the software but is more convenient to do in SQL. Before starting this process, use the SQL script that follows on your test database to get the location of where the test project home is. You will need this when you copy files from the production to test project home and to reset the project home path in the test database after it has been restored.

select sValue from cgSysSettings where sKey = 'ProjectHome'

Basic Steps to Restore From Production to Test

Each customer’s site is different; please adjust to fit your location.

Normally the test project home is not updated from production. Please make sure to back up any files you need to keep in case they are overwritten.

  1. Perform a full backup of the production database.
  2. Copy the production project home to the test project home and overwrite any files if necessary.
  3. Stop the test application server app pool and report pool.
  4. Restore the backup of production database to test, overwriting the existing database.
  5. Configure any SQL logins as needed to have "db_owner" permission to the database.
  6. Run the SQL statements that follow to disable notifications, GIS interations, and automations and to set the project home in the test database. Replace <Test Project Home Path> with the path to your test project home.
    • update NotificationTypes set NotificationsOn = 0
    • update cgGISAssociations set Inactive = 1
    • update cgAutomations set IsEnabled = 0
    • update cgSysSettings set sValue = '<Test Project Home Path>' where sKey = 'ProjectHome'
  7. Start the test application server app pool and report pool.
  8. Sign in to test.
  9. Go to Administrator > Structure Manager > Publish.

Alternatively, you can disable notifications, GIS integrations, and automations and set the project home directly in the application.

More information is in the following links, including how to publish the site.

Test Database Support

The normal work flow in a Test database is to examine the issue and try to resolve it. But because it is a test database and should be regularly updated from production, we do not invest a lot of time into sorting out issues that are not seen in production.

The exception to that rule is when you are building something you want to move to production. In that case we need to find what changed and caused the issue.

Here are some troubleshooting questions:

  • Do you know what changed before the error?
  • Do you know when the test was last refreshed from production?
Hint: If you are building something to be moved into production, you need to refresh test before you start your work.
  • Is there any reason not to overwrite test with a copy of production?

GIS

Your GIS Administrator is responsible for maintaining all of the GIS data and servers, including the REST services used to GIS connect to OMS. The Cartegraph GIS Sync runs each night at the time configured in the scheduled task on the application server. The GIS connection to Cartegraph will cause your delta tables to grow and can slow GIS performance if you do not regularly compress your GIS environment.

After the initial connections are set up, the number of changes (entries in the delta table) will be greatly reduced.

  • Was this article helpful?