Skip to content

Commit

Permalink
Migrating to GitHub workflow (twindb#37)
Browse files Browse the repository at this point in the history
* packages for undrop-for-innodb

* update license

* cosmic is not lts, so skip it

* Create FUNDING.yml

* Test compilation success

* Bump rubyzip from 1.2.2 to 1.3.0 in /omnibus-undrop-for-innodb

Bumps [rubyzip](https://github.com/rubyzip/rubyzip) from 1.2.2 to 1.3.0.
- [Release notes](https://github.com/rubyzip/rubyzip/releases)
- [Changelog](https://github.com/rubyzip/rubyzip/blob/master/Changelog.md)
- [Commits](rubyzip/rubyzip@v1.2.2...v1.3.0)

Signed-off-by: dependabot[bot] <support@github.com>

* Update docs

* remove commercial support
* since the blog is offline remove links to it, too

* Bump json from 2.2.0 to 2.3.1 in /omnibus-undrop-for-innodb

Bumps [json](https://github.com/flori/json) from 2.2.0 to 2.3.1.
- [Release notes](https://github.com/flori/json/releases)
- [Changelog](https://github.com/flori/json/blob/master/CHANGES.md)
- [Commits](ruby/json@v2.2.0...v2.3.1)

Signed-off-by: dependabot[bot] <support@github.com>

* Update README.md

* Update README.md

* Update README.md

re-enable gitter

* Bump jmespath from 1.4.0 to 1.6.2 in /omnibus-undrop-for-innodb

Bumps [jmespath](https://github.com/trevorrowe/jmespath.rb) from 1.4.0 to 1.6.2.
- [Release notes](https://github.com/trevorrowe/jmespath.rb/releases)
- [Changelog](https://github.com/jmespath/jmespath.rb/blob/main/CHANGELOG.md)
- [Commits](jmespath/jmespath.rb@v1.4.0...v1.6.2)

---
updated-dependencies:
- dependency-name: jmespath
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* Build package for jammy and focal (twindb#36)

* Build package for jammy and focal

* Remove previous packaging attempt

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  • Loading branch information
akuzminsky and dependabot[bot] authored Aug 23, 2023
1 parent cccdb19 commit 63b8aea
Show file tree
Hide file tree
Showing 21 changed files with 919 additions and 28 deletions.
8 changes: 8 additions & 0 deletions .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[bumpversion]
current_version = 2.0.0
commit = True
tag = False

[bumpversion:file:omnibus-undrop-for-innodb/config/projects/undrop-for-innodb.rb]
search = build_version '{current_version}'
replace = build_version '{new_version}'
3 changes: 3 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# These are supported funding model platforms

github: [akuzminsky]
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ innochecksum_changer
lex.yy.c
sql_parser.c
stream_parser
.DS_Store
29 changes: 24 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ TARGETS = stream_parser c_parser innochecksum_changer
SRCS = stream_parser.c include/mysql_def.h c_parser.c
INC_PATH = -I./include
LIBS = -pthread -lm
BINDIR = ./bin
BINDIR ?= ./bin

CC ?= gcc
INSTALL ?=install
YACC = bison
LEX = flex

OS_VERSION ?= jammy

CFLAGS += -D_FILE_OFFSET_BITS=64 -Wall -g -O3 -pipe -fgnu89-inline
INSTALLFLAGS ?=-s
CentOS5 = $(findstring .el5,$(shell cat /proc/version))
Expand Down Expand Up @@ -67,10 +69,27 @@ install: $(TARGETS)
clean:
rm -f $(OBJECTS) $(TARGETS) lex.yy.c sql_parser.c sql_parser.output sys_parser
rm -f *.o *.core
rm -rf omnibus-undrop-for-innodb/pkg/

package: ## Build package - OS_VERSION can be: focal, jammy.
@docker run \
-v $(shell pwd):/undrop-for-innodb \
--name builder_undrop \
--rm \
--env OS_VERSION=${OS_VERSION} \
"twindb/omnibus-ubuntu:${OS_VERSION}" \
bash -l /undrop-for-innodb/omnibus-undrop-for-innodb/omnibus_build.sh


docker-start:
@docker run \
-v $(shell pwd):/undrop-for-innodb \
-it \
--rm \
centos:7 bash -l
-v $(shell pwd):/undrop-for-innodb \
-it \
--name builder_undrop \
--rm \
--dns 8.8.8.8 \
--dns 208.67.222.222 \
--env PLATFORM=${PLATFORM} \
--env OS_VERSION=${OS_VERSION} \
"twindb/omnibus-ubuntu:${OS_VERSION}" \
bash -l
44 changes: 21 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# TwinDB data recovery toolkit
## Supported Failures

[![Join the chat at https://gitter.im/twindb/undrop-for-innodb](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/twindb/undrop-for-innodb?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Join the chat at https://gitter.im/twindb/undrop-for-innodb](https://badges.gitter.im/Join%20Chat.svg)](https://matrix.to/#/#twindb_undrop-for-innodb_undrop-for-innodb:gitter.im)

TwinDB Data Recovery Toolkit is a set of tools that operate with MySQL files at low level and allow to recover InnoDB databases after different failure scenarios.

The toolkit is also known as **UnDrop for InnoDB**, which is more accurate name because the toolkit works with InnoDB tables.
Expand All @@ -17,6 +18,25 @@ The tool recovers data when backups are not available. It supports recovery from
- InnoDB files were accidentally deleted.
- A table was dropped and created empty one.
## Installation


Undrop for InnoDB overview with installation instructions and demo.
[![Undrop for InnoDB overview](https://img.youtube.com/vi/-1LeLhGjAWM/0.jpg)](https://www.youtube.com/watch?v=-1LeLhGjAWM)

### From packages

For Ubuntu `focal` and `jammy` you can install the toolkit from
a Debian package.

```shell
# export CODENAME="jammy"
# curl "https://infrahouse-release-$CODENAME.s3.us-west-1.amazonaws.com/pool/main/u/undrop-for-innodb/undrop-for-innodb_2.0.0-1_amd64.deb" > undrop-for-innodb_2.0.0-1_amd64.deb
# apt install ./undrop-for-innodb_2.0.0-1_amd64.deb
```


### From sources

The source code of the toolkit is hosted on GitHub. The tool has been developed on Linux, it’s known to work on CentOS 4,5,6,7, Debian, Ubuntu and Amazon Linux. Only 64 bit systems are supported.

To best way to get the source code is to clone it from GitHub.
Expand All @@ -34,25 +54,3 @@ To build the toolkit run make in the source code root:
```
# make
```
## Usage
There is a series of blog posts that describe in great details recovery from different failures.

* [Recover Table Structure From InnoDB Dictionary](https://twindb.com/recover-table-structure-from-innodb-dictionary/) – how to generate CREATE TABLE statement if you have ibdata1 file.
* [Take image from corrupted hard drive](https://twindb.com/take-image-from-corrupted-hard-drive/) – what you should do if a hard disk is dying.
* [Recover Corrupt MySQL Database](https://twindb.com/recover-corrupt-mysql-database/) – how to recover database from corrupt InnoDB tablespace. The same approach can be taken to recover from corrupt file system.
* [Recover after DROP TABLE. Case 2](https://twindb.com/recover-after-drop-table-innodb_file_per_table-on/) – how to recover InnoDB table if it was dropped and innodb_file_per_table was ON (a separate .ibd file per table).
* [Recover after DROP TABLE. Case 1](https://twindb.com/recover-innodb-table-after-drop-table-innodb/) – how to recover InnoDB table if it was dropped and innodb_file_per_table was OFF (all tables are in ibadat1 file).
* [Recover InnoDB dictionary](https://twindb.com/how-to-recover-innodb-dictionary/) – how to recover and read InnoDB dictionary tables.
* [UnDROP tool for InnoDB](https://twindb.com/undrop-tool-for-innodb/) – describes tools of the toolkit, their usage, command line options.
* [InnoDB dictionary](https://twindb.com/innodb-dictionary/) – describes InnoDB dictionary, its tables and format.
* [Overview of Undrop-for-InnoDB](https://yq.aliyun.com/articles/281230?utm_content=m_37044) - Recovery after DROP table, `innodb_file_per_table` ON and OFF, corrupted database recovery (在普通话)

## Commercial Support and Data Recovery Service

You can recover your database using the toolkit and detailed instructions from the blog posts.
We can help you to do it much faster.

[Aleksandr Kuzminsky](https://www.linkedin.com/in/akuzminsky) is an author of TwinDB data recovery toolkit and its forks.
Since 2008 he dealt with many hundreds recovery cases.

Check [MySQL Data Recovery Service](https://twindb.com/mysql-data-recovery/) to learn more about prices, prerequisites and contact details.
10 changes: 10 additions & 0 deletions omnibus-undrop-for-innodb/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
*.gem
.bundle
.kitchen/
.kitchen.local.yml
vendor/bundle
pkg/*
.vagrant
bin/*
files/**/cache/
vendor/cookbooks
41 changes: 41 additions & 0 deletions omnibus-undrop-for-innodb/.kitchen.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
driver:
name: vagrant
forward_agent: yes
customize:
cpus: 2
memory: 2048
synced_folders:
- ['.', '/home/vagrant/undrop-for-innodb']

provisioner:
name: chef_zero

platforms:
- name: centos-6
run_list: yum-epel::default
- name: centos-7
run_list: yum-epel::default
- name: debian-8
run_list: apt::default
- name: debian-9
run_list: apt::default
- name: freebsd-10
run_list: freebsd::portsnap
- name: freebsd-11
run_list: freebsd::portsnap
- name: ubuntu-14.04
run_list: apt::default
- name: ubuntu-16.04
run_list: apt::default
- name: ubuntu-18.04
run_list: apt::default

suites:
- name: default
run_list: omnibus::default
attributes:
omnibus:
build_user: vagrant
build_user_group: vagrant
build_user_password: vagrant
install_dir: /opt/undrop-for-innodb
12 changes: 12 additions & 0 deletions omnibus-undrop-for-innodb/Berksfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
source 'https://supermarket.chef.io'

cookbook 'omnibus'

# Uncomment to use the latest version of the Omnibus cookbook from GitHub
# cookbook 'omnibus', github: 'chef-cookbooks/omnibus'

group :integration do
cookbook 'apt', '~> 2.8'
cookbook 'freebsd', '~> 0.3'
cookbook 'yum-epel', '~> 0.6'
end
21 changes: 21 additions & 0 deletions omnibus-undrop-for-innodb/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
source 'https://rubygems.org'

# Install omnibus
gem 'omnibus', '~> 9.0'

# Use Chef's software definitions. It is recommended that you write your own
# software definitions, but you can clone/fork Chef's to get you started.
# gem 'omnibus-software', github: 'chef/omnibus-software'

# This development group is installed by default when you run `bundle install`,
# but if you are using Omnibus in a CI-based infrastructure, you do not need
# the Test Kitchen-based build lab. You can skip these unnecessary dependencies
# by running `bundle install --without development` to speed up build times.
group :development do
# Use Berkshelf for resolving cookbook dependencies
gem 'berkshelf'

# Use Test Kitchen with Vagrant for converging the build environment
gem 'test-kitchen'
gem 'kitchen-vagrant'
end
Loading

0 comments on commit 63b8aea

Please sign in to comment.