Skip to content

SEED-platform/seed-prune

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SEED-Prune

This script allows you to cull all data from a SEED database except for specific organizations and users.

  1. Create a .env file with the following structure

    DB_NAME=seed
    DB_HOST=192.168.7.200
    DB_USER=seeduser
    DB_PASSWORD=password
    DB_PORT=5432
    
    API_URL=http://seed.lan:8000/api/v3/
    API_USERNAME=[email protected]
    API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    
    ORGS_TO_KEEP=[123,456]
    USERS_TO_KEEP=[1,2,3]
  2. Run npm run start

  • All organizations except those referenced will be fully deleted
  • All users except for those referenced will be deleted
    • Some additional users may remain who have foreign key attachments to objects within preserved organizations
    • Any users that remain and aren't referenced in the .env file will have their password hashes reset to be password

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published