Update Config local to remote name
This commit is contained in:
@@ -30,7 +30,7 @@ Exports OHLCV candle/price data from the `prices-bucket`.
|
||||
```
|
||||
|
||||
**Interactive Prompts:**
|
||||
- Select environment (SandboxLocal or ProductionLocal)
|
||||
- Select environment (SandboxRemote or ProductionRemote)
|
||||
- Select time range (7 days, 30 days, 90 days, 1 year, all data, or custom)
|
||||
|
||||
**Output:**
|
||||
@@ -78,8 +78,8 @@ Imports prices-bucket CSV export data into any InfluxDB environment.
|
||||
## Configuration
|
||||
|
||||
The scripts automatically read InfluxDB connection settings from:
|
||||
- `src/Managing.Api/appsettings.SandboxLocal.json`
|
||||
- `src/Managing.Api/appsettings.ProductionLocal.json`
|
||||
- `src/Managing.Api/appsettings.SandboxRemote.json`
|
||||
- `src/Managing.Api/appsettings.ProductionRemote.json`
|
||||
|
||||
**Required settings in appsettings files:**
|
||||
```json
|
||||
@@ -96,11 +96,11 @@ The scripts automatically read InfluxDB connection settings from:
|
||||
|
||||
```
|
||||
exports/
|
||||
├── SandboxLocal/
|
||||
├── SandboxRemote/
|
||||
│ └── 20241028_143022/
|
||||
│ ├── prices-bucket_data.csv
|
||||
│ └── export-metadata.txt
|
||||
└── ProductionLocal/
|
||||
└── ProductionRemote/
|
||||
└── 20241028_160000/
|
||||
├── prices-bucket_data.csv
|
||||
└── export-metadata.txt
|
||||
@@ -132,7 +132,7 @@ exports/
|
||||
```bash
|
||||
cd scripts/influxdb
|
||||
./export-prices-bucket.sh
|
||||
# Select: 1 (SandboxLocal)
|
||||
# Select: 1 (SandboxRemote)
|
||||
# Select: 5 (All data)
|
||||
```
|
||||
|
||||
@@ -140,7 +140,7 @@ cd scripts/influxdb
|
||||
```bash
|
||||
cd scripts/influxdb
|
||||
./export-prices-bucket.sh
|
||||
# Select: 1 (SandboxLocal)
|
||||
# Select: 1 (SandboxRemote)
|
||||
# Select: 3 (Last 90 days)
|
||||
```
|
||||
|
||||
@@ -150,14 +150,14 @@ cd scripts/influxdb
|
||||
|
||||
# Step 1: Export from sandbox
|
||||
./export-prices-bucket.sh
|
||||
# Select: 1 (SandboxLocal)
|
||||
# Select: 1 (SandboxRemote)
|
||||
# Select: 5 (All data)
|
||||
|
||||
# Step 2: Import to production
|
||||
./import-csv-data.sh
|
||||
# Select source: 1 (SandboxLocal)
|
||||
# Select source: 1 (SandboxRemote)
|
||||
# Select: Latest export timestamp
|
||||
# Select target: 2 (ProductionLocal)
|
||||
# Select target: 2 (ProductionRemote)
|
||||
# Confirm: yes
|
||||
```
|
||||
|
||||
@@ -167,7 +167,7 @@ cd scripts/influxdb
|
||||
|
||||
# Export current production data
|
||||
./export-prices-bucket.sh
|
||||
# Select: 2 (ProductionLocal)
|
||||
# Select: 2 (ProductionRemote)
|
||||
# Select: 5 (All data)
|
||||
|
||||
# If something goes wrong, restore it:
|
||||
@@ -341,5 +341,5 @@ For issues or questions, refer to:
|
||||
All scripts are located in: `/Users/oda/Desktop/Projects/managing-apps/scripts/influxdb/`
|
||||
|
||||
Configuration files:
|
||||
- Sandbox: `/Users/oda/Desktop/Projects/managing-apps/src/Managing.Api/appsettings.SandboxLocal.json`
|
||||
- Production: `/Users/oda/Desktop/Projects/managing-apps/src/Managing.Api/appsettings.ProductionLocal.json`
|
||||
- Sandbox: `/Users/oda/Desktop/Projects/managing-apps/src/Managing.Api/appsettings.SandboxRemote.json`
|
||||
- Production: `/Users/oda/Desktop/Projects/managing-apps/src/Managing.Api/appsettings.ProductionRemote.json`
|
||||
|
||||
@@ -55,19 +55,19 @@ echo " InfluxDB Prices Data Export"
|
||||
echo "======================================"
|
||||
echo ""
|
||||
echo "Select environment:"
|
||||
echo "1) SandboxLocal"
|
||||
echo "2) ProductionLocal"
|
||||
echo "1) SandboxRemote"
|
||||
echo "2) ProductionRemote"
|
||||
echo ""
|
||||
read -p "Enter your choice (1 or 2): " ENV_CHOICE
|
||||
|
||||
case $ENV_CHOICE in
|
||||
1)
|
||||
ENVIRONMENT="SandboxLocal"
|
||||
APPSETTINGS_FILE="$SRC_DIR/Managing.Api/appsettings.SandboxLocal.json"
|
||||
ENVIRONMENT="SandboxRemote"
|
||||
APPSETTINGS_FILE="$SRC_DIR/Managing.Api/appsettings.SandboxRemote.json"
|
||||
;;
|
||||
2)
|
||||
ENVIRONMENT="ProductionLocal"
|
||||
APPSETTINGS_FILE="$SRC_DIR/Managing.Api/appsettings.ProductionLocal.json"
|
||||
ENVIRONMENT="ProductionRemote"
|
||||
APPSETTINGS_FILE="$SRC_DIR/Managing.Api/appsettings.ProductionRemote.json"
|
||||
;;
|
||||
*)
|
||||
error "Invalid choice. Please run the script again and select 1 or 2."
|
||||
|
||||
@@ -131,19 +131,19 @@ info "CSV file: $(basename "$CSV_FILE") ($CSV_SIZE)"
|
||||
# Select target environment for import
|
||||
echo ""
|
||||
echo "Select TARGET environment for import:"
|
||||
echo "1) SandboxLocal"
|
||||
echo "2) ProductionLocal"
|
||||
echo "1) SandboxRemote"
|
||||
echo "2) ProductionRemote"
|
||||
echo ""
|
||||
read -p "Enter your choice (1 or 2): " TARGET_ENV_CHOICE
|
||||
|
||||
case $TARGET_ENV_CHOICE in
|
||||
1)
|
||||
TARGET_ENVIRONMENT="SandboxLocal"
|
||||
APPSETTINGS_FILE="$SRC_DIR/Managing.Api/appsettings.SandboxLocal.json"
|
||||
TARGET_ENVIRONMENT="SandboxRemote"
|
||||
APPSETTINGS_FILE="$SRC_DIR/Managing.Api/appsettings.SandboxRemote.json"
|
||||
;;
|
||||
2)
|
||||
TARGET_ENVIRONMENT="ProductionLocal"
|
||||
APPSETTINGS_FILE="$SRC_DIR/Managing.Api/appsettings.ProductionLocal.json"
|
||||
TARGET_ENVIRONMENT="ProductionRemote"
|
||||
APPSETTINGS_FILE="$SRC_DIR/Managing.Api/appsettings.ProductionRemote.json"
|
||||
;;
|
||||
*)
|
||||
error "Invalid choice. Please run the script again and select 1 or 2."
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Script to import privy-users.csv into WhitelistAccounts table
|
||||
# Uses connection string from appsettings.ProductionLocal.json
|
||||
# Uses connection string from appsettings.ProductionRemote.json
|
||||
|
||||
set -e # Exit on error
|
||||
|
||||
@@ -9,7 +9,7 @@ set -e # Exit on error
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
|
||||
CSV_FILE="$SCRIPT_DIR/privy-users.csv"
|
||||
SETTINGS_FILE="$PROJECT_ROOT/src/Managing.Api/appsettings.ProductionLocal.json"
|
||||
SETTINGS_FILE="$PROJECT_ROOT/src/Managing.Api/appsettings.ProductionRemote.json"
|
||||
|
||||
# Check if CSV file exists
|
||||
if [ ! -f "$CSV_FILE" ]; then
|
||||
|
||||
@@ -82,11 +82,11 @@ log "🚀 Starting safe migration for environment: $ENVIRONMENT"
|
||||
|
||||
# Validate environment
|
||||
case $ENVIRONMENT in
|
||||
"Development"|"SandboxLocal"|"ProductionLocal"|"Oda")
|
||||
"Development"|"SandboxRemote"|"ProductionRemote"|"Oda")
|
||||
log "✅ Environment '$ENVIRONMENT' is valid"
|
||||
;;
|
||||
*)
|
||||
error "❌ Invalid environment '$ENVIRONMENT'. Use: Development, SandboxLocal, ProductionLocal, or Oda"
|
||||
error "❌ Invalid environment '$ENVIRONMENT'. Use: Development, SandboxRemote, ProductionRemote, or Oda"
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
Reference in New Issue
Block a user