MPDX Developers
HomeHelp
Production
Production
  • Changelog
  • README
  • org_data_transfer
  • README
    • README
      • Account Lists
        • :Account List
        • Analytics
        • Chalkline Mail
        • Coaches
        • Designation Accounts
        • Donations
        • Donor Accounts
        • Entries
        • Financial Accounts
        • Imports
          • Csv
          • Google
          • Tnt
          • Tnt Data Sync
        • Invites
        • Mail Chimp Account
        • Merge
        • Notification Preferences
          • Bulk
        • Notifications
        • Pledges
        • Prayer Letters Account
        • Users
        • :account_list_id
          • Donations
        • :account_list_id
          • donations
            • Bulk
      • README
        • Impersonation
        • Organizations
        • Resets
      • Announcements
      • Appeals
        • Appeal Contacts
          • Bulk
        • Excluded Appeal Contacts
          • Bulk
      • Background Batches
      • Batch
      • Coaching
        • Answer Sets
        • Answers
        • Questions
      • Constants
      • Contacts
        • Addresses
        • Alma Mater Names
        • Analytics
        • Bulk
        • Church Names
        • Duplicates
        • README
        • Exports
          • Mailing
        • Filters
        • Merges
        • Partner Giving Analysis Filters
        • People
          • Bulk
          • Email Addresses
          • Facebook Accounts
          • Linkedin Accounts
          • Merges
          • Phones
          • Relationships
          • Twitter Accounts
          • Websites
        • Referrals
        • Referrers
        • Tags
          • Bulk
      • Deleted Records
      • Organizations
        • Account Lists
          • Account List Coaches
          • Account List Users
          • Invites
        • Admins
        • Contacts
        • Impersonation
        • Invites
      • Public
        • Designation Accounts
          • Subscriptions
      • README
        • Activity Results
        • Appointment Results
        • Donation Histories
        • Donation Monthly Totals
        • Donor Currency Donations
        • Entry Histories
        • Expected Monthly Totals
        • Goal Progress
        • Monthly Giving Graph
        • Monthly Losses Graphs
        • Partner Giving Analysis
        • People With Anniversaries
        • People With Birthdays
        • Pledge Histories
        • Salary Currency Donations
        • Tag Histories
        • Year Donations
      • Tasks
        • Analytics
        • Comments
        • Filters
        • Tags
      • README
        • Analytics
      • User
        • Account List Coaches
        • Announcements
        • Authenticate
        • Devices
        • Google Accounts
          • Google Integrations
        • Key Accounts
        • Notifications
        • Options
        • Organization Accounts
Powered by GitBook
On this page
  • Building an export:
  • Run MPDX locally with export

org_data_transfer

Building an export:

  1. turn on extract database:

    assume-role -e p -- aws rds start-db-instance --db-instance-identifier mpdx-api-extract-prod

  2. reset transfer database

     run-locally -e s \
       --docker-args "\
         -e DATADOG_TRACE=false\
         -e DB_ENV_POSTGRESQL_DB=mpdx_extract\
         -e DB_ENV_POSTGRESQL_USER=mpdx_extract_admin\
         -e DB_ENV_POSTGRESQL_PASS=REDACTED\
         -e DB_PORT_5432_TCP_ADDR=mpdx-api-extract-prod.ctzggtk79wff.us-east-1.rds.amazonaws.com" \
       -p false bash
  3. start data transfer:

    • prod_console

    • Organization::Restorer.restore("05df083a-6836-4148-a15a-ae6d72d00749")

  4. wait for sidekiq batch to finish

  5. Dump transfer database to compressed file:

    pg_dump -Fc \
       -h mpdx-api-extract-prod.ctzggtk79wff.us-east-1.rds.amazonaws.com \
       -f ./transfer-test1.dmp \
       -U mpdx_extract_admin \
       -d mpdx_extract
  6. Transfer all s3 files to transfer bucket:

    Organization::Restorer.new("05df083a-6836-4148-a15a-ae6d72d00749").restore_attachments(progress_bar: true)

  7. Sync all files from transfer bucket to a local directory:

    assume-role -e p -- aws s3 sync s3://mpdx-transmit-production docker_data/s3

  8. Zip dir:

    tar -cf - docker_data/s3 | xz -1 -c - -> docker_data/s3.tar.xz

  9. turn off extract database:

    assume-role -e p -- aws rds stop-db-instance --db-instance-identifier mpdx-api-extract-prod

Run MPDX locally with export

  1. pg restore:

    • git checkout public-dockerfile

    • Start the api database server: docker-compose up -d db

    • Create database: createdb -h localhost -p 54322 -U postgres mpdx_extract

    • Restore data to database:

      pg_restore -c -d mpdx_extract -h localhost -p 54322 -U postgres --no-privileges --no-owner ./transfer-test.dmp

  2. build mpdx_api docker image:

    • bin/public_build.sh (requires SIDEKIQ_CREDS to be set on host env)

  3. run mpdx api:

    • docker-compose up

  4. run mpdx_web:

    • cd mpdx_web

    • npm install

    • API_URL=http://localhost:50000/api/v2 OAUTH_URL=http://auth.lvh.me:50000/auth/user npm run start

PreviousREADMENextREADME

Last updated 3 years ago

open

http://localhost:8081