DEV Community

Margo McCabe for HarperDB

Posted on • Edited on

MongoDB to HarperDB Migrator: Tutorial

As you may already know, our goal at HarperDB is to be the easiest, most user-friendly, and intuitive database there is. Keeping in line with this, along with the many resources, features, and packages that come with HarperDB, we recently launched the HarperDB Migrator tool.

The HarperDB Migrator allows you to quickly and easily replicate data from your existing database into HarperDB. You can access the HarperDB Migrator under the Resources tab in the Studio.


Curious about why developers are migrating from MongoDB to HarperDB? As Jake, our Director of Product Management, states in this blog: While MongoDB might be the most prolific NoSQL database in existence, there are certain cases that could be better served with another solution. Examples would be use cases where you need both SQL & NoSQL, rapid app development, integration, edge computing and distributed computing. Maybe you saw our benchmark and learned that HarperDB is 37 times faster than MongoDB at less than half the price. HarperDB also has a native REST API, supports SQL on JSON, and scales out of the box for concurrent operations. Give it a try and let us know your thoughts!


Migrate to HarperDB with these Simple Steps

We currently support migration from MongoDB, but we're working on other platforms.

First youโ€™ll need to download the correct migrator tool for your system (Mac, Windows, or Linux). Then install and open the HarperDB Migrator app.

Once the app is open, you can configure the connection to both of your databases. Enter this info in the fields provided. (You can find this info in the HarperDB Studio either on the card on the Instance page or on the config tab).

Alt Text

Click the white checkmarks on both the Source and the Destination. You will see green boxes once the connection is confirmed.
Note: If thereโ€™s an error and you see red instead of green, it means that either the Migrator canโ€™t access the server or the credentials are incorrect.

Alt Text

Next the Migrator will display your existing MongoDB databases and HarperDB schemas, expanding databases/schemas will show respective collections/tables. If you need to create a new HarperDB table to migrate data to, you can do so, then click the Refresh button to see the new table.

Alt Text

Then click the next arrow on the right and the migration process will begin.
Note: Larger datasets will be batched in groups of 1000 documents/rows.

Alt Text

Finally, you will see the completion message on your DB Migrator screen.

Alt Text

Now you can check your associated table in HarperDB and you will see the migrated data, and you can repeat the process for as many tables as needed. The MongoDB ObjectID will automatically be stored in the HarperDB hash_attribute.

See, it really is as easy as 1, 2, 3!

Top comments (2)

Collapse
 
andrewbaisden profile image
Andrew Baisden

Very cool never thought I would consider another database outside of MongoDB and PostgreSQL but HarperDB is right up there too in my opinion.

Collapse
 
margo_hdb profile image
Margo McCabe

Thanks Andrew, this is music to our ears!