Tag archive for: ssh

How to migrate your MongoDB database instance with mongodump, mongorestore, tar and scp

Migration of MongoDB database is part and parcel of DevOps, especially when you are running your own projects.

MongoDB provides us with two utilities for performing database migration – mongodump and mongorestore.

A simple MongoDB database migration can be performed in 5 steps:

  1. Use the mongodump command to export the data of a MongoDB database instance as files in the source server’s filesystem.
  2. Use the tar command to compress the exported files as a single .tar.gz file in the source server’s filesystem.
  3. Use the scp command to send the .tar.gz file from the source server to the destination server.
  4. Use the tar command to decompress the .tar.gz file at the destination server.
  5. Use the mongorestore to import the extracted files into the destination MongoDB database.

This post discusses how you can perform MongoDB database migration with utilities provided by MongoDB and most Linux servers.

How to setup Raspbian Stretch Lite with remote configuration over WiFi on first boot

Two of the good features of Raspbian Stretch Lite is that it allows us to enable the SSH server and connect to our WiFi network before it boots up for the first time.

Combining these two features is useful for projects based on Raspberry Pi Zero W as we can configure Raspbian Stretch Lite via SSH without connecting extra peripherals to it.

This post documents how you can enable remote configuration of your Raspbian Stretch Lite over WiFi on first boot.