...
Code Block | ||||
---|---|---|---|---|
| ||||
pg_dump -U username -h hostname -a --inserts -t 'files' -t 'logs' filesender |
sed -r 's/^(INSERT\ INTO\ )(files|logs)(\ VALUES\ )/\1`\2`\3/g' |
sed -r '/SET\ ([a-z_]*)\ =\ (.*);/d' |
sed -r '/SELECT\ pg_catalog.setval(.*);/d' |
grep --color=never "^INSERT INTO" |
mysql -u username -h hostname -p filesender |
...
Code Block | ||||
---|---|---|---|---|
| ||||
pg_dump -U username -h hostname -a --inserts filesender |
grep --color=never "^INSERT INTO" |
sed -r '/SET\ ([a-z_]*)\ =\ (.*);/d' |
sed -r '/SELECT\ pg_catalog.setval(.*);/d' |
sqlite3 filesender.sqlite |
SQLite to PostgreSQL
fixme
Code Block | ||||
---|---|---|---|---|
| ||||
sqlite3 filesender.sqlite | grep -E --color=never "^INSERT\ INTO\ \"(logs|files)\" VALUES" | psql -U username -h hostname filesender |
SQLite to MySQL
fixme
Code Block | ||||
---|---|---|---|---|
| ||||
sqlite3 filesender.sqlite .dump | sed -r 's/^(INSERT\ INTO\ )"(logs|files)"(\ VALUES)/\1`\2`\3/g' | grep --color=never "^INSERT INTO \`" | mysql -u username -h hostname -p filesender |
...