Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Easiest way to copy/duplicate a RethinkDB database?

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

like image 788
3k- Avatar asked Apr 05 '15 13:04

3k-


People also ask

How do I backup my RethinkDB?

RethinkDB backups use the dump command from the RethinkDB command-line utility on your running database cluster to backup your entire deployment. It saves database and table contents as well as metadata.

How do I update data in RethinkDB?

Once a document is stored in a RethinkDB table, it can be changed using the update() command. This command accepts a JSON document or ReQL expression as input and returns the number of updated documents.

How do I access RethinkDB?

The web interface. Once RethinkDB is running, you can connect to it at http://localhost:8080, assuming you've kept the default port (8080) and it's running on your local machine.


1 Answers

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.

like image 174
Daniel Mewes Avatar answered Oct 08 '22 00:10

Daniel Mewes