Mongorestore,从流星生产服务器到本地 [英] Mongorestore, from meteor production server to local

查看:60
本文介绍了Mongorestore,从流星生产服务器到本地的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经找到了很多有关如何使用mongodump和mongorestore,如何备份流星生产服务器并在需要时还原备份的良好说明:

I've found plenty of good instructions on how to use mongodump and mongorestore, to back up my meteor production server and restore the backup if need be:

meteor mongo --url myApp.meteor.com

mongodump -u client -h production-db-b2.meteor.io:27017 -d myApp_meteor_com -out dump/2014_10_21 -p [password from meteor mongo --url]

mongorestore -u client -h production-db-b2.meteor.io:27017 -d myApp_meteor_com dump/2014_10_21_v2/myApp_meteor_com -p [password from meteor mongo --url]

我还没有找到关于如何将备份转储恢复到我的本地流星应用程序的解释.我的应用程序文件夹中有一个mongodump输出.我不确定是否可以使用mongorestore还是应该做其他事情.

What I haven't found is an explanation of is how to restore a backup-dump to my local meteor app. I have a mongodump output in my app folder. I'm not sure if I can use mongorestore or if there's something else I'm supposed to be doing.

推荐答案

我找到的最简单的方法:

The easiest way that I found:

    在项目中
  1. cd并执行meteor命令
  2. 在另一个终端:
  1. cd in your project and execute meteor command
  2. in another terminal:

mongorestore -h 127.0.0.1 --port 3001 -d meteor dump/meteor

更改127.0.0.1如果您的本地主机具有不同的IP地址,并且3001到您拥有mongodb的端口(通常为30013002,因此请同时尝试),dump/meteor是指向转储您先前创建的内容.

change 127.0.0.1 if your localhost has different ip address and 3001 to a port you have mongodb on (it is usually 3001 or 3002, so try both), dump/meteor is the path to a dump you created previously.

也是导出本地数据库的最简单方法:

Also the easiest way to export local db:

    在项目中
  1. cd并执行meteor命令
  2. 在另一个终端中:
  1. cd in your project and execute meteor command
  2. In another terminal:

mongodump -h 127.0.0.1 --port 3001 -d meteor

,如果需要,请更改localhost ip和端口. .结果,在运行mongodump之前,将在您的cd文件夹中创建带有db文件的转储/流星文件夹.

again, change localhost ip and port if needed. . As a result, the dump/meteor folder with db files will be created in the folder you cd before running mongodump.

祝你好运.

这篇关于Mongorestore,从流星生产服务器到本地的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆