#Mongosync
Mongo sync is a project that allows a Drupal instance to easily send entitys of a specified type and bundle to a configurable MongoDB collection.
##Installation
- Install Mongosync:
drush dl mongosync
. - Enable Mongosync:
drush en -y mongosync
. - Navigate to Mongosync configuration page within Drupal by visiting http://mydrupalinstance.com/admin/config/mongosync
- Add Mongo Server connection details in the "MongoDB Server" settings form. See MongoDB instructions below for information on how to install and set up MongoDB for use.
- Open "Entity Sync Settings" and turn on "Sync entity of type bundle".
- Enter a collection name that you would like entity of type bundle to be inserted into.
- Save settings.
- Insert an entity of the type and bundle you specified.
- Verify that entities are being added to MongoDB collection.
##Installing PHP MongoDB Drivers
- If pear and pecl are not installed, install it.
- Install php mongodb drivers with pecl:
sudo pecl install mongo
- Add
extension=mongo.so
to php.ini. - Restart your web server (Apache or Nginx).
##Installing MongoDB Follow the installation instructions for your operating system on the official MongoDB documentation website.
##Configuring MongoDB
- Once you have MongoDB installed, crank up an instance by running
mongod
in your command line. - Open up a console to your mongod instance by running
mongo
in your command line. - Create an administrative user for Drupal. You can set permissions as you please. To add an administrative user for any database, run:
db.createUser( { user: "drupal", pwd: "drupal", roles: [ { role: "userAdminAnyDatabase", db: "admin" } ] } )
within your mongo console. - Use the user you created to connect to mongo from Drupal by adding the user credentials and connection details too the Mongosync settings. See above installation instructions.