Data Archiving for Salesforce
Linux + PostgreSQL
Configure an archive workflow that keeps historical records useful while separating retention from everyday operations.
What you will leave with
An agreed archive scope, a verified destination copy, and a retrieval test before any source cleanup is considered.
In this guide
Deployment model
Configure a defined record scope in Salesforce, run the archive workflow on your Linux host, and retain the resulting data in the selected database.
- Make record selection explicit: object or table, fields, date and status filters, related records, and attachments. Keep exclusions in the same configuration record.
- Review retained-data access separately from source sharing and field permissions. Define who can browse, export, or use archived data through an agent.
- Treat source cleanup as a separate approved operation. Validate the retained copy, dependencies, retention requirements, and recovery procedure before authorizing deletion.
Use the installation package and version-specific configuration supplied for your deployment. This guide covers the source, host, database, and workflow decisions that remain consistent across package versions.
Before you begin
Bring the application owner, infrastructure owner, and data owner into the same deployment review. Agree the boundaries before configuring a connection.
Decisions to make together
- Which records are inactive, and what makes them eligible for archiving?
- Which related records and attachments must remain available together?
- Who sets retention periods, handles holds, and authorizes source deletion?
- A named Salesforce administrator and an approved organization for the initial deployment.
- An inventory of standard and custom objects, relationship fields, and required files.
- A connection identity with the least access needed for the agreed task.
- An API usage budget and a plan for validating source automation during any write test.
Prepare Salesforce
Use a Salesforce sandbox or an approved test scope first. Inventory the objects, fields, and relationships that make up the business record.
Object visibility
Compare the connection account's visible objects and fields with the approved scope. Include custom objects and fields in the sample instead of validating only standard records.
Record relationships
Map parent and child records, reference identifiers, and files. For a recovery test, review required fields, validation rules, and automation that can affect inserted or updated records.
Inspect a small Salesforce record set
In an authenticated Salesforce REST client, use the API version supported by your org and deployment. Describe Case first to review the available fields and relationships, then send this bounded query. The paths below are source API requests, not Vivly endpoints.
HTTP
GET /services/data/vXX.X/sobjects/Case/describe/
GET /services/data/vXX.X/query/?q=SELECT+Id,CaseNumber,Status,AccountId,LastModifiedDate+FROM+Case+ORDER+BY+Id+LIMIT+10What to verify
Compare the returned IDs and fields with the same user's Salesforce view. For larger extracts, follow nextRecordsUrl until done is true; the first response is not necessarily the complete result. Describe output helps establish the field and relationship inventory, not a full backup of org metadata.
Salesforce: query results and paginationPrepare Linux
Prepare a Linux host with a dedicated application identity and an agreed operational model. Record the distribution and package version for your selected product.
Runtime and service account
Install the runtime required by the deployment package. Use an application account with scoped filesystem access and record who manages the service lifecycle.
Network and trust
Validate source and database routes, DNS, proxy settings, and certificate trust. Keep application access limited to the agreed network and avoid embedding credentials in scripts or shell history.
Persistent storage
Plan persistent locations for data and logs, with disk alerts and a recovery procedure. Check restart behavior and the handling of interrupted work before adding a schedule.
Check the Linux host
Run these read-only checks on the application host. Compare the distribution and architecture with the requirements for the supplied package, and identify the filesystem that holds persistent state.
Shell
cat /etc/os-release
uname -m
df -h
systemctl list-units --all --type=service 'vivly*'What to verify
Record the distribution, architecture, capacity, and installed service state. Native systemd packages need an operational service manager. An empty Vivly service list before installation is expected; after installation, reconcile it with the package's required units.
Install the Salesforce Archive Linux package
- Use the vivly-archive-connector-postgres Debian package supplied for your release. The documented package targets x86_64 Ubuntu 22.04/24.04 or Debian 12 with systemd. Verify your release's prerequisites and checksum before installation.
- Prepare a separately managed PostgreSQL database. The Linux package does not bundle a database server. Scope the connection account to the destination and the schema operations required by the application.
- Install the supplied .deb through apt so package dependencies are resolved. Provision the license using the package setup procedure; services remain disabled without a valid license. The enrollment code and license key serve different purposes.
- Check vivly-archive-api, vivly-archive-wizard, vivly-archive-dashboard, and vivly-archive-agent. Reach the loopback dashboard through an approved SSH tunnel to port 3022, then complete Database, Salesforce, and Enrollment setup. The database connection test must pass before creating a policy.
- Include /etc/vivly configuration, /var/lib/vivly persistent state and files, and the external database in the operating plan. Preserve secret-store keys through upgrades and recovery; keep them out of support logs.
Prepare PostgreSQL
Define the PostgreSQL database, schema, account, and storage owner. For a Windows embedded setup, identify the database service and persistent data directory created by the package.
Connection and privileges
Record whether PostgreSQL is embedded or separately managed, its version, and the connection configuration. Review the required database and schema privileges rather than granting broad administrative access by default.
Data representation
Test timestamps and time zones, numeric precision, large text, and source identifiers. Compare reference identifiers with the source and test how a changed source field appears at the destination.
Storage and recovery
Plan database capacity, growth monitoring, and database backups. For an embedded deployment, identify the data directory and verify that application upgrades or host replacement preserve it.
Check the PostgreSQL connection context
Connect to the intended archive or backup database with the application role, then run this read-only query. For embedded Windows installations, use the endpoint and port recorded by the installed package.
SQL
SELECT current_database() AS database_name,
current_user AS database_user,
current_schema() AS schema_name;
SHOW server_version;
SHOW TimeZone;What to verify
Confirm the database, role, schema, and time zone before comparing source values. For remote libpq connections, sslmode=verify-full validates both the certificate chain and hostname when the trusted CA is configured. An encrypted connection alone does not prove the server's identity.
PostgreSQL: TLS and server certificate verificationConfigure the workflow
Start with a representative dataset, then expand the scope after validation. Use the connection settings established above and keep source changes behind the appropriate approval.
Create a policy
Open Create policy and define the Salesforce object scope and selection criteria. Start with a small group of closed or inactive records. Include required fields, relationships, and files in the configuration record, along with any exclusions.
Preview the selected records
Choose Preview records and compare the selection with the intended business rule. Check date boundaries, active records, missing values, and related records before running the archive workflow.
Validate the retained copy
Compare record counts and sampled field values with the source. Exercise the retrieval workflow that the business will actually use. Include a user who should have access and one who should not.
Make cleanup a separate decision
Do not use a completed transfer as proof that source records can be removed. Approve a cleanup policy only after retention, dependencies, retrieval, and recovery requirements have been reviewed.
Pilot: retrieve a closed case with its context
Choose a small, explicitly approved set of closed cases. Record their IDs, account relationships, required activity, and files before capture. Keep active cases and held records outside the selection.
- Preview the policy and reconcile its selected IDs with the agreed sample.
- Run capture, then compare the retained fields, parent relationships, and files with the source.
- Ask an archive user to find a known case and open its required context through the intended viewer.
- Test an archive user who must not see this history, using the archive's own access policy.
Scope of this example
Complete this pilot without source deletion. Reclamation requires its own verified eligibility, approval, and maintained write freeze. Live Salesforce sharing is not automatically replayed by the archive viewer.
Validate before expanding
- The selection rule includes the intended records and excludes held or active records.
- Source identifiers and required relationships can be traced in the retained data.
- A business user can retrieve an agreed historical case using the intended access path.
- Retention, source cleanup, and recovery responsibilities have named owners.
Keep a deployment record
Record the package version, environment, data scope, test date, expected result, actual result, and owner of each unresolved issue. Keep secrets and customer data out of shared support notes.
Everyday operations
After each run
Review completion status, record counts, failures, and source API usage. Resolve unexpected differences before allowing the next dependent action.
When credentials change
Update the connection through the approved secret process, verify a bounded read, and retest the required operations. Remove obsolete credentials.
When the source changes
Review added or changed objects, fields, access rules, and automation. Repeat representative data and permission checks before expanding the scope.
Before an upgrade
Record the current package and configuration, protect persistent data, and define the rollback procedure. Validate connectivity and a representative workflow after the change.
Troubleshooting
The archive contains fewer records than expected
Compare the selection rule, source account visibility, date boundaries, API responses, and excluded record types. Reconcile counts before changing the scope.
A historical record lacks useful context
Check whether related records, custom fields, and attachments were included. Test retrieval across the complete business case rather than a single row.
A record should not be removed
Stop the cleanup step and review active dependencies, retention holds, and the approved deletion boundary with the data owner.
PostgreSQL rejects a connection or write
Check the endpoint, database name, account, TLS settings, network access policy, and schema privileges. For embedded deployments, also check process health and available disk space.
Technical references
Use these official references for the source APIs, database connection settings, and runtime behavior discussed above. They describe the underlying platforms; use your Vivly package documentation for its installation and supported configuration.
Review this deployment with Vivly
Bring your source scope, host, database, and success criteria. We will use them to identify the applicable package, open questions, and rollout sequence.
Book a demo