I run the same drupal site on a local server (i.e. my mac with mamp) and on a remote server (i.e. my hosting provider). I want to keep the two sites synchronized. My hosting provider does not allow ssh keys. I have already tried the drush aliases way, but with no success at all - I keep getting the message "no alias record could be found for source @.... So please, my question is this: What is the best and easiest way to keep the two versions (local and remote) of the same site synchronized?
-
There are many ways, but "best" and "easiest" primarily opinion based. They depend solely on what you value more and what you already know & can.– MołotAug 15, 2015 at 12:23
-
Thank you for your response. The best and easiest solution I found so far, is with drush aliases. But I do not know if I can use drush aliases to sync local and remote sites, without using ssh keys - is this possible? What other ways would you recommend to do the synchronization between local and remote sites?– gpantikidisAug 15, 2015 at 17:38
-
Maybe this comment could sound stupid, but I would change my hosting provider. Having the possibility to use SSH and drush, especially for a developer, is really important, at least for me. In this moment I spend about 9$/month, have full SSH access, tons of documentation and can backup all my sites with a single console command. If changing is an option, you should really change– user1527576Aug 16, 2015 at 9:58
-
1user1527576 ... Thank you for the reply. Your comment does not sound stupid at all. I have contacted my hosting provider to ask for the possibility to use SSH keys and they told me, that they will not allow this service for security reasons. Unfortunately I have paid for a two-year contract with them. So, changing hosting provider is not an option yet, but will most certainly consider it when the time comes. ;-)– gpantikidisAug 16, 2015 at 10:57
3 Answers
For your case (no SSH, no drush, no Git) I would suggest the following methods
Configuration Management module.
The configuration management module enables the ability to keep track of specific configurations on a Drupal site, provides the ability to move these configurations between different environments (local, dev, qa, prod), and also move configurations between completely different sites (migrate configurations) without the use of modules with all configuration being owned by the site.
Backup and Migrate module.
Back up and restore your Drupal MySQL database, code, and files or migrate a site between environments. Backup and Migrate supports gzip, bzip and zip compression as well as automatic scheduled backups.
"Configuration Management" module is useful when you are testing and altering node types, fields, views etc. and you just want to send you final changes to production (and the reverse).
With the "Backup and Migrare" module you can backup-restore (and schedule that) the whole or parts of the database and files. You can also utilize the excellent free service NodeSquirrel. You create the backup profiles according to your needs, save to NodeSquirrel, just restore from NodeSquirrel on your local server (and the reverse).
Beware: restoring a database with "Backup and Migrate" does not clean or drop the previous database tables issue
In case you are codding custom modules and themes OR you are updating core / modules AND you want an easier way to upload only the updated / changed files: I would suggest the Beyond Compare software. It does a excellent and fast compare / diff job with local - remote FTP folders. [1]
I am not in any way affiliated with the company. You can also try other comparing tools.
Edit:
- You can also try the stage file proxy module suggested by @Saphyel
- [1] Since you are using a Mac, you can also try the free software Cyberduck or FileZilla which both have "compare folder" capabilities. They are not the same as a dedicated compare/diff tool but they are free to use and they may be good enough for what you need.
For executing drush commands on others server you should have access via SSH, and you only have access via FTP. Your best option I think is doing every day on production a backup and download it and then in your local machine: drush sql-cli < db.sql or mysql db < db.sql
Maybe you can use the module stage_file_proxy so you don't have to copy files
I have same situation I use
module Webservice and view Data Export or Feeds at local Mac when i create new content offline it stock in my database local. i use CURL to detect if i have connection internet to server web if my connection is ready my cron will post new content from local to my web site via webservice REST. when i create new content from my website. my local can receive via RSS or view data export