any documentation for migration from old PGVector to the new one? #61

Open
opened 2026-02-16 05:16:23 -05:00 by yindo · 2 comments
Owner

Originally created by @arezazadeh on GitHub (Nov 18, 2024).

are there any documentaion for migrating from old PGVector to the new one?
I have lots of user's data sitting in my database and i do not want to lose them. and there is no proper documentation that shows the migration process without losing data

Originally created by @arezazadeh on GitHub (Nov 18, 2024). are there any documentaion for migrating from old PGVector to the new one? I have lots of user's data sitting in my database and i do not want to lose them. and there is no proper documentation that shows the migration process without losing data
Author
Owner

@arezazadeh commented on GitHub (Nov 19, 2024):

ok i figured it out, i had to build the db on a new machine with new pgvector to see the difference.

If you are facing the same issue follow below steps:

  • What has changes:

In langchain_pg_embedding they have removed the uuid field with uuid field type and replaced it with id with character varying for whatever reason.

  • Solution
  1. Create another field id with char varying type,
  2. Copy your uuid fields values to id field ,
  3. change the primary key from uuid to id
  4. drop the uuid field.

also they have changed bunch of other stuff like arguments to PGVector class, be mindful of those as well.

@arezazadeh commented on GitHub (Nov 19, 2024): ok i figured it out, i had to build the db on a new machine with new pgvector to see the difference. **If you are facing the same issue follow below steps:** * **What has changes:** > In `langchain_pg_embedding` they have removed the `uuid` field with `uuid field type` and replaced it with `id` with `character varying` for whatever reason. * **Solution** 1. Create another field `id` with char varying type, 2. Copy your uuid fields values to `id` field , 3. change the primary key from `uuid` to `id` 4. drop the `uuid` field. also they have changed bunch of other stuff like arguments to PGVector class, be mindful of those as well.
Author
Owner

@alberto-agudo commented on GitHub (Jul 3, 2025):

I guess these new resources now solve your issue @arezazadeh?

migrate_pgvector_to_pgvectorstore.ipynb
migrate_pgvector_to_pgvectorstore.md

@alberto-agudo commented on GitHub (Jul 3, 2025): I guess these new resources now solve your issue @arezazadeh? [migrate_pgvector_to_pgvectorstore.ipynb](https://github.com/langchain-ai/langchain-postgres/blob/main/examples/migrate_pgvector_to_pgvectorstore.ipynb) [migrate_pgvector_to_pgvectorstore.md](https://github.com/langchain-ai/langchain-postgres/blob/main/examples/migrate_pgvector_to_pgvectorstore.md)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langchain-postgres#61