Convert each row of the database into a JSONObject and store all the rows into a JSONArray
Convert the JSONArray into a json string using jsonArray.toString() and make an HTTP POST request. Make sure to set the Content-Type parameter to application/json
On the server side, process the request accordingly and store it into a database.
Note: If you're having large amounts of data, it might be better to transfer the JSON Objects in batches. You can add parameters to the requests to denote batch ids when you reconstruct the database.
EDIT: I'm assuming you know how to fetch the cursor to the database.
You can use the following code
JSONObject jObject;
JSONArray jArray = new JSONArray()
while(cursor.moveToNext()) {
jObject = new JSONObject();
jObject.put("id", cursor.getInt("ID"));
jObject.put("product_id", cursor.getString("PRODUCT_ID"));
jObject.put("amount", cursor.getInt("AMOUNT"));
jArray.put(jObject);
}
When you're building the HTTP POST request, do jArray.toString() to get a JSON string representing the array. Hope this helps.