All Projects → masumsoft → cassandra-exporter

masumsoft / cassandra-exporter

Licence: MIT license
Simple Tool to Export / Import Cassandra Tables into JSON

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to cassandra-exporter

Fbx
📜 Single-file binary FBX importer.
Stars: ✭ 47 (+6.82%)
Mutual labels:  export, import
Couchimport
CouchDB import tool to allow data to be bulk inserted
Stars: ✭ 125 (+184.09%)
Mutual labels:  export, import
Process Migrator
Process migrator node.js utility for VSTS inherited process
Stars: ✭ 49 (+11.36%)
Mutual labels:  export, import
Lazy importer
library for importing functions from dlls in a hidden, reverse engineer unfriendly way
Stars: ✭ 544 (+1136.36%)
Mutual labels:  export, import
Sketchup Stl
A SketchUp Ruby Extension that adds STL (STereoLithography) file format import and export.
Stars: ✭ 214 (+386.36%)
Mutual labels:  export, import
Elasticsearch Dump
Import and export tools for elasticsearch
Stars: ✭ 5,977 (+13484.09%)
Mutual labels:  export, import
open2fa
Two-factor authentication app with import/export for iOS and macOS. All codes encrypted with AES 256. FaceID & TouchID support included. Written with love in SwiftUI ❤️
Stars: ✭ 24 (-45.45%)
Mutual labels:  export, import
Csvkeychain
Import/export between Apple Keychain.app and plain CSV file.
Stars: ✭ 281 (+538.64%)
Mutual labels:  export, import
Csvreader
csvreader library / gem - read tabular data in the comma-separated values (csv) format the right way (uses best practices out-of-the-box with zero-configuration)
Stars: ✭ 169 (+284.09%)
Mutual labels:  export, import
Keycloak Config Cli
Import YAML/JSON-formatted configuration files into Keycloak - Configuration as Code for Keycloak.
Stars: ✭ 147 (+234.09%)
Mutual labels:  export, import
Simple Excel
Read and write simple Excel and CSV files
Stars: ✭ 502 (+1040.91%)
Mutual labels:  export, import
Portphp
Data import/export framework for PHP
Stars: ✭ 225 (+411.36%)
Mutual labels:  export, import
Wikiteam
Tools for downloading and preserving wikis. We archive wikis, from Wikipedia to tiniest wikis. As of 2020, WikiTeam has preserved more than 250,000 wikis.
Stars: ✭ 404 (+818.18%)
Mutual labels:  export, dump
Bentools Etl
PHP ETL (Extract / Transform / Load) library with SOLID principles + almost no dependency.
Stars: ✭ 45 (+2.27%)
Mutual labels:  export, import
Npoi.mapper
Use this tool to import or export data with Excel file. The tool is a convention based mapper between strong typed object and Excel data via NPOI.
Stars: ✭ 348 (+690.91%)
Mutual labels:  export, import
Grafana Import Export
shell scripts for importing and exporting Grafana's dashboards and datasources
Stars: ✭ 125 (+184.09%)
Mutual labels:  export, import
Xnalaramesh
Blender addon Import/Export XPS Models, Poses
Stars: ✭ 262 (+495.45%)
Mutual labels:  export, import
Node Firestore Import Export
Firestore data import and export
Stars: ✭ 271 (+515.91%)
Mutual labels:  export, import
Dynein
DynamoDB CLI written in Rust.
Stars: ✭ 126 (+186.36%)
Mutual labels:  export, import
Dataset Serialize
JSON to DataSet and DataSet to JSON converter for Delphi and Lazarus (FPC)
Stars: ✭ 213 (+384.09%)
Mutual labels:  export, import

Cassandra Exporter

Cassandra exporter is a data export / import tool for cassandra that is simple to use and works for unicode and complex data types. It is developed in Javascript and the exported data is stored in JSON formatted files.

Why another tool?

Cassandra has some great tools for exporting and importing data:

  • snapshots
  • sstable2json
  • CQL's COPY FROM/TO

But the problem is snapshots and sstable2json are not that straight forward to use. They are intended for moving large data sets and to me unnecessarily complicated to use for day to day development.

The COPY command was intended for development or moving small datasets, but is not reliable. Because it uses csv exports which breaks for complex data types and non ascii encodings if you try to import that data. So for development purposes and for moving small datasets (< few million rows per table) I needed something that works robustly and is simple to use.

Download

You can either download the compiled binary for your operating system from the releases section or if you have nodejs installed, you can use the source code directly to execute the export / import scripts.

Usage (Compiled Binary)

To export all table data from a keyspace

HOST=127.0.0.1 KEYSPACE=from_keyspace_name ./export

It will create exported json files in the data directory for each table in the keyspace.

To import all table data into a keyspace

HOST=127.0.0.1 KEYSPACE=to_keyspace_name ./import

It will process all json files in the data directory and import them to corresponding tables in the keyspace.

To export/import a single table in a keyspace

HOST=127.0.0.1 KEYSPACE=from_keyspace_name TABLE=my_table_name ./export

HOST=127.0.0.1 KEYSPACE=to_keyspace_name TABLE=my_table_name ./import

To export/import using authentication

KEYSPACE=from_keyspace_name USER=user1 PASSWORD=pa$$word ./export

KEYSPACE=to_keyspace_name USER=user1 PASSWORD=pa$$word ./import

Please note that the user requires access to the system tables in order to work properly.

To export/import using SSL/TLS

KEYSPACE=from_keyspace_name USER=user1 PASSWORD=pa$$word USE_SSL=true ./export

KEYSPACE=from_keyspace_name USER=user1 PASSWORD=pa$$word USE_SSL=true ./import

Usage (from NodeJS)

If you already have nodejs installed in your system, then you can execute using the source directly like this:

HOST=127.0.0.1 KEYSPACE=from_keyspace_name TABLE=my_table_name node export.js

HOST=127.0.0.1 KEYSPACE=from_keyspace_name TABLE=my_table_name node import.js

Usage (Docker)

The Dockerfiles provide a volume mounted at /data and expect the environment variables HOST and KEYSPACE. Dockerfile.import provides import.js functionality. Dockerfile.export provides export.js functionality. By using the -v option of docker run this provides the facility to store the output/input directory in an arbitrary location. It also allows running cassandra-export from any location. This requires Docker to be installed.

Running tests

To run a test in the tests folder, for example numbers.js, run the command node tests/numbers.js at the root of the repo. A localhost cassandra must be running.

Tests use recent node.js features and requires Node.js 8.

Note

Cassandra exporter only export / import data. It expects the tables to be present beforehand. If you need to also export schema and the indexes, then you could easily use cqlsh and the source command to export / import the schema before moving the data.

// To export keyspace schema, use cqlsh like this
cqlsh -e "DESC KEYSPACE mykeyspace" > my_keyspace_schema.cql

// To import keyspace schema open the cqlsh shell
// in the same directory of `my_keyspace_schema.cql`, then
source 'my_keyspace_schema.cql'
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].