# Migrate Users Balance

Project owners can migrate all user balance from existing system via a CSV file.&#x20;

## Upload CSV for Balance Updates

```
/upload-csv <csv_file>
```

Features:

* Bulk update user balances
* Requires specific CSV format
* Includes validation checks
* Requires Administrator permission

### CSV File Format Requirements

Required CSV Format:

```csv
Discord User ID,Discord Username,Balance
123456789,username,1000
```

Validation Rules:

1. Must have exactly 3 columns
2. Header must be exactly: "User ID, Username, Balance"
3. User ID must be a positive number
4. Balance cannot be negative
5. Username must not exceed 32 characters
6. All fields must be filled
7. No empty rows allowed

### Upload Errors

The system will check for:

1. Invalid file format
2. Missing or incorrect headers
3. Invalid data types
4. Missing values
5. Negative balances
6. Invalid user IDs
7. Username length violations

Error Response Format:

```
CSV Validation Failed:
❌ Found X errors in the CSV file. No changes were made to the database.

Errors:
- Row X: [Error Description]
- Row Y: [Error Description]
... and Z more errors
```
