17 private links
$ mongodump -d some_database -c some_collection
$ mongorestore -d some_other_db -c some_or_other_collection dump/some_collection.bson
You can select the collection via:
mongodump -d some_database -c some_collection
[Optionally, zip the dump (zip some_database.zip some_database/* -r
) and scp
it elsewhere]
Then restore it:
mongorestore -d some_other_db -c some_or_other_collection dump/some_collection.bson
Existing data in some_or_other_collection
will be preserved. That way you can "append" a collection from one database to another.
Prior to version 2.4.3, you will also need to add back your indexes after you copy over your data. Starting with 2.4.3, this process is automatic, and you can disable it with --noIndexRestore
.
psql databasename < data_base_dump
Something that looks similar to Perl's Data::Dumper in Java.
XML serialization has a myriad of uses, including object persistence and data transport. However, some XML-serialization technologies can be complex to implement. XStream is a lightweight and easy-to-use open source Java™ library for serializing Java objects to XML and back again. Learn how to set up XStream, and discover how to use it to serialize and deserialize objects as well as to read configuration properties from an XML configuration file.