Database - Conjunto de - Colecciones (tablas)
Coleccion - Conjunto de - Documentos (Rows)
Documentos - Conjunto de - Fields (Campos)
entonces:
EN SERVER 1 * Backupear la coleccion mod_alerta_alerta
[root@ip-10-180-217-106 ~]# mongodump -h 10.180.217.106 --collection mod_alerta_alerta --db site_3mdb -o /tmp/mod_alerta_alerta.dump
connected to: 10.180.217.106
Mon Feb 3 16:26:58.153 DATABASE: site_3mdb to /tmp/mod_alerta_alerta.dump/site_3mdb
Mon Feb 3 16:26:58.159 site_3mdb.mod_alerta_alerta to /tmp/mod_alerta_alerta.dump/site_3mdb/mod_alerta_alerta.bson
Mon Feb 3 16:26:58.217 2301 objects
Mon Feb 3 16:26:58.221 Metadata for site_3mdb.mod_alerta_alerta to /tmp/mod_alerta_alerta.dump/site_3mdb/mod_alerta_alerta.metadata.json
EN SERVER 2
* Importar la coleccion mod_alerta_alerta
[root@ip-10-138-58-82 ~]# mongorestore -h 10.138.58.82 --db=site_3bpremdb --collection=mod_original_alerta_alerta mod_alerta_alerta.dump/site_3mdb/mod_alerta_alerta.bson
connected to: 10.138.58.82
Mon Feb 3 17:02:41.706 /home/ec2-user/mod_alerta_alerta.dump/site_3mdb/mod_alerta_alerta.bson
Mon Feb 3 17:02:41.706 going into namespace [site_3bpremdb.mod_original_alerta_alerta]
2301 objects found
Mon Feb 3 17:02:42.055 Creating index: { key: { _id: 1 }, ns: "site_3bpremdb.mod_original_alerta_alerta", name: "_id_" }
* Eliminar Coleccion
> use site_3bpremdb
switched to db site_3bpremdb
> db.mod_alerta_alerta.drop()
true
> show collections
log
mod_alerta_alerta_historial
mod_aviso_aviso_inmueble
mod_aviso_aviso_inmueble_detalle_historial
mod_aviso_aviso_inmueble_historial
mod_aviso_aviso_proyecto_historial
mod_aviso_inmueble_historial
mod_aviso_perfil_inmueble_historial
mod_distrito_estadistica
mod_estadistica
mod_estadistica_general
mod_impreso_aviso_impreso_historial
mod_original_alerta_alerta
mod_pago_transaccion_historial
mod_pago_transaccion_notificacion
mod_paquete_paquete_agente_detalle_historial
mod_paquete_paquete_proyecto_detalle_historial
mod_peruid_usuario_peruid_historial
mod_usuario_perfil_agente_detalle_totales_historial
mod_usuario_perfil_agente_totales_historial
system.indexes
No hay comentarios:
Publicar un comentario