dumpr 1.4 → 1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/History.md +3 -3
- data/README.md +19 -24
- data/dumpr.gemspec +2 -2
- data/lib/dumpr/driver.rb +5 -5
- data/lib/dumpr/util.rb +2 -2
- data/lib/dumpr/version.rb +1 -1
- metadata +9 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fc389dfe47cee75a1693efcc96b2320f859107abf58456a9cb13730bcd9ff252
|
4
|
+
data.tar.gz: e50b33f103457183f669acac00197fbc6f1751572384d85c6659afda25b45835
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eeba1bbc43df3747fff76e87f692ea805705acc36b92c96c0d92e41f6cbad8930b32d733aa31b55ceb78298a7ce3adba7d61011aed0b908f9a5177217bcafe85
|
7
|
+
data.tar.gz: a49a759ab2fe9361d2cc32a2c1efe6eec8bf6f639aaf36c7a462eccd6c53fcc000c956b07f511deaaf8a2970852bb45fccfa194501fe9904ace9c3b8de63b1d3
|
data/History.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# HISTORY
|
2
2
|
|
3
|
-
This is the changelog version history for the dumpr gem.
|
3
|
+
This is the changelog version history for the [dumpr](https://rubygems.org/gems/dumpr) gem.
|
4
4
|
|
5
5
|
## dumpr 1.4
|
6
6
|
|
@@ -17,9 +17,9 @@ This is the changelog version history for the dumpr gem.
|
|
17
17
|
* Added command `dumpr-import`.
|
18
18
|
* Deprecated `dumpr -i` option, replaced by `dumpr-import`.
|
19
19
|
|
20
|
-
## dumpr 1.
|
20
|
+
## dumpr 1.1
|
21
21
|
|
22
|
-
*
|
22
|
+
* Improved usage
|
23
23
|
|
24
24
|
|
25
25
|
## dumpr 1.0
|
data/README.md
CHANGED
@@ -5,9 +5,15 @@ Features:
|
|
5
5
|
* generates gzipped sql dump files for a specific database or specific tables.
|
6
6
|
* automates transfer of dump files to remote hosts
|
7
7
|
* automates import
|
8
|
+
* support for MySQL and Postgres.
|
8
9
|
|
9
10
|
Executables installed:
|
10
11
|
* dumpr
|
12
|
+
* dumpr-import
|
13
|
+
|
14
|
+
The current version is [dumpr 1.4](https://rubygems.org/gems/dumpr).
|
15
|
+
|
16
|
+
Recent changes are documented in [History](https://github.com/jamesdickson6/dumpr/blob/master/History.md).
|
11
17
|
|
12
18
|
### Dependencies
|
13
19
|
* [Ruby ≥ 2.2.1](http://www.ruby-lang.org/en/downloads/)
|
@@ -48,23 +54,26 @@ You can write your own scripts that use a *Dumpr::Driver*
|
|
48
54
|
|
49
55
|
### Exporting
|
50
56
|
|
51
|
-
Generate yourdb.sql.gz and transfer it to
|
57
|
+
Generate yourdb.sql.gz and transfer it to another server.
|
58
|
+
|
52
59
|
```ruby
|
53
|
-
Dumpr::Driver::Mysql.
|
54
|
-
:user => 'backupuser',
|
55
|
-
:
|
56
|
-
:
|
60
|
+
Dumpr::Driver::Mysql.dump(
|
61
|
+
:user => 'backupuser',
|
62
|
+
:password => '12345',
|
63
|
+
:db => 'test_database',
|
64
|
+
:destination => 'server2:/data/dumps/test_database.sql'
|
57
65
|
)
|
58
66
|
```
|
59
67
|
|
60
68
|
### Importing
|
61
69
|
|
62
|
-
Then, over on dbserver2
|
70
|
+
Then, over on **dbserver2**, import your dump file.
|
63
71
|
```ruby
|
64
72
|
Dumpr::Driver::Mysql.import(
|
65
|
-
:user => 'importuser',
|
66
|
-
:
|
67
|
-
:
|
73
|
+
:user => 'importuser',
|
74
|
+
:password => '12345',
|
75
|
+
:db => 'test_database',
|
76
|
+
:file => '/data/dumps/test_database.sql'
|
68
77
|
)
|
69
78
|
```
|
70
79
|
|
@@ -72,23 +81,9 @@ Then, over on dbserver2, import your dump file
|
|
72
81
|
|
73
82
|
See *Dumpr::Driver*
|
74
83
|
|
75
|
-
|
76
|
-
## CHANGELOG
|
77
|
-
|
78
|
-
### Version 1.3
|
79
|
-
* Split binary, new command `dumpr-import` to replace `dumpr --import`
|
80
|
-
* Postgres support (beta)
|
81
|
-
|
82
|
-
### Version 1.2
|
83
|
-
* Changed gem and binary command from `dumper` to `dumpr`
|
84
|
-
|
85
|
-
### Version 1.1
|
86
|
-
* Tweaks
|
87
|
-
|
88
|
-
### Version 1.0
|
89
|
-
* Initial release
|
90
84
|
|
91
85
|
## TODO
|
86
|
+
|
92
87
|
* automate importing after an export (socket communication exporter/importer, or just lockfile checking / polling)
|
93
88
|
* security: stop logging passwords
|
94
89
|
* daemonize, maybe?
|
data/dumpr.gemspec
CHANGED
@@ -7,10 +7,10 @@ Gem::Specification.new do |s|
|
|
7
7
|
s.version = Dumpr::Version.to_s
|
8
8
|
s.platform = Gem::Platform::RUBY
|
9
9
|
s.authors = ["James Dickson"]
|
10
|
-
s.email = ["
|
10
|
+
s.email = ["james.dickson@hpe.com"]
|
11
11
|
s.homepage = "http://github.com/jamesdickson6/dumpr"
|
12
12
|
s.summary = "Dump and import databases."
|
13
|
-
s.description = "Dumpr provides an easy way to dump and import databases.
|
13
|
+
s.description = "Dumpr provides an easy way to dump and import databases. Support for MySQL and Postgres databases."
|
14
14
|
s.files = `git ls-files -z`.split("\x0")
|
15
15
|
s.executables = s.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
16
16
|
s.test_files = s.files.grep(%r{^(test|spec|features)/})
|
data/lib/dumpr/driver.rb
CHANGED
@@ -131,12 +131,12 @@ module Dumpr
|
|
131
131
|
Util.with_lockfile("localhost", dumpfn, @opts[:force]) do
|
132
132
|
|
133
133
|
logger.debug "preparing dump..."
|
134
|
-
if !File.
|
134
|
+
if !File.exist?(File.dirname(dumpfn))
|
135
135
|
run "mkdir -p #{File.dirname(dumpfn)}"
|
136
136
|
end
|
137
137
|
|
138
138
|
# avoid overwriting dump files..
|
139
|
-
if File.
|
139
|
+
if File.exist?(dumpfn)
|
140
140
|
if @opts[:force]
|
141
141
|
logger.warn "#{dumpfn} exists, moving it to #{dumpfn}.1"
|
142
142
|
#run "rm -f #{dumpfn}.1;"
|
@@ -183,8 +183,8 @@ module Dumpr
|
|
183
183
|
end
|
184
184
|
|
185
185
|
def decompress
|
186
|
-
if File.
|
187
|
-
if File.
|
186
|
+
if File.exist?(@dumpfile + ".gz")
|
187
|
+
if File.exist?(@dumpfile) && !@opts[:force]
|
188
188
|
logger.warn "skipping decompress because #{@dumpfile} already exists."
|
189
189
|
else
|
190
190
|
logger.debug "decompressing..."
|
@@ -202,7 +202,7 @@ module Dumpr
|
|
202
202
|
Util.with_lockfile("localhost", @dumpfile, @opts[:force]) do
|
203
203
|
decompress if @gzip
|
204
204
|
|
205
|
-
if !File.
|
205
|
+
if !File.exist?(@dumpfile)
|
206
206
|
raise "Cannot import #{@dumpfile} because it does not exist!"
|
207
207
|
else
|
208
208
|
dumpsize = Util.human_file_size("localhost", @dumpfile)
|
data/lib/dumpr/util.rb
CHANGED
@@ -5,7 +5,7 @@ module Dumpr
|
|
5
5
|
|
6
6
|
def self.file_exists?(h, fn)
|
7
7
|
if h == "localhost"
|
8
|
-
File.
|
8
|
+
File.exist?(fn)
|
9
9
|
else
|
10
10
|
`ssh #{h} test -f '#{fn}' &> /dev/null`
|
11
11
|
$?.success?
|
@@ -14,7 +14,7 @@ module Dumpr
|
|
14
14
|
|
15
15
|
def self.dir_exists?(h, fn)
|
16
16
|
if h == "localhost"
|
17
|
-
File.
|
17
|
+
File.exist?(fn)
|
18
18
|
else
|
19
19
|
`ssh #{h} test -d '#{fn}' &> /dev/null`
|
20
20
|
$?.success?
|
data/lib/dumpr/version.rb
CHANGED
metadata
CHANGED
@@ -1,19 +1,19 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dumpr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '1.
|
4
|
+
version: '1.5'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Dickson
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-07-31 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
|
-
description: Dumpr provides an easy way to dump and import databases.
|
14
|
-
|
13
|
+
description: Dumpr provides an easy way to dump and import databases. Support for
|
14
|
+
MySQL and Postgres databases.
|
15
15
|
email:
|
16
|
-
-
|
16
|
+
- james.dickson@hpe.com
|
17
17
|
executables:
|
18
18
|
- csv2sqlinsert
|
19
19
|
- dumpr
|
@@ -44,7 +44,7 @@ homepage: http://github.com/jamesdickson6/dumpr
|
|
44
44
|
licenses:
|
45
45
|
- MIT
|
46
46
|
metadata: {}
|
47
|
-
post_install_message:
|
47
|
+
post_install_message:
|
48
48
|
rdoc_options: []
|
49
49
|
require_paths:
|
50
50
|
- lib
|
@@ -59,9 +59,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
59
59
|
- !ruby/object:Gem::Version
|
60
60
|
version: '0'
|
61
61
|
requirements: []
|
62
|
-
|
63
|
-
|
64
|
-
signing_key:
|
62
|
+
rubygems_version: 3.4.10
|
63
|
+
signing_key:
|
65
64
|
specification_version: 4
|
66
65
|
summary: Dump and import databases.
|
67
66
|
test_files: []
|