What? Moving WordPress via SSH on Shared Hosting? Sounds Odd? Yes, for many web hosts, it is possible to run the basic commands on SSH. Basically, today many traditional web hosts like Hostgator runs their business on others’ datacenter’s server running OpenStack Cloud Computing software. So, actually many undocumented, less documented methods actually can be done. SSH on Shared Hosting, however is not any secret. You can read our article on How to SSH to Shared Hosting Server.
There can be various situations when we are going to discuss about the topic Moving WordPress on Shared Hosting. First, we can move from a full IaaS or Cloud Server to a Shared Server for cost reduction, secondly we can move from one shared hosting to another shared hosting. We expect the reader will have the minimum idea about WordPress chown, chgrp, chmod Explained for FTP and SSH. We are talking about simple moving keeping the domain name, path etc. exactly the same. You can read our Moving WordPress guide for more details.
Moving WordPress via SSH on Shared Hosting : Basics
As you can understand, depending on the host, you might not be able to access MySQL database server via SSH as user. If you can, that is great! Else, you have to :
- Backup the whole FTP content on old server as tar ball and place it in some publicly accessible folder
- wget the tar ball from this new shared hosting’s SSH
As with tar, the things inside will probably not change the permission and ownership, you might need to change them to working condition. If you use rsync, that will probably give you the best result, although will take time.
For the Database part, it fully depends on the hosts whether you can access MySQL via command line or not. If you can, practically, the thing is becoming like the last part of installing WordPress on Ubuntu. Differences are :
- LAMP server is ready
- You are not the root user
- You do not belong to the sudoers group
- Derived from point 3, you can not run any command which needs sudo
Moving WordPress via SSH on Shared Hosting : Same Concept is Used By the Scripts
There are hundreds of php scripts, wordpress plugins are available to move wordpress. Basically the working principle is the same like that of running commands from SSH. php script, bash scripts can execute some commands which you can not run without sudo command from ssh.