Last active
May 6, 2023 09:08
-
-
Save meyt/c9fad6f820238df53a7e4d96f585f057 to your computer and use it in GitHub Desktop.
Export MS Access database (accdb, accde) in linux+mdbtools
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# tested with mdbtools@0.9.1-1 on Debian@11 | |
# | |
# Setup: | |
# sudo apt install mdbtools -y | |
# | |
# Usage: | |
# bash ./acc2sql.sh mydb.accdb mydb.sql | |
## | |
mdb=$1 | |
sql=$2 | |
backend='postgres' | |
for table in $(mdb-tables $mdb); do | |
echo $table $mdb | |
mdb-export -I $backend $mdb $table >> $sql | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment