Skip to content
This repository has been archived by the owner on Jul 6, 2021. It is now read-only.

migrating_db

1u edited this page Mar 12, 2018 · 8 revisions

Copy db from a deployed instance to local machine:
in bin/ ./dbclone sshUser@domain.example db-name

Dump db - depricated

old example for sites deployed to meteor.com did you install mongodb-clients? if not, do so.
run in project-dir:

bin/dump-remote openki.nachhaltigkeitswoche.ch
bin/restore-remote openki-test.nachhaltigkeitswoche.ch openki_nachhaltigkeitswoche_ch
bin/restore-local openki_nachhaltigkeitswoche_ch

(ps: don't mess with system.user collection. in our script we just delete it)

manual editing example:

meteor mongo openki-test.nachhaltigkeitswoche.ch
db.Regions.remove({name: { $ne: "ZΓΌrich"}})
db.users.remove({$and:[{username:{$ne:'greg'}}, {createdAt:{$lt:ISODate("2015-02-17T19:30:51.465Z")}}]})
db.Events.remove()
db.Courses.remove({time_created:{$lt:ISODate("2015-02-16T19:30:51.465Z")}})