pgml-cms/docs/introduction/import-your-data/pg-dump.md
pg_dump is a command-line PostgreSQL tool that can move data between PostgreSQL databases. If you're planning a migration from your database to PostgresML, pg_dump is a good tool to get you going quickly.
If your database is reasonably small (10 GB or less), you can just run pg_dump in one command:
{% tabs %} {% tab title="pg_dump" %}
pg_dump \
--no-owner \
--clean \
--no-privileges \
postgres://user:[email protected]/production_db | \
psql postgres://user:[email protected]:6432/your_pgml_db
{% endtab %} {% endtabs %}
This will take a few minutes, and once the command completes, all your data, including indexes, will be in your PostgresML database.
If your database is larger, you can split the migration into multiple steps, migrating one or more tables at a time.
{% tabs %} {% tab title="pg_dump" %}
pg_dump \
--no-owner \
--clean \
--no-privileges \
-t users \
-t orders \
postgres://user:[email protected]/production_db | \
psql postgres://user:[email protected]:6432/your_pgml_db
{% endtab %} {% endtabs %}