Homepage

Cleaning an Instance

Last edit: Nov 28, 2022

Important

Cleaning an Instance is possible on staging environments only.

This guide will help you use the pos-cli to clean data on your Instance.

Requirements

This is an advanced tutorial. To follow it, you should be familiar with basic platformOS concepts, the Get Started section, and have pos-cli installed.

Disclaimer

  • Deleting data stored in the database using pos-cli data clean is irreversible. Caution is advised.
  • pos-cli will ask you for confirmation, so you don't delete data by accident.
  • This operation is asynchronous, which means it may take several seconds before it is completed and visible in the browser.

Cleaning only records and users

To clear only data stored in records and users, use the pos-cli data clean command:


$ pos-cli data clean ENVIRONMENT

For example:


$ pos-cli data clean staging

[22:37:35]
[22:37:35] WARNING!!! You are going to REMOVE your data from instance: https://pawel-examples.staging.oregon.platform-os.com/
[22:37:35] There is no coming back.
[22:37:35]
✔ If you still want to continue please type: 'CLEAN DATA'  … CLEAN DATA
[22:37:41] Going to clean data
[22:37:43] Instance data scheduled to be clean.

Cleaning all the data from database

By adding --include-schema (-i) to the command, you can additionally remove all admin resources, pages, schemas, graphql queries, notifications.
It will not clear Instance constants (found in context.constants) or anything set up in the Partner Portal (test_emails, integration keys).


$ pos-cli data clean ENVIRONMENT --include-schema

For example:


$ pos-cli data clean staging --include-schema

[22:39:14]
[22:39:14] WARNING!!! You are going to REMOVE your data and database schemas from instance: https://pawel-examples.staging.oregon.platform-os.com/
[22:39:14] There is no coming back.
[22:39:14]
✔ If you still want to continue please type: 'CLEAN DATA'  … CLEAN DATA
[22:39:17] Going to clean data
[22:39:19] Instance data scheduled to be clean.

Questions?

We are always happy to help with any questions you may have.

contact us