Installation & Start Up
vanadiumdb-core is the main database executable. vanadiumdb-crystal is the user interface.
Docker Compose
This is the easiest way is to deploy VanadiumDB inside a docker container. Here is the docker compose. The software starts at port 3306 TCP - MariaDB / MySQL compatible interface and on port 8080 with JSON-REST interface:
version: "3.9"
services:
vanadiumdb-core:
image: 4security/vanadiumdb-core:latest
restart: always
container_name: vanadiumdb-core
environment:
HTTPPORT: 8080
TCPPORT: 3306
ROOTUSERNAME: root
ROOTPASSWORD: test
JWT_SECRET: dsfasffasdfsadfasfas
JWT_EXPIRATION_IN_SECONDS: 31536000
ports:
- 3306:3306
- 8080:8080
volumes:
- vanadiumdb_storage:/home/default/.vanadiumdb
- vanadiumdb_backup_storage:/home/default/.vanadiumdbbackup
vanadiumdb-crystal:
image: 4security/vanadiumdb-crystal:latest
restart: always
container_name: vanadiumdb-crystal
ports:
- 60057:8080
volumes:
vanadiumdb_storage:
vanadiumdb_backup_storage:
Consider to open the ports for 8080 with reverse proxy in front of it. Port 3036 uses the binary database MariaDB format and cannot be behind such a proxy and should not be published!
You can change the ports by adapting the left side of the ports in the docker compose.
Storage location is <YOUR HOME DIRECTORY>/.vanadiumdb. In the docker compose define a volume that points to /home/default/.vanadiumdb.
You cannot login with the root user via API or User Interface Crystal. Use the CLI mode. Register a new user in Crystal or create a user via the root user in the CLI.
Native Installation (non service)
VanadiumDB is available for a bunch of platforms. Download a file that is suitable for your operating system:
- Windows x86 vanadiumdb_windows_amd64_v1/vanadiumdb.exe --> Download and run it in the command line
vanadiumdb.exe cli+ Allow access to the internet - Linux x86 vanadiumdb_linux_amd64_v1/vanadiumdb --> Download, allow execution
chmod +x vanadiumdband run it with./vanadiumdb cli - macOS ARM vanadiumdb_darwin_arm64_v8.0/vanadiumdb --> Download, allow execution
chmod +x vanadiumdband run it with./vanadiumdb cli
On the first installation, the software creates the folders <YOUR HOME DIRECTORY>/.vanadiumdb and <YOUR HOME DIRECTORY>/.vanadiumdbbackup. Then the software downloads some sample data and basic storage structures (13 KB). You can directly prompt the database default and the table art including some masterpieces.
Native Installation (service)
- Download Linux x86
vanadiumdb_linux_amd64_v1/vanadiumdb - Run the comamnds
sudo cat >/lib/systemd/system/vanadiumdb.service <<- "EOF"
# https://www.atpeaz.com/running-go-app-as-a-service-on-ubuntu/
[Unit]
Description=VanadiumDB database
[Service]
Type=simple
Restart=always
RestartSec=5s
WorkingDirectory=/opt/vanadiumdb
ExecStart=/opt/vanadiumdb/vanadiumdb
[Install]
WantedBy=multi-user.target
EOF
cudo cp vanadiumdb /opt/vanadiumdb/vanadiumdb
sudo chmod +x /opt/vanadiumdb/vanadiumdb
sudo systemctl enable vanadiumdb
sudo systemctl status vanadiumdb
- Service should be up-to-date
Migrate Your Data
Always keep a backup of your data by dumping the data regularly (and before you migrating). VanadiumDB is still in beta.
Dump your data from Postgres
To dump a complete database in pgAdmin (PostgreSQL) or phpMyAdmin (MySQL/MariaDB), follow the steps below for each tool.
Dumping a Complete Database in pgAdmin (PostgreSQL). pgAdmin provides two main methods to dump a database:
Using the Backup Tool (GUI)
Using the pg_dump Command Line Tool (More control)
Method 1: Using the Backup Tool (GUI)
- Open pgAdmin and connect to your PostgreSQL server.
- Expand the server tree and locate the database you want to dump.
- Right-click the database and select Backup.!pgAdmin Backup Option
In the Backup dialog:
Filename: Choose a path and name for the backup file (e.g., mydatabase_backup.sql).
Format: Select Plain (for SQL) or Custom (for a compressed binary format).
Encoding: Keep the default or select as needed.
Role name: Select the role with sufficient privileges.
Dump options:
- Check Blobs to include large objects.
- Check Data to include table data.
- Check Schema to include the schema.
- Check Privileges to include access permissions.
- Click Backup to start the dump process.
Method 2: Using pg_dump Command Line
If you prefer the command line, use pg_dump:
bashpg_dump -U username -h hostname -p port -d database_name -f output_file.sql
Example:
bashpg_dump -U postgres -h localhost -p 5432 -d mydatabase -f /home/user/mydatabase_backup.sql
To include additional options (e.g., blobs, schema-only, data-only):
bashpg_dump -U postgres -h localhost -p 5432 -d mydatabase \
--blobs \
--schema-only \
--file=/home/user/mydatabase_schema.sql
Dump your data from MySQL/MariaDB
phpMyAdmin provides a simple GUI method to dump a database.
Method: Using the Export Tool
- Open phpMyAdmin and log in to your MySQL/MariaDB server.
- Select the database you want to dump from the left sidebar.
- Click the Export tab at the top.
In the Export section:
Format: Select SQL.
Output: Choose Save output to a file (recommended).
Dump table: Select All tables or specific tables.
Object creation options:
- Check Add DROP TABLE / VIEW / PROCEDURE / FUNCTION / EVENT statement.
- Check IF NOT EXISTS.
- Check AUTO_INCREMENT value.
7- Check Add CREATE DATABASE / USE statement (if you want to include the database name). - Click Go to start the export.
The database dump will be downloaded as an .sql file.
Import the dump
- Move the sql dump to the binary of vanadium DB
- Run the Import-Script