9

How can I easily duplicate my production database (mydb) to create a dev database (mydb-dev)?

The rethinkdb restore command seems to have no option to specify the name of the output database. It only has the option to select which database I'd like to restore from the dump. I'm using rethinkdb 1.16.3

mikemaccana
  • 81,787
  • 73
  • 317
  • 396
3k-
  • 2,077
  • 2
  • 21
  • 24
  • I don't much about rethinkdb, but as best I can tell you need a new instance and then restore to that. https://github.com/rethinkdb/docs/blob/master/3-cluster-administration/migration.md https://github.com/rethinkdb/docs/blob/master/5-deploying-rethinkdb/backup.md – bf2020 Apr 05 '15 at 15:26

1 Answers1

9

You can use rethinkdb export, extract the archive, and rename the directory inside before importing it:

$ rethinkdb export
$ cd rethinkdb_export_2015-04-05T13:54:43
$ mv mydb mydb_dev
$ rethinkdb import -d ./

Thinker tool by internalfx also allows you to clone a database to a different DB, using the --targetDB= option.

mikemaccana
  • 81,787
  • 73
  • 317
  • 396
Daniel Mewes
  • 1,826
  • 12
  • 15