MongoDB export/import

2023. 2. 11. 01:12서버 프로그래밍

mongodb 의 내용을 파일로 export 하기

$ mongoexport -d dbName -c collectionName -o filename --port 27017

export 해둔 파일을 mongodb 로 import 하기

$ mongoimport -d dbName -c collectionName --file filename --port 27017

 

mongodb 디비 덤프하기, import export 하기 / 몽고디비 다른 버전간 디비 이전하기

몽고디비 웹사이트에서 몽고디비를 소개하고 있는 문구입니다. document-based 라는 글귀와 No database ...

blog.naver.com

 

tar 파일 압축 및 압축해제 명령어

tar 압축하기

tar -cvf [파일명.tar] [폴더명] 
ex) tar -cvf sample.tar /home/sun/sample 



tar 파일 압축풀기

tar -xvf [파일명.tar] 
ex) tar -xvf sample.tar  

https://devpouch.tistory.com/100

 

[Linux] tar 파일 압축 및 압축 풀기 명령어(tar, tar.gz)

tar 압축 파일이 아닌 여러개 파일을 하나로 묶는 개념. 리눅스 환경에서 일반적으로 사용된다. 압축에 소비되는 시간이 적고 압축에 드는 리소스가 상대적으로 적다. 반면 용량이 거의 줄지 않

devpouch.tistory.com

 

간단하게 내 파일을 remote server에 전달할 때는 아래와 같습니다.

로컬 PC(Mac)에 있는 ngle.txt라는 파일을 10.10.0.56인 서버에 tongchun 계정으로 /home/tongchun/words/ 안으로 복사(업로드)합니다.

$ scp ngle.txt tongchun@10.10.0.56:/home/tongchun/words/
 
 

remote server에서 파일이나 디렉토리를 다운받고 싶다면 위치를 반대로 해주면 됩니다.

10.10.0.56 서버에서 /home/tongchun/ngle.txt 파일을 현재 위치에 다운로드 받고 싶다면 아래와 같이 사용합니다.

$ scp tongchun@10.10.0.56:/home/tongchun/ngle.txt ./
 
 
 
 
 

scp - 파일 또는 폴더를 업로드/다운로드 합니다.

간혹 Mac에서 서버(Linux)로 파일이나 디렉토리 전체를 업로드해야 할 때가 있습니다. 그럴때 scp (secure copy)를 사용합니다. ssh로 연결해 key 파일을 가자고 있다면 사용할 수 있습니다. scp는 ssh를 사

dejavuqa.tistory.com

 

WARNING: UNPROTECTED PRIVATE KEY FILE!<br>Permissions for '파일이름.pem' are too open. It is required that your private key files are NOT accessible by others. This private key will be ignored. Load key "파일이름.pem" : bad permissions 계정@서버 Permission denied (publickey).

https://techsoda.net/7

 

윈도우10 SSH 접속시 PEM 파일 퍼미션 에러 해결방법 - 테크소다

이 글은 윈도우10에서 BASH, WSL, 파워쉘을 통해 SSH 접속시 PEM 파일 퍼미션 에러가 날때 해결 방법에 대해서 다루고 있습니다. 윈도우10에서 OpenSSH 클라이언트를 설치하면 명령프롬프트나 윈도우 파

techsoda.net