2. Backing-Up the Project: FTP and GitHub

As an AWS Educate account is being used, there are limited free options available to back-up the instance or project code. Also, there is likely to be less support when it comes to troubleshooting issues with instances. I'm going to use two different methods to keep my project backed-up:

  • Storing a copy of the project files on my own PC via FTP (FileZilla)
  • Pushing my code to a GitHub repository


FileZilla
To make a copy of the project files on my local PC I'm using an FTP client named FileZilla. Using FileZilla, I'm able to connect to my remote AWS EC2 instance, find the appropriate project folder and pull the folder and its contents onto my PC. This is a fairly slow process, as all of the PHP and JavaScript packages installed with Composer and npm were included in the local back-up. However, it is good to have a full copy of the project which includes every file. See the FileZilla and local back-up copy in the screen capture below.



GitHub
I also wanted to push my code to a new GitHub repository, which would allow me to regularly and quickly push any updated code to an easily accessible location. To achieve this, I ran the following commands inside the project root folder using a terminal window:

git remote add origin https://github.com/allanc93/SooperBlog.git //Define the origin

git branch -M main //Specifies the branch to use

git add . //Add files to be committed (. means all) - the Laravel project already had a .gitignore file

git commit -m "First commit" //The message accompanying the first commit

git push -u origin main //Push the added files to the remote repository

Below is a screen capture of the SooperBlog project files in the SooperBlog GitHub repository, within my allanc93 account.



Comments