DEV Community

Arshan Nawaz
Arshan Nawaz

Posted on

Download your Mern stack app Using scp (Secure Copy)

Step 1: Create Backup on Server
Connect to Your Server:
Use SSH to connect to your server. Replace and with your server's username and IP address.

ssh <remote-user>@<remote-ip>
Enter fullscreen mode Exit fullscreen mode

Step 2: Create a Backup Directory (if not already created):
Create a directory to store your backups. For example, let's create a directory named backups in your home directory.

mkdir -p ~/backups
Enter fullscreen mode Exit fullscreen mode

Step 3: Create the Backup:
Assuming your application files are in /var/www/websiteFolder/, create a backup of the portfolio directory.

tar -czvf ~/backups/app-backup-$(date +%F).tar.gz /var/www/portfolio/
Enter fullscreen mode Exit fullscreen mode

Step 4: Download Backup to Local Machine
Open a New Terminal Window (on your local machine):
Open a new terminal window or tab on your local machine.

Download the Backup:
Use the scp command to download the backup file from the server to your local machine. Replace , , and accordingly.

scp <remote-user>@<remote-ip>:~/backups/app-backup-$(date +%F).tar.gz <local-path>
Enter fullscreen mode Exit fullscreen mode

for Mac

mkdir -p /Users/username/backup
scp <remote-user>@<remote-ip>:~/backups/app-backup-$(date +%F).tar.gz /Users/username/backup
 app-backup-$(date +%F).tar.gz is file name. Also you can verify the name.
Enter fullscreen mode Exit fullscreen mode

Step 5: Extract Backup file
Open terminal in /Users/username/backup and run command

tar -xzvf app-backup-2024-05-21.tar.g
 app-backup-2024-05-21.tar.g is file name, it can different in your case
Enter fullscreen mode Exit fullscreen mode

Image of Datadog

The Future of AI, LLMs, and Observability on Google Cloud

Datadog sat down with Google’s Director of AI to discuss the current and future states of AI, ML, and LLMs on Google Cloud. Discover 7 key insights for technical leaders, covering everything from upskilling teams to observability best practices

Learn More

Top comments (0)

Heroku

This site is powered by Heroku

Heroku was created by developers, for developers. Get started today and find out why Heroku has been the platform of choice for brands like DEV for over a decade.

Sign Up

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay