All Projects → hgfischer → Mysqlsuperdump

hgfischer / Mysqlsuperdump

Licence: other
Generate partial and filtered dumps of MySQL databases

Programming Languages

go
31211 projects - #10 most used programming language

Labels

Projects that are alternatives of or similar to Mysqlsuperdump

Next
Directus is a real-time API and App dashboard for managing SQL database content. 🐰
Stars: ✭ 111 (-3.48%)
Mutual labels:  mysql
Sqhell.vim
An SQL wrapper for vim
Stars: ✭ 113 (-1.74%)
Mutual labels:  mysql
Bilibili member crawler
B站用户爬虫 好耶~是爬虫
Stars: ✭ 115 (+0%)
Mutual labels:  mysql
Jobs Search
🕷招聘网站爬虫合集,不定期更新分支
Stars: ✭ 111 (-3.48%)
Mutual labels:  mysql
Esaymarket
拖拽生成落地页,app,小程序实现测试开发运维部署客服一体化
Stars: ✭ 113 (-1.74%)
Mutual labels:  mysql
Community
开源论坛、问答系统,现有功能提问、回复、通知、最新、最热、消除零回复功能。功能持续更新中…… 技术栈 Spring、Spring Boot、MyBatis、MySQL/H2、Bootstrap
Stars: ✭ 1,947 (+1593.04%)
Mutual labels:  mysql
Bireme
Bireme is an incremental synchronization tool for the Greenplum / HashData data warehouse
Stars: ✭ 110 (-4.35%)
Mutual labels:  mysql
Akka Persistence Sql Async
A journal and snapshot store plugin for akka-persistence using RDBMS.
Stars: ✭ 115 (+0%)
Mutual labels:  mysql
Online
Python3+Django+MySQL+Xadmin 在线学习平台
Stars: ✭ 113 (-1.74%)
Mutual labels:  mysql
Laravel Social Network
Laravel 5.4 - location-based social network
Stars: ✭ 114 (-0.87%)
Mutual labels:  mysql
Kkbinlog
支持mysql、MongoDB数据变更订阅分发
Stars: ✭ 112 (-2.61%)
Mutual labels:  mysql
Astpp
Open Source VoIP Billing Solution http://www.astppbilling.org | Report a bug https://jira.astppbilling.org
Stars: ✭ 112 (-2.61%)
Mutual labels:  mysql
Tcpdp
tcpdp is TCP dump tool with custom dumper and structured logger written in Go.
Stars: ✭ 114 (-0.87%)
Mutual labels:  mysql
Honeyeql
HoneyEQL is a Clojure library enables you to query database using the EDN Query Language.
Stars: ✭ 111 (-3.48%)
Mutual labels:  mysql
Spring Boot 2 Oauth2 Authorization Jwt
Spring Boot 2 OAuth2 JWT Authorization server implementation with Database for Users and Clients (JPA, Hibernate, MySQL)
Stars: ✭ 115 (+0%)
Mutual labels:  mysql
Slightphp
SlightPHP 高效的PHP敏捷开发框架
Stars: ✭ 110 (-4.35%)
Mutual labels:  mysql
Nukeviet
NukeViet CMS is multi Content Management System. NukeViet CMS is the 1st open source content management system in Vietnam. NukeViet was awarded the Vietnam Talent 2011, the Ministry of Education and Training Vietnam officially encouraged to use.
Stars: ✭ 113 (-1.74%)
Mutual labels:  mysql
Servicestack.ormlite
Fast, Simple, Typed ORM for .NET
Stars: ✭ 1,532 (+1232.17%)
Mutual labels:  mysql
Sql Kit
*️⃣ Build SQL queries in Swift. Extensible, protocol-based design that supports DQL, DML, and DDL.
Stars: ✭ 115 (+0%)
Mutual labels:  mysql
Sql To Jdl
Tool to translate SQL databases to JDL format of jHipster (Created due to existing databases to be generated with jHipster and build angular-java web)
Stars: ✭ 114 (-0.87%)
Mutual labels:  mysql

MySQL Super Dump

Build Status Go Report Card

MySQL Super Dump is a tool to efficiently create filtered and manipulated database dumps. It relies in the power of the SQL native language to do this, using WHERE clauses and complete SELECT statements with aliases to do this.

Currently it does not support every kind of MySQL structure (views, triggers, etc), but it supports the most basic stuff: schemas, tables and rows.

History

Once uppon a time there was a development team that liked to use dumps from the production database in their development environments to have the same content and behavior of the production system in their machines.

To avoid security problems, the system administrator created a script to dump the production database, import in a temporary database, then replace all sensitive data, like salts, passwords, customer names, emails, etc, for fake data, then export a dump of this temporary database to a file that is the dump developers would use.

However this script was taking more time to run, day by day, and each day it was using more resources from the server to run, until it exploded.

Features

  • Filter dumped rows by a native WHERE clause ([where] config's section)
  • Replace dumped data with native SELECT functions ([select] config's section)
  • Disable data output of specific tables ([filter] config's section: nodata)
  • Ignore entire tables ([filter] config's section: ignore)

Usage

  • Install the latest Go compiler installed (check instructions at: http://golang.org)
  • Check you environment with go env:
  • The repository will be clones at $GOPATH/src/github.com/hgfischer/mysqlsuperdump
  • The binary will be installed in $GOBIN
  • Then run go get to download, build and install mysqlsuperdump: go get github.com/hgfischer/mysqlsuperdump
  • Create a config file based on example.cfg and place where you like it.
  • Run mysqlsuperdump -h to see command line options and voilá.

Configuration Example


[mysql]
# See https://github.com/Go-SQL-Driver/MySQL for details on this
dsn = username:[email protected](address)/dbname?charset=utf8
extended_insert_rows = 1000
#use_table_lock = true
max_open_conns = 50

# Use this to restrict exported data. These are optional
[where]
sales_order           = created_at >= DATE_SUB(NOW(), INTERVAL 7 DAY)
customer_upload       = created_at >= DATE_SUB(NOW(), INTERVAL 7 DAY)
newsletter_subscriber = created_at >= DATE_SUB(NOW(), INTERVAL 7 DAY)

# Use this to override value returned from tables. These are optional
[select]
system_user.salt = 'reset salt of all system users'
system_user.password = 'reset password of all system users'

customer.first_name = CONCAT('Charlie ', id)
customer.last_name = 'Last'
customer.salt = 'reset salt of all customers'
customer.password = 'reset password of all customers'
customer.username = CONCAT(id, '@fiction.tld')
customer.username_canonical = CONCAT(id, '@fiction.tld')
customer.email = CONCAT(id, '@fiction.tld')
customer.email_canonical = CONCAT(id, '@fiction.tld')

newsletter_subscriber.email = CONCAT(id, '@fiction.tld')

customer_address.recipient_name = CONCAT('Recipient Name ', id)
customer_address.company = CONCAT('Company Name ', id)
customer_address.phone = CONCAT('(', id, ') 1234-1234')

sales_order_address.recipient_name = CONCAT('Recipient Name ', id)
sales_order_address.company = CONCAT('Company Name ', id)
sales_order_address.phone = CONCAT('(', id, ') 1234-1234')

system_dump_version.created_at = NOW()

# Use this to filter entire table (ignore) or data only (nodata)
[filter]
customer_stats = nodata
customer_private = ignore

TO DO

  • Extend MySQL support, with other objects like views, triggers, etc
  • Refactor dumper interface to support another SQL databases
  • Add support for PostgreSQL

License

Please, check the LICENSE file.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].