# 2021-04-21-17:09:11+0800 Migrate stripe credits to free trial points

- Cause: https://jira.tidbcloud.com/browse/DM-474

- Operation:

The script is here https://github.com/tidbcloud/dbaas/pull/3421/files

```sh
git clone https://github.com/tidbcloud/dbaas.git
cd dbaas
go build central/cmd/credit/main.go
aws-vault exec prod -- kubectl port-forward -n prod svc/db-tidb 4000:4000
./main --host=127.0.0.1 --central-db=dbaas --billing-db=billing --user=root --password='' --stripe-sk='' --port=4000 > migrate-credit.log
```

- Impact: The free trial points might be mis-added

- Recovery operation: 

1. recover database: `delete from dbaas.free_trial_points where description ='migrate to DB';`
2. recover stripe balance if needed: `grep "remove credit from stripe" migrate-credit.log`

Find which customer is updated, and how much balance is added. then update it on stripe manually.

- Time window: 2021-04-21 18:45 ~ 2021-04-21 19:30
