Skip to content

Instantly share code, notes, and snippets.

@faizanayubi
Last active February 23, 2016 07:03
Show Gist options
  • Save faizanayubi/d5f00b5e2adc92e29c6f to your computer and use it in GitHub Desktop.
Save faizanayubi/d5f00b5e2adc92e29c6f to your computer and use it in GitHub Desktop.
Shift a server
1. tar a file
tar -cf folder.tar folder/
2. Backup database
mysqldump -uroot -p database_name > dumpfilename.sql
3. transfer files to server
wget -m --ftp-user=cloudstuffs --ftp-password=pass123 ftp://ftp.cloudstuffs.com/public_html.tar
or
scp [email protected]:/home/vijay/webackups/milan/www.tar /var/www/
4. untar a file
tar -xvf public_html.tar
5. move files to public_html
tar -xvf public_html.tar
mv -v public_html/* /directory/to/move
6. Restore database
mysql -uroot -p database_name < dumpfilename.sql
7. Change uploaded file permission
chown -R username:groupname foldername
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment