2

Following my previous question, I plan to duplicate my website so that I have a production website and a staging site. I am going to have the staging site on a local version on Ubuntu, and it was recommended that I use Drush to keep them synced. Installing Drush locally should be no problem since I will be the full, and only, administrator. However my production site is hosting using shared hosting and the hosting company do not allow access to SSH, I have asked. Is it still possible to use Drush to sync the sites, and if so, how?

If however it is not at all possible, I would appreciate if you could suggest an alternative way of achieving the same thing please.

I'll admit that I'm diving in at the deep end here. I think I pretty much know what it is, however you can't say I'm too familiar with it.

Thanks in advance

2
  • 1
    Drush = Drupal + Shell. You will need to find a host with Shell access, unfortunately.
    – AKS
    Feb 5, 2013 at 19:46
  • @AyeshK That was what I was afraid of. Unfortunately I can't really move hosts so do you know of any alternative methods I could use to sync the sites
    – Andy
    Feb 5, 2013 at 19:58

2 Answers 2

4

Things are pretty rough without shell access. You'd have to do a lot of work to make this function correctly. First, take a look at the implementation of the drush rsync command. You're going to need to build something similar that uses sftp, or whatever your host allows access to, to transfer files.

Next, you're going to want to take a look at the file examples/sync_via_http.drush.inc. This shows how you can use the Drush sql-sync command, but use an http GET to fetch your database. Dumping the database and putting it in a location that it can be served up by the web server (securely!) is left as an exercise for the reader. You also have to make sure that your Drush alias records define the 'database' record for your remote site; if you don't, Drush will try to fetch it via a remote ssh call to Drush on the remote system.

Once you have this, you can use your sftp command to push your code to your hosting site, and drush sql-sync to pull your database to your dev site. You'll have to run updatedb manually through the admin interface whenever you push new code.

However, you will find that whatever you think it's going to cost you to switch sites, you'll probably find that the cost is worth it in terms of your time savings.

7
  • Hmm that does look very involved. I could probably attempt to do it but I'm no great PHP programmer and I don't think it would be a good idea since its not just a personal website.
    – Andy
    Feb 9, 2013 at 9:48
  • Regarding hosts, money, although needs to be considered, is not the main issue here. I have only just moved hosts and the company I'm with now was the only one I could find that really met my requirements. The only other company I could use is 1&1 but that's a big jump in price and a lot more hassle.
    – Andy
    Feb 9, 2013 at 9:50
  • Thank you for your answer but is there really no other alternative solution out there that does not require SSH/Shell access?
    – Andy
    Feb 9, 2013 at 9:58
  • I usually don't put referrals on StackExchange, but there are so many inexpensive hosting solutions out there with shell access, I find it hard to believe you can't meet your requirements. If you need full service (more than just hosting), try acquia.com or getpantheon.com. If you need to go super-cheap, try dreamhost.com for a managed service, or urpad.net for unmanaged. Make sure you get at least 512M RAM, and Drupal should be happy. The answer above is your only other real solution, and no one's really done it before because it's not worth it. Feb 9, 2013 at 17:04
  • 1&1 is already super-cheap; I don't see the problem. Feb 9, 2013 at 17:06
1

I have a hosting provider with WebDAV activated and SSH is not activated.

  1. On my MAC, I installed drush Drush install on Mac OS
  2. I mounted WebDAV to Finder (File Browser)
  3. On terminal

    cd /Volumes/<mywebsite.com>/public_html/
    
  4. Finally drush on local and let WebDAV synchronize your file.

    drush dl views
    drush en 
    

Warning

My WebDAV and (hosting) do not provide SSL enabled WebDAV. If you do not mind security, use at your own risk If you need more secure connection, pay for SSH/SFTP or/and SSL certificate

1
  • I can see how 'drush dl' would work but not 'drush en' as it makes configuration changes in your database.
    – chrowe
    Dec 3, 2013 at 18:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.