The Altium database migration tool is a Spring boot application that helps handle changes from Git component repository to local database for offline development or any other hosted Postgres database by data source.
- User run docker command, then if application image is not in local storage it will be downloaded from public docker hub
- The container will start with user provided DB connection or default for local development
- After the start, application will fetch from repository migration scripts(database sql dump)
- Then liquibase migration tool will check database state and update it if needed
- Application can be run as many times as needed, it won't overwrite data or duplicate them.
- First, download and install Docker here: Download Docker Desktop for Windows
- After Docker has been installed, check it with:
docker ps
in command prompt - Then need to signup/sign-in for Docker hub. Open Docker desktop and then
Sign in
:
- Check login with command:
docker login
-
Now when Docker has configured. Need to install PostgresDB for local environment
- First option. Run Database in container see here
- Run in command line:
docker pull postgres
, it will pull the latest Postgres image - Run Database image:
docker run -d -p 5432:5432\ --name dev-postgres \ -e POSTGRES_PASSWORD=postgres \ -e POSTGRES_USER=postgres \ -e POSTGRES_DB=altium-components \ postgres
- Run in command line:
- Second option. Download and install Postgres for local development here ->
Download the installer
- Download and install PgAdmin tool from here
- Create empty Database:
- In
Database
field write:altium-components
->Save
- Check that empty database has been created:
- First option. Run Database in container see here
-
Optionally: Create DB schema, or
altium
will be created as default schema. It will be used for all migrations -
When all has been configured and empty Database created. Then run application
Local development
docker run -p 5432:5432 -e PROFILE=docker-dev ximtech/altium-migrator
Custom Database Hosting
Note: For custom datasource do not change PROFILE
variable
docker run -p 5432:5432 \
-e PROFILE=prod \
-e ALTIUM_DB_DATASOURCE='jdbc:postgresql://host.docker.internal:5432/altium-components' \
-e ALTIUM_DB_USERNAME='postgres' \
-e ALTIUM_DB_PASSWORD='postgres' \
-e LIQUIBASE_SCHEMA_NAME=altium \
ximtech/altium-migrator:latest
- At the end check that all data has been transferred:
Database Structure