How to add your Project to Version Control – Part: 1
Create backup ,view & restore folder and files on Ubuntu server:
When you do migrate your project to version control first create/take a back of your current working project (files and folder) on the server. It will help to restore your project back in case of any issue during a migration. Following steps may helpful
Note : My Project folder path is /var/www/html/*
Create Tar Backup:
Backing up all files in a directory including sub directories
>/var/www/html>tar cvf /var/www/<mybackupfilename> *
c -> create , v -> verbose , f->files
mybackupfilename – tar backup file name. After execute the above command your files are store as a tar into following path /var/www/mybackupfilename
To view your backup tar file:
Use below command to view your backup tar files on the server.
/var/www/html>tar tvf /var/www/<mybackupfilename>
To restore your tar backup server:
Go to your project folder path & run following command. Restore files in to current directory
/var/www/html>tar xvf /var/www/< mybackupfilename>
x option is used to extract the files from tar file.
(OR)
Using Zip:
>sudo apt-get install zip
>zip -r <backup file path with bckup name> <original_file path>
>zip -r /var/www/mybackupfilename .zip /var/www/html
//Note: Whole folder of var/www/html
/var/www/html>unzip /var/www/zipped_file.zip