2.5.2 • Published 5 months ago

mongoose-copy-data v2.5.2

Weekly downloads
-
License
ISC
Repository
github
Last release
5 months ago

Database Copy Utility (CLI Tool)

Database Copy Utility (CLI Tool)

A utility package for copying data between MongoDB collections using Mongoose.

Table of Contents

Overview

The Database Copy Utility is a command-line interface (CLI) tool designed to facilitate the copying of data between two MongoDB databases. This tool allows users to specify source and target database connection strings and select specific collections to copy. It handles the connection to both databases, provides options for selecting collections, and copies data efficiently.

Prerequisites

Before using this tool, ensure that you have the following prerequisites installed:

  • Node.js
  • npm (Node Package Manager)
  • MongoDB

Installation

You can install the Database Copy Utility globally using npm:

  npm install -g mongoose-copy-data

Running the Tool

Once installed, you can run the tool in your terminal as follows:

mongoose-copy-data

Important Notice

1. First, it will delete all data from the target collections you have selected, and then it will copy all the data into the target database.
 
2. It will not make any changes to the collections in the source database.

Usage Steps

  1. When you run the tool, it will prompt you to enter the source and target database connection strings.

  2. After successfully connecting to both databases, you can choose whether to copy all collections or select specific collections to copy.

  3. If you choose the all collections, You will be presented with a list available collection to exclude the collections if you want. if you want to copy whole collection then press enter.

  4. If you choose to copy specific collections, you will be presented with a list of available collections to choose from.

  5. The tool will confirm your selections before proceeding with the data copy.

  6. It will then copy the selected data from the source database to the target database, providing progress updates along the way. Additionally, you can view the uploaded document's size and a progress bar.

  7. Once the data copy is complete, the tool will display a success message for each copied collection.

Dependencies

The tool relies on several Node.js packages for its functionality:

  • mongoose : MongoDB object modeling for Node.js.

  • inquirer : A collection of common interactive command-line user interfaces.

  • cli-progress : easy to use progress-bar for command-line/terminal applications.

  • figlet : Creates ASCII Art from text.

Configuration

Before using this package, make sure to configure the following environment variables:

  • SOURCEDATABASE: Connection URL for the source MongoDB database.
  • DESTINATIONDATABASE: Connection URL for the target MongoDB database.

Author

This Database Copy Utility was created by Gautam Kumar.

Feel free to adjust the content of the `readme.md` file as needed. This provides a comprehensive guide to compy the database collection into the other.

Package Information

2.5.2

5 months ago

2.5.1

8 months ago

2.5.0

8 months ago

2.4.0

8 months ago

2.3.0

8 months ago

2.2.0

8 months ago

2.1.0

8 months ago

2.0.0

8 months ago

1.3.0

8 months ago

1.2.0

8 months ago

1.1.0

8 months ago

1.0.0

8 months ago