EMPIRESYNC · DATA SETUP GUIDE

Your database.
Your path into EmpireOS.

Obtain PostgreSQL, load your lead data, and move approved records into your company’s dialer.

This guide covers lead and contact calling lists. Users, recordings, credentials, sales history, and other application records need their own migration plan.

A fictional data box entering a sophisticated processing machine, illustrating the journey from source data to an organized software workspace.
Turn approved data into a working lead list.Concept illustration · The steps below show the actual database, review, and CSV import process.
Two different uses of a database

The steps below use PostgreSQL as your company’s source or staging database. EmpireOS receives a CSV through its existing importer. Making PostgreSQL the application’s operational datastore is a separate administrator-led process, described at the end.

STEP 1

Obtain a PostgreSQL database.

Use your hosting provider

In a hosting account owned by your company, choose its managed PostgreSQL service. Create a supported production version in the appropriate region, then set capacity, private access, backups, and encryption with your administrator. Review the provider’s cost before ordering.

Install on your own server

Your administrator can install PostgreSQL using the official installers and packages. Select your server’s operating system and a supported stable release. Use a local installation for learning; plan production hosting and recovery separately.

  1. Create a database named empireos_source and a dedicated login such as empireos_import, owned by your company. The login should not have server-wide administrator privileges.
  2. Record the host, port, database name, username, and provider’s CA certificate instructions. Keep the password in your company’s password manager or approved secrets store.
  3. Limit database connections to approved machines or private networks. Enable verified TLS for remote connections, automated backups, and a tested restore.
  4. Install a database client: PostgreSQL’s psql command-line tool or pgAdmin.
Administrator example: create the database and login

Run this in psql while connected to an existing administrative database as a role authorized to create roles and databases. Managed providers may instead require their console. \password prompts for a new password; it is not SQL for a graphical query editor. Run these outside a transaction.

CREATE ROLE empireos_import LOGIN NOSUPERUSER NOCREATEDB NOCREATEROLE;
\password empireos_import
CREATE DATABASE empireos_source OWNER empireos_import;

PostgreSQL database creation reference

Connect securely with psql

Replace the placeholders with the connection details from your provider. Use the CA certificate and hostname verification settings it documents. The -W option prompts for the password.

psql "host=YOUR_DB_HOST port=5432 dbname=empireos_source user=empireos_import sslmode=verify-full sslrootcert=/path/to/provider-ca.pem" -W

PostgreSQL TLS connection reference

STEP 2

Load your company’s data into PostgreSQL.

  1. Export the calling-list records from your CRM or spreadsheet as a UTF-8 CSV with a header row. Keep phone numbers and postal codes as text so plus signs and leading zeros survive.
  2. Save a copy of the original export. Use a separate staging table for each batch so repeated imports do not silently append the same records again.
  3. Arrange the columns in the order shown below. Use true or false for both boolean fields. Preserve existing do-not-call flags. Mark approved_for_import true only after your team has reviewed that record for this campaign.
  4. Create the staging table in empireos_source, then import the CSV using one of the methods below.
Download blank CSV template
ColumnPurpose
phoneCalling number, retained as text
first_name, last_name, emailContact fields your campaign needs
state, postal_code, sourceLocation and the original provider or source
do_not_callTrue for a suppressed record; preserve this flag
approved_for_importTrue only after the record is approved for this import
Create a source staging table

Run once as the database owner. This example creates a new table and does not replace an existing table. The defaults keep unreviewed rows out of the approved export.

CREATE TABLE public.lead_import_staging (
  phone text,
  first_name text,
  last_name text,
  email text,
  state text,
  postal_code text,
  source text,
  do_not_call boolean NOT NULL DEFAULT true,
  approved_for_import boolean NOT NULL DEFAULT false
);
Download the staging-table SQL
Import with pgAdmin

Connect to your database, locate Schemas → public → Tables → lead_import_staging, then open the table’s Import/Export Data dialog. Choose Import, select your file, and set CSV format, UTF8 encoding, comma delimiter, and Header on. Choose the same nine columns in the CSV’s order. Review the process result and row count.

If pgAdmin runs on a remote server, upload the file using its file selector first. That file is stored on the pgAdmin host; use only a company-approved installation.

pgAdmin import/export instructions

Import with psql

Run the command below inside psql, on one physical line. Replace the local path. \copy reads the file from the machine running psql. The CSV column order must match the command; a header alone does not map fields by name. Each successful run appends rows.

\copy public.lead_import_staging (phone,first_name,last_name,email,state,postal_code,source,do_not_call,approved_for_import) FROM '/absolute/path/source-leads.csv' WITH (FORMAT csv, HEADER true, ENCODING 'UTF8')

psql client reference · CSV format reference

STEP 3

Review and export approved leads.

Compare the loaded row count to your original file. Resolve missing numbers and duplicates, preserve suppression records, and have the campaign owner review the list. These example queries find exact trimmed-number duplicates; EmpireOS also validates phone numbers during import.

SELECT count(*) AS source_rows FROM public.lead_import_staging;
SELECT count(*) AS approved_rows FROM public.lead_import_staging
WHERE approved_for_import IS TRUE AND do_not_call IS FALSE
  AND NULLIF(btrim(phone),'') IS NOT NULL;
SELECT btrim(phone), count(*) FROM public.lead_import_staging
GROUP BY btrim(phone) HAVING count(*) > 1;

In psql, run this export on one physical line. It includes only explicitly approved, non-DNC records with a phone value. The result is a local CSV file ready for field mapping.

\copy (SELECT phone,first_name,last_name,email,state,postal_code,source FROM public.lead_import_staging WHERE approved_for_import IS TRUE AND do_not_call IS FALSE AND NULLIF(btrim(phone),'') IS NOT NULL) TO '/absolute/path/empireos-approved-leads.csv' WITH (FORMAT csv, HEADER true, ENCODING 'UTF8')

Keep the original source database and its DNC records. Excluding a suppressed row from an export does not create a corresponding DNC record inside EmpireOS; confirm the destination’s suppression list with your administrator before any dialing.

STEP 4

Bring the CSV into EmpireOS.

Sign in to your own company’s EmpireOS address as an administrator. Start with a small authorized sample in a dedicated campaign with dialing paused and no advisors ready. Imported lists can become available to that campaign.

  1. Open campaign administration and choose Upload Lead List.
  2. Select the destination campaign or playlist and give the list a recognizable name. Enter the lead provider, anticipated lead count, and actual cost paid when requested. Use your company’s source name for an internal export; enter zero cost only if that is accurate.
  3. Select empireos-approved-leads.csv. Choose the intended distribution; Campaign only — assign advisors later avoids assigning it prematurely.
  4. Map phone to Phone. Map the other columns to the matching contact fields shown by your deployment. Create any necessary custom fields before importing, or deliberately ignore columns you do not need.
  5. Choose Review Mapping, inspect examples and required fields, then choose Confirm and Import Leads when the mapping is correct.
  6. Reconcile the result: accepted, invalid, duplicate, and DNC totals. Inspect sample customer records and the campaign’s list counts. Correct rejected rows before retrying them.
  7. Confirm scripts, time zones, calling rules, DNC handling, and advisor assignment. Complete an authorized test call and review the result before enabling production dialing.
Your data is now in the workflow.

CSV import is a transfer of the selected records. It does not create a live, two-way connection to the source PostgreSQL database. Future batches need another reviewed import or a separately designed integration.

FOR YOUR IMPLEMENTATION ADMINISTRATOR

Using PostgreSQL as EmpireOS’s operational database.

This is a deployment change, separate from uploading a source list. An arbitrary source table is not the EmpireOS application schema.

  1. Provision customer-owned PostgreSQL and Redis resources and credentials. Keep the source staging database separate from the application datastore.
  2. Back up the running application data and verify recovery. Configure the protected DATABASE_URL and Redis connection for the approved deployment, then apply the EmpireOS schema migrations.
  3. Begin with the documented shadow-mode migration and reconcile campaigns, lists, lead records, assignments, callbacks, and suppression records.
  4. Run a controlled pilot and verify import, disposition, callback, DNC, and CRM workflows, plus database backup restoration and rollback.
  5. Activate required database mode only after the implementation team approves the reconciliation and readiness checks. Confirm the deployment’s administrator datastore status and service health.

Database credentials belong in the deployment’s protected configuration. The onboarding questionnaire is not a database-connection form, and raw SQL inserts into EmpireOS’s internal tables bypass the importer’s validation.

If something does not work

Connection refused or TLS error

Check the database hostname, port, approved network access, username, and provider CA certificate. Keep certificate verification enabled while correcting the connection settings.

CSV column or boolean error

Compare the file’s nine columns and their order with the staging table. Use UTF-8 and explicit true/false flags. A quoted comma belongs inside a CSV field.

Zero approved rows

Review the approval and do-not-call flags. The export intentionally excludes unapproved or suppressed records. Do not change suppression flags merely to increase the export count.

EmpireOS rejects records

Review field mapping, phone format, required fields, and the duplicate/DNC totals. Correct the source and retry only the intended records.

Need help planning the migration?

Bring your source-system name, approximate record count, required fields, and hosting preference. Share credentials only through your approved secure process.