Search code examples
ibm-cloudcloudant

Replicating a remote database from Bluemix


Database URL: https://$USERNAME:$PASSWORD@$REMOTE_USERNAME.Cloudant.com/$DATABASE_NAME

What is the value of $USERNAME、$PASSWORD、$REMOTE_USERNAME? enter image description here

enter image description here

The current Cloudant account:

VCAP_SERVICES
{
    "cloudantNoSQLDB": [
        {
            "credentials": {
                "username": "c39cexxx-bluemix",
                "password": "xxxxxxx",
                "host": "c39cexxx-bluemix.cloudant.com",
                "port": 443,
                "url": "https://c39cexxx-bluemix:[email protected]"
            },  
        }
    ]
}


The other Cloudant accounts in a database
VCAP_SERVICES
{
    "cloudantNoSQLDB": [
        {
            "credentials": {
                "username": "f39c4xxx-bluemix",
                "password": "xxxxxxx",
                "host": "f39c4xxx-bluemix.cloudant.com",
                "port": 443,
                "url": "https://f39c4xxx-bluemix:xxxxxxx@f39c4xxx-        bluemix.cloudant.com"
            },  
        }
    ]
}

Please give an example of replicating a remote database from Bluemix.


Solution

  • If you want to replicate from a remote target into a local database, your Database URL will be:

    https://$remote_username:$remote_password@$remote_username.cloudant.com/$remote_database
    

    E.g.

    https://f39c45g0-bluemix:[email protected]/the_remote_database
    

    You can find more information here: https://developer.ibm.com/clouddataservices/cloudant-replication/


    NOTE: I'm assuming you didn't post your actual credentials, if you did you should at least change your passwords.