From c5fe25c149c159b965cd8c5b304d39a88773da12 Mon Sep 17 00:00:00 2001 From: dorkdiaries9 <142151605+dorkdiaries9@users.noreply.github.com> Date: Wed, 29 Oct 2025 05:19:47 +0530 Subject: [PATCH] Enhance migration script with logging and error handling (#2103) Added logging for migration steps and error handling. --- scripts/migrate_to_v1_vectorstore.py | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/scripts/migrate_to_v1_vectorstore.py b/scripts/migrate_to_v1_vectorstore.py index da83c4c1..a74fb90d 100644 --- a/scripts/migrate_to_v1_vectorstore.py +++ b/scripts/migrate_to_v1_vectorstore.py @@ -84,6 +84,21 @@ def migrate_mongo_atlas_vector_to_v1_vectorstore(): logger.info("Mongo Atlas migration completed") if __name__ == "__main__": - migrate_faiss_to_v1_vectorstore() - migrate_to_v1_vectorstore_mongo() - migrate_mongo_atlas_vector_to_v1_vectorstore() + try: + logger.info("Starting FAISS migration...") + migrate_faiss_to_v1_vectorstore() + logger.info("FAISS migration completed successfully ") + + logger.info("Starting local Mongo migration...") + migrate_to_v1_vectorstore_mongo() + logger.info("Local Mongo migration completed successfully ") + + logger.info("Starting Mongo Atlas migration...") + migrate_mongo_atlas_vector_to_v1_vectorstore() + logger.info("Mongo Atlas migration completed successfully ") + + logger.info(" All migrations completed successfully!") + + except Exception as e: + logger.error(f" Migration failed due to error: {e}") + logger.warning(" Please verify database state or restore from backups if necessary.")