Changing web hosts can be a daunting task since it involves moving your files and databases.
Even though most web host will do a cpanel backup for you (provided that you are hosting on linux and running cpanel) so you can deploy the whole cpanel backup in your new webhost and restore everything, there are occassions where you might like to take things into your own hands and do a manual file + database transfer. If so, here are some useful commands to help you.
Ask your web host to give you SSH permissions so you can run commands directly on the server.
Zip directory into a *.tar.gz file
tar –czvf filename.tar.gz DirName
Zip File into a *.tar.gz file
tar –czvf filename.tar.gz sourceFile.extension
Use your web hosting server to download large files
wget –c filetodownloadpath.extension
* The –c switch allows you to resume files downloads
How To Load/Restore MySQL Backup Dumps
mysql –u username –ppassword dbname < dumpfile.sql OR
mysql –user=username –password=password dbname < dumpfile.sql
* dbname has to be created first before in mysql
Hopefully, these commands will help you go through a smoother web hosting migration.
Leave a Reply