Support Thread

Can I Install The Software On An Existing Database

Can I Install The Software On An Existing Database — APG vNext Guide

Can I Install The Software On An Existing Database — a configuration and setup topic from the APG vNext support community.

Key Configuration Points

  • IIS App Pool: .NET 4.0 Integrated Pipeline mode is required.
  • Connection String: Verify SQL Server name, database, and credentials in web.config.
  • File Permissions: App pool identity needs read/write on the upfiles folder.
  • URL Rewriting: Install IIS URL Rewrite 2.0 module for clean SEO-friendly URLs.
  • Full-Text Search: Enable SQL Server Full-Text Indexing for forum search.

More Help

Installing APG vNext on an Existing SQL Server Database

Yes — APG vNext can be installed into an existing SQL Server database. The installer creates APG-specific tables with the prefix apg_, which avoids conflicts with tables from other applications sharing the same database. However, there are important considerations around SQL Server permissions, collation compatibility, and the database owner prefix that must be addressed before installation.

Pre-Installation Requirements

  • SQL Server version: 2012 or later (2019+ recommended)
  • Collation: SQL_Latin1_General_CP1_CI_AS or any CI_AS collation at the database level
  • Permissions: the IIS application pool identity needs db_datareader, db_datawriter, and db_ddladmin during installation; db_datareader + db_datawriter suffices for production
  • Full-Text Search: the SQL Server Full-Text Search feature must be installed and the database must have full-text enabled

Running the APG vNext Database Setup Script

-- Step 1: Enable full-text search on existing DB
USE [YourExistingDB];
IF (1 = FULLTEXTSERVICEPROPERTY('IsFullTextInstalled'))
BEGIN
  EXEC sp_fulltext_database @action = 'enable';
END;

-- Step 2: Run APG vNext schema script from /install/sql/apg-schema.sql
-- All objects are prefixed 'apg_' — no conflict with existing tables

Configuring the Database Prefix

<!-- web.config: if your DBA added a schema prefix -->
<add key="APG.DBOwnerPrefix" value="dbo." />
<!-- Use "yourschema." if APG tables are in a custom schema -->

Verifying the Installation

-- Confirm APG tables were created:
SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES
WHERE  TABLE_NAME LIKE 'apg_%'
ORDER  BY TABLE_NAME;
-- Should return 40-60 tables depending on version

Related Resources

Installing APG vNext on an Existing SQL Server Database

Yes — APG vNext supports installation on an existing SQL Server database. The installer creates its own tables with the apg_ prefix, so there is no conflict with tables from other applications in the same database. However, best practice is to use a dedicated database for APG vNext for isolation, performance monitoring, and easier backup/restore.

Pre-Installation Database Check

-- Verify no naming conflicts before installing:
SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES
WHERE  TABLE_NAME LIKE 'apg_%'
ORDER  BY TABLE_NAME;
-- Should return 0 rows on a clean database

Required SQL Server Permissions

The APG vNext installer requires the following permissions on the target database:

  • db_ddladmin — to create tables, indexes, and stored procedures
  • db_datawriter — to insert initial configuration data
  • db_datareader — to read data during installation verification
  • REFERENCES on the database — to create foreign key constraints
-- Grant permissions to the APG vNext app pool identity:
USE [YourForumDB];
CREATE USER [IIS AppPool\YourAppPool] FOR LOGIN [IIS AppPool\YourAppPool];
ALTER ROLE db_ddladmin    ADD MEMBER [IIS AppPool\YourAppPool];
ALTER ROLE db_datawriter  ADD MEMBER [IIS AppPool\YourAppPool];
ALTER ROLE db_datareader  ADD MEMBER [IIS AppPool\YourAppPool];
GO

Full-Text Search Setup on an Existing Database

If your existing database already has Full-Text Search enabled, APG vNext will use the existing Full-Text Catalog. If it's not yet enabled:

-- Enable Full-Text Search on the database:
USE [YourForumDB];
CREATE FULLTEXT CATALOG apg_catalog AS DEFAULT;
GO
-- APG vNext creates its own Full-Text Index on apg_Posts during installation

Post-Installation Verification

-- Verify APG vNext installed correctly on existing database:
SELECT COUNT(*) AS APGTableCount
FROM   INFORMATION_SCHEMA.TABLES
WHERE  TABLE_NAME LIKE 'apg_%';
-- Expected: 25-35 tables depending on version

SELECT SettingKey, SettingValue
FROM   apg_Settings
WHERE  SettingKey IN ('Version','InstallDate','DatabaseName');

Shared vs. Dedicated Database: Performance Considerations

While APG vNext can share a database with other applications, forum workloads are write-heavy during peak hours (new posts, notifications queuing, search indexing) and can impact other applications sharing the same SQL Server resources. For communities with more than 500 active members or more than 1,000 posts per day, a dedicated database is strongly recommended. This allows independent backup scheduling, query performance monitoring specific to APG vNext, and isolation of any performance issues. A dedicated database also simplifies disaster recovery — you can restore just the forum database without risk to other applications.

Compatibility with SQL Server Editions

APG vNext is compatible with SQL Server 2012 and later, including Express, Standard, and Enterprise editions. SQL Server Express is suitable for small communities (under 100 active members) but has a 10GB database size limit and no SQL Server Agent for scheduled jobs. Standard or Enterprise edition is recommended for production communities, as they support scheduled maintenance jobs (index rebuild, statistics update, log shipping) that keep the forum database performing optimally as it grows. Azure SQL Database is also fully supported from APG vNext 5.0 onwards, enabling cloud-hosted deployments without managing SQL Server infrastructure.

Related Resources


Looking for more help? Browse the support forum or check the Knowledge Base.