chore: remove obsolete scripts and dev artifacts
This commit is contained in:
72
README.md
72
README.md
@@ -1,60 +1,60 @@
|
||||
# go-migrate
|
||||
|
||||
Migrador de datos entre SQL Server y PostgreSQL con procesamiento en paralelo.
|
||||
Data migrator between SQL Server and PostgreSQL with parallel ETL processing.
|
||||
|
||||
## Compilar
|
||||
## Build
|
||||
|
||||
```bash
|
||||
go build -o go-migrate ./cmd/go_migrate
|
||||
```
|
||||
|
||||
## Uso
|
||||
## Usage
|
||||
|
||||
```bash
|
||||
./go-migrate [opciones] [<ruta-config>]
|
||||
./go-migrate [options] [<config-path>]
|
||||
```
|
||||
|
||||
### Opciones
|
||||
### Options
|
||||
|
||||
| Flag | Descripción |
|
||||
| Flag | Description |
|
||||
|------|-------------|
|
||||
| `-config <path>` | Ruta al archivo de configuración YAML. También se puede pasar como argumento posicional. Si no se indica, se busca `config.yaml`. |
|
||||
| `-validate` | Compara la cantidad de filas entre origen y destino por cada job. No migra datos. |
|
||||
| `-dry-run` | Valida conexiones, acceso a storage (si aplica) y cuenta filas en origen sin migrar. |
|
||||
| `-config <path>` | Path to the YAML configuration file. Can also be passed as a positional argument. Defaults to `config.yaml` in the current directory. |
|
||||
| `-validate` | Compares the row count between source and target for each job. Does not migrate data. |
|
||||
| `-dry-run` | Validates connections, storage access (if applicable), and counts source rows without migrating. |
|
||||
|
||||
### Ejemplos
|
||||
### Examples
|
||||
|
||||
```bash
|
||||
# Migrar con config.yaml por defecto
|
||||
# Migrate using the default config.yaml
|
||||
./go-migrate
|
||||
|
||||
# Usar un archivo de configuración específico
|
||||
./go-migrate -config produccion.yaml
|
||||
# Use a specific configuration file
|
||||
./go-migrate -config production.yaml
|
||||
|
||||
# Validar que origen y destino tengan la misma cantidad de filas
|
||||
./go-migrate -validate -config produccion.yaml
|
||||
# Validate that source and target have the same row count
|
||||
./go-migrate -validate -config production.yaml
|
||||
|
||||
# Verificar conectividad sin migrar
|
||||
./go-migrate -dry-run -config produccion.yaml
|
||||
# Check connectivity without migrating
|
||||
./go-migrate -dry-run -config production.yaml
|
||||
```
|
||||
|
||||
## Configuración
|
||||
## Configuration
|
||||
|
||||
La herramienta lee credenciales y parámetros desde variables de entorno o un archivo `.env`.
|
||||
The tool reads credentials and parameters from environment variables or a `.env` file.
|
||||
|
||||
### Variables clave
|
||||
### Key environment variables
|
||||
|
||||
| Variable | Descripción |
|
||||
| Variable | Description |
|
||||
|----------|-------------|
|
||||
| `SOURCE_DB_URL` | URL de conexión a la base de datos origen (o `SOURCE_DB_HOST`, `SOURCE_DB_NAME`, `SOURCE_DB_USER`, `SOURCE_DB_PWD`). |
|
||||
| `TARGET_DB_URL` | URL de conexión a la base de datos destino (o `TARGET_DB_HOST`, `TARGET_DB_NAME`, `TARGET_DB_USER`, `TARGET_DB_PWD`). |
|
||||
| `LOG_LEVEL` | Nivel de log: `DEBUG`, `INFO`, `WARN`, `ERROR` (por defecto: `INFO`). |
|
||||
| `SOURCE_DB_URL` | Source database connection URL. Alternatively, set `SOURCE_DB_HOST`, `SOURCE_DB_NAME`, `SOURCE_DB_USER`, and `SOURCE_DB_PWD`. |
|
||||
| `TARGET_DB_URL` | Target database connection URL. Alternatively, set `TARGET_DB_HOST`, `TARGET_DB_NAME`, `TARGET_DB_USER`, and `TARGET_DB_PWD`. |
|
||||
| `LOG_LEVEL` | Log level: `DEBUG`, `INFO`, `WARN`, `ERROR` (default: `INFO`). |
|
||||
|
||||
Para migrar datos binarios a Azure Blob, también se requieren `AZ_STORAGE_ENABLED`, `AZ_ACCOUNT_NAME`, `AZ_CONTAINER`, `AZ_ACCOUNT_KEY`.
|
||||
To migrate binary data to Azure Blob Storage, also set `AZ_STORAGE_ENABLED`, `AZ_ACCOUNT_NAME`, `AZ_CONTAINER`, and `AZ_ACCOUNT_KEY`.
|
||||
|
||||
### Archivo de migración (YAML)
|
||||
### Migration config file (YAML)
|
||||
|
||||
Define los jobs de migración. Ejemplo mínimo:
|
||||
Defines the migration jobs. Minimal example:
|
||||
|
||||
```yaml
|
||||
source_db_type: sqlserver
|
||||
@@ -72,21 +72,21 @@ defaults:
|
||||
max_delay_ms: 5000
|
||||
|
||||
jobs:
|
||||
- name: migrar_usuarios
|
||||
- name: demo_users
|
||||
enabled: true
|
||||
source:
|
||||
schema: dbo
|
||||
table: Usuarios
|
||||
primary_key: Id
|
||||
table: users
|
||||
primary_key: id
|
||||
target:
|
||||
schema: public
|
||||
table: usuarios
|
||||
table: users
|
||||
```
|
||||
|
||||
Consulta el archivo `config.yaml` de tu entorno para ver los jobs disponibles y sus parámetros específicos.
|
||||
See the `config.yaml` in this repository for the full set of supported options (`from_json`, `to_storage`, partition slicing via `range`, per-job overrides, `pre_sql`/`post_sql`, etc.).
|
||||
|
||||
## Modos de ejecución
|
||||
## Execution modes
|
||||
|
||||
- **Migración** (por defecto): extrae, transforma y carga datos en paralelo.
|
||||
- **Validación** (`-validate`): cuenta y compara filas entre origen y destino.
|
||||
- **Dry run** (`-dry-run`): verifica conexiones y muestra la cantidad de filas en origen.
|
||||
- **Migrate** (default): extracts, transforms, and loads data in parallel.
|
||||
- **Validate** (`-validate`): counts and compares rows between source and target.
|
||||
- **Dry run** (`-dry-run`): validates connections and reports the source row count without migrating.
|
||||
|
||||
Reference in New Issue
Block a user