The purpose of this tool is to convert a VECTR 8.x MongoDB to a VECTR 9.0 Postgres DB.
All of these instructions assume you're running a standard community edition install with docker-compose on Ubuntu. If you have deviated from this standard install you will need to adjust accordingly
Create a directory for the tool to run in, for this example we'll use /opt/vectr-sql-migration
mkdir /opt/vectr-sql-migration
Download and unzip the migration zip
cd /opt/vectr-sql-migration
wget https://github.com/SecurityRiskAdvisors/vectr-sql-migration/releases/download/ce-1.0.0/sqlmigration-1.0.0.zip
unzip sqlmigration-1.0.0.zip
Create required directories
mkdir -p /opt/vectr-sql-migration/user/mongo
mkdir -p /opt/vectr-sql-migration/sqlmigrations
mkdir -p /opt/vectr-sql-migration/mongodumps
./perform_mongodump.sh -d /opt/vectr -o /opt/vectr-sql-migration/mongodumps
tar -zxvf /opt/vectr-sql-migration/mongodumps/2024_02_05__22_39_53.tgz -C /opt/vectr-sql-migration/user/mongo/
At this point you should have the dump extracted. To confirm the folder structure is correct look for the following GoldStandard folder, in our example /opt/vectr-sql-migration/user/mongo/GoldStandard
If so you are ready to proceed, if not look for any unnecessary nested folders until it is as above.
Warning: There are new constraints on the size of some fields in the sql data model that previously did not exist. The default behavior of the migration tool is to truncate large strings to conform to the new schema. If you wish to change this, in the .env file set FORCE_MIGRATE=false This will cause the migration tool to exit with errors instead of modifying data.
From your vectr-sql-migration directory run the docker-compose. Note we're running this command without the -d. We must observe the migration running in case of any errors. If you do see a violation it will print to the log. Open an issue under this project using the issue template.
docker compose up
This may take some time to process depending on the speed of your VM. A successful migration will show this at the end:
vectr-migration_1 | DONE MIGRATION
vectrmigration1_vectr-migration_1 exited with code 0
docker compose down -v
See our full Docs site to continue this guide,