{"id":28254414,"url":"https://github.com/domains18/migrate-cloud-supabase","last_synced_at":"2026-05-08T01:40:27.274Z","repository":{"id":292314450,"uuid":"979874024","full_name":"Domains18/migrate-cloud-supabase","owner":"Domains18","description":"A robust CLI tool to safely migrate PostgreSQL databases from Google Cloud SQL to Supabase. Built 100% using python, it is a resource capable of cleaning data and migrating data from a cloud service like gcp to supabase","archived":false,"fork":false,"pushed_at":"2025-05-11T19:12:38.000Z","size":46,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-05-19T19:21:17.654Z","etag":null,"topics":["database","python","supabase","utils"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Domains18.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-08T07:50:25.000Z","updated_at":"2025-05-11T19:12:41.000Z","dependencies_parsed_at":"2025-05-09T09:39:04.824Z","dependency_job_id":null,"html_url":"https://github.com/Domains18/migrate-cloud-supabase","commit_stats":null,"previous_names":["domains18/migrate-cloud-supabase"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Domains18/migrate-cloud-supabase","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Domains18%2Fmigrate-cloud-supabase","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Domains18%2Fmigrate-cloud-supabase/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Domains18%2Fmigrate-cloud-supabase/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Domains18%2Fmigrate-cloud-supabase/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Domains18","download_url":"https://codeload.github.com/Domains18/migrate-cloud-supabase/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Domains18%2Fmigrate-cloud-supabase/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259934424,"owners_count":22934327,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["database","python","supabase","utils"],"created_at":"2025-05-19T19:19:47.319Z","updated_at":"2026-05-08T01:40:27.238Z","avatar_url":"https://github.com/Domains18.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CloudSQL to Supabase Migration Tool\n\nA robust CLI tool to safely migrate PostgreSQL databases from Google Cloud SQL to Supabase.\n\n\n## Installation\n\n### 1. Clone the repository (or create the project structure)\n\n```bash\ngit clone https://github.com/Domains18/migrate-cloud-supabase.git\ncd cloudsql-to-supabase\n```\n\n### 2. Set up a virtual environment (recommended)\n\n```bash\npython -m venv venv\nsource venv/bin/activate  # On Windows: venv\\Scripts\\activate\n```\n\n### 3. Install the package\n\n```bash\npip install -e .\n```\n\n### 4. Configure your environment\n\nCopy the example `.env` file and edit it with your database details:\n\n```bash\ncp .env.example .env\n```\n\nEdit the `.env` file with your database credentials:\n\n```env\n# CloudSQL Configuration\nCLOUDSQL_USER=your_cloudsql_user\nCLOUDSQL_HOST=your_cloudsql_host\nCLOUDSQL_DB=your_database_name\nCLOUDSQL_PORT=5432\nCLOUDSQL_SSL_MODE=prefer\nCLOUDSQL_SCHEMA=public  # Source schema to export from\n\n# Supabase Configuration\nSUPABASE_USER=postgres\nSUPABASE_HOST=your_supabase_host.supabase.co\nSUPABASE_DB=postgres\nSUPABASE_PASSWORD=your_supabase_password\nSUPABASE_PORT=5432\nSUPABASE_SSL_MODE=require\nSUPABASE_SCHEMA=public  # Target schema to import into\n\n# Output Configuration\nOUTPUT_DIR=./outputs\nOUTPUT_DUMP=backup.sql\nCLEANED_DUMP=cleaned_backup.sql\n```\n\n## Usage\n\n### Validate Your Configuration\n\nBefore running any migration, check that your configuration is valid:\n\n```bash\npython main.py validate\n```\n\n### Full Migration\n\nRun a complete migration from CloudSQL to Supabase in one command:\n\n```bash\npython main.py migrate\n```\n\nYou'll be prompted for your CloudSQL password during the process.\n\n### Full Migration with Custom Schema\n\nTo migrate data from a specific CloudSQL schema to a custom Supabase schema:\n\n```bash\npython main.py migrate --source-schema=my_source_schema --target-schema=my_target_schema\n```\n\n### Using with a Manually Downloaded Dump File\n\nIf you've already downloaded a PostgreSQL dump from CloudSQL:\n\n```bash\n# First clean the dump for Supabase compatibility\npython main.py clean-dump --input-file your_dump.sql --target-schema=my_schema\n\n# Then import the cleaned dump to Supabase\npython main.py import-db --input-file cleaned_backup.sql --schema=my_schema\n```\n\n### Step-by-Step Migration\n\nYou can also run each step of the migration separately:\n\n1. Export from CloudSQL:\n   ```bash\n   python main.py backup\n\n## Requirements\n\n- Python 3.8+\n- PostgreSQL client tools (psql, pg_dump)\n- Access to both CloudSQL and Supabase databases\n\n## Troubleshooting\n\n### Common Issues\n\n1. **\"Command not found\" errors**\n   - Ensure that PostgreSQL client tools are installed and in your PATH\n   - On Ubuntu/Debian: `sudo apt-get install postgresql-client`\n   - On macOS with Homebrew: `brew install libpq` and `brew link --force libpq`\n\n2. **Connection errors**\n   - Verify your database credentials in the `.env` file\n   - Check that your IP is allowed in both CloudSQL and Supabase network settings\n   - Test connection manually: `psql -h your_host -U your_user -d your_db`\n\n3. **Import errors**\n   - Common Supabase import issues are fixed by the cleaning step\n   - For specific table errors, you may need to customize the `clean.py` replacement rules\n\n### Getting Help\n\nFor more detailed logs, use the `--verbose` flag with any command:\n\n```bash\npython main.py migrate --verbose\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdomains18%2Fmigrate-cloud-supabase","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdomains18%2Fmigrate-cloud-supabase","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdomains18%2Fmigrate-cloud-supabase/lists"}