Reputation: 88
Can we import data from Amazon S3 into MarkLogic using
Please share the reference, if available.
Upvotes: 3
Views: 1027
Reputation: 3732
If you configure your aws credententials in the admin tool, you can use a URL of the form "s3://bucket/key" to access S3 for read or write.
See EC2 guide See Stackoverflow similar question
Upvotes: 0
Reputation: 130
Recently I faced the same issue and I used the following MLCP code for copying data over, and it worked.
mlcp export -host {host} -port {port} -username {username} -password {password} -output_file_path {S3 path} -collection_filter {collection name to be moved}
Upvotes: 0
Reputation: 437
Load test.xml file from AWS S3 bucket into the database associated with your REST API instance using the /documents service:
curl https://s3.amazonaws.com/yourbucket/test.xml | curl -v --digest --user user:password -H "Content-Type: application/xml" -X PUT -d @- "localhost:8052/v1/documents?uri=/docs/test.xml"
https://s3.amazonaws.com/yourbucket/test.xml
with valid URL of AWS S3 storageuser:password
with valid values localhost:8052
with URL of your MarkLogic app serverUpvotes: 0
Reputation: 8422
I'm not an AWS expert by any stretch, but I if you know the locations of data on S3, you can use xdmp:document-get(), with an http:// prefix in the $location, to retrieve documents. You can also use xdmp:http-get(), perhaps to query for the locations of your documents. Once that command has returned, you can use the usual xdmp:document-insert.
That approach should be fine for a small number of documents. If you have a large set you want to import, you'll have to factor in the possibility of the transaction timing out.
For a larger data set, you might want to manage the process externally. Here are a couple options:
Upvotes: 3