Shopping Cart
7491fe38be5e4d12e1cf65a5f9269fde8c584adf

[How-to] Migrate information from MySQL to CouchDB – Server Tutorials


Methods to migrate to CouchDB from MySQL

As you understand, we now have now three alternative for storing information instantly accessible now:

  • First : use the outdated mysql library from essentialmode <= 2 (not recommanded as a result of it breaks servers with bugs associated to DataReader for instance)
  • Second : use a customized mysql library launched by @Brouznouf : mysql-async ([Release] MySQL Async Library – 3.3.2, there’s a information about this one)
  • Third : use CouchDB utilized by EssentialMode >= 3

If there’s extra, sorry, please discover me ^^’

However on this tutorial, we’ll see find out how to migrate MySQL information to CouchDB for individuals who needs to check it or develop with it.

Earlier than doing this, I extremely recommand you to learn this :

and

In case you are a developper, you may have to consider a brand new construction about your information

Requirement :

  • Having a working CouchDB 2 setup
  • Having PhpMyAdmin or data concerning the instrument you might be utilizing

1/ Export a desk (not all desk, only one, instance : police), with phpmyadmin or any instrument you like, in JSON Format

2/ Create a brand new database on couchdb associated to information you’ll export

3/ We’re going tu use curl so should you you could have Home windows, I recommand you to put in GitBash. On Linux, you may simply obtain packages

  • Linux

    • Please set up curl package deal (should you don’t know the way, it relies upon the distribution of your linux, so check with Google)
  • Home windows

    • Set up GitBash : https://git-for-windows.github.io/
      I recommand to not change default settings throughout set up should you don’t know what you might be doing besides about PATH surroundings (check with image)
      e8d1cf4f1095c21c8a54a191f917609f4ac552f9

4/ Open GitBash/terminal and go to the listing the place your exported file is (within the instance, my police.json is on the Desktop)

  • Linux

    • Use cd to vary listing (I believe you know the way to do :smiley: )
  • Home windows

    • Go to the listing you set your file then Left-Click on and choose “Git Bash right here”
      Sorry for French texts by the best way ^^
      c49f00c672397e7579290ad636c8eef831fcaa78

Now, you need to have this sort of window
a956c53bd8d4aea4aa9077ba3362b6c515cb8c4f

5/ Now it’s important to edit your exported file :

6/ Sort in GitBash/terminal :

curl -X POST 'http://person:[email protected]:port/dbname/_bulk_docs' -d @yourFile.json -H 'Content material-Sort:software/json'

7/ End :smiley:

Now you are able to do this tutorial for every desk you could have in MySQL server
You may as well verify on Google find out how to work together with CouchDB from FiveM and verify https://wiki.fivem.net/wiki/PerformHttpRequest
You may as well use essentialmode >= 3 by @Kanersps and verify his Wiki (https://kanersps.pw/wiki/index.php?title=Main_Page)

I hope this tutorial may also help a few of you.
If there’s any errors, please discover me and I might right them :wink:



Premium ESX Scripts? Click here!

Leave a Reply
FiveM ESX Scripts

The best scripts and maps

Best support

Problems? We are there to help!

Wide range of products

We have a wide range of products

100% Secure Checkout

Easy and encrypted